Global Variable Use on Arduino UNO | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Global Variable Use on Arduino UNO
October 27, 2016
1:10 am
Avatar
WR63
Member
Members
Forum Posts: 3
Member Since:
October 25, 2016
sp_UserOfflineSmall Offline

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.Compiler-and-Run-acreens2.jpgImage Enlarger

WR63

sp_PlupAttachments Attachments
October 28, 2016
8:15 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

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.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
19
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356