Problem with Flat Sequence Structure | 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
Problem with Flat Sequence Structure
April 8, 2020
9:39 pm
Avatar
rpscd
Member
Members
Forum Posts: 7
Member Since:
April 8, 2020
sp_UserOfflineSmall Offline

I am using an Arduino Nano.

The basic function of my program is to monitor a battery and close a relay as long as it is above a certain voltage. After the voltage of the battery drops too low, the relay opens and the Arduino's onboard LED double-flashes every second.  

I originally tried using a Flat Sequence Structure but the LED doesn't flash, it remains on. I posted the code titled "Blink LED Not Working".

 

I found a fix by removing the Flat Sequence Structure and using the Error line to determine sequence. That code is also posted and titled "Blink LED Working".

I don't know where the bug is exactly but removing the flat sequence structure fixed it. I also removed the For Loop and replaced it with code similar to the Example "Digitial Output - Blink LED" which also worked meaning there is some issue between For Loops and Flat Sequence Structures.  Any idea on why this happens and if it is something that can be fixed?

April 9, 2020
7:20 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

There is a known issue with deeply nested structures.  Refer to this post:

https://www.geverywhere.com/fo.....ested-VIs/

It is an issue that can be avoided by not using flat sequence structures as you found.  It is best practice to use the error wires and subVIs for program flow.

April 9, 2020
7:33 pm
Avatar
rpscd
Member
Members
Forum Posts: 7
Member Since:
April 8, 2020
sp_UserOfflineSmall Offline

Thanks Seffan, I will take note of that and default to using error wires for program flow. 

Do you know if this is more of an Arduino issue or a bug in the compiler?

April 10, 2020
5:19 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

There are a few open issues that are sparsely documented on this forum.  They have now been consolidated and added to the Release Notes section here.

Also, there are some general things to be aware of that are documented in the FAQ here.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
29
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