1:10 am
October 25, 2016
Folks:
I am having difficulty getting global variables to work on the Arduino UNO with the compiler.
So, I generated the uploaded VI and subVI to try and run a short test I could share for ideas on corrective action.
The subvi is configured to store the input in a global variable loaded from the Arduino Compiler for Labview Structures Pallet.
What I expected to happen is the top level vi runs and the for loop runs 10 cycles. The increment counter for the loop is wired
to the subvi input. The action input is wired to a zero so it is always in the store mode. Checking out the subvi block diagram,
\
I have 3 strings of data returned via the serial port as the telemetry output from the task.
I should see the string data in the communication window (see enclosed JPG) increment from 1 thru 10, but in fact it is always 0.
I have tried this in one of my applications and I always get zero there as well.
Any ideas on why all zeros and not the expected loop count. I am using LV 14.
WR63
8:15 pm
March 12, 2015
The issue you are facing is not related to global variables, rather the use of the sequence structure. There is a known issue with multiple levels of embedded structures. Here you have a subVI followed by a multi frame sequence structure followed by a case structure. The issue is that the input is getting dropped once it hits the sequence structure. Remove the sequence structure and it should work. Typically you would not use globals for write/read within the same subVI, rather use them for sharing data between the main VI and an interrupt VI or a subVI. But removing the sequence structure should help your case.
19
1 Guest(s)