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


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 4 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
New Member
Forum Posts: 2
Member Since:
October 25, 2016
sp_UserOfflineSmall Offline


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


October 28, 2016
8:15 pm
Forum Posts: 304
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: 33

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18


Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Geraldkix, ThomasSoogs, Angelvor, AngelaMuh, Nsneilohone

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89