12-20-2017 12:28 PM
Hello,
I am trying to create a test that uses Labview to interface with an arduino that turns on and off relays. The example code I have included is what i want it to do, but it uses a lot of local variables. I was wondering if someone has a better idea on what to do. If possible I would like to be able to reset all of the indicators and controls back to default state at the beginning of a test (I wasn't able to figure out how to do that).
(I am just using constants to prove my point so I didn't put the Arduino (LINX) sub vi's in the code)
Thanks.
12-20-2017 07:06 PM
I can't look at your code, but what you described indicates that you need to learn to use shift registers to hold your current state.
12-21-2017 10:21 AM
I wonder why you cant see the code. Anyway the way I have it set up I cant use shift registers because the controls are not the same for each state. Or maybe there is but I am not seeing it. I'll reattach the code maybe it will work this time.
12-21-2017 11:28 AM
@Collin.Fischels wrote:
I wonder why you cant see the code.
The reason what that I was on my phone at the time.
Now that I reread everything here 5 times, I'm pretty sure what you really need to do is implement a State Machine.
12-21-2017 12:06 PM
I can seen your code, I guess now I can't unsee it...
There is no loop? Don't tell me you run this by using the Continuous Run button!
Here is a couple resources to get you started
https://www.ni.com/getting-started/labview-basics/
http://www.ni.com/getting-started/labview-basics/dataflow
https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:labview:basics
12-21-2017 12:10 PM
No I am not using the continuous run button. I know the basics of Labview.
12-21-2017 12:16 PM
@Collin.Fischels wrote:
No I am not using the continuous run button. I know the basics of Labview.
Sorry, when I see such heavy use of flat sequences my first instinct is to direct people to review LabVIEW basics .
12-21-2017 12:29 PM - edited 12-21-2017 12:34 PM
Problem is I have tried to do this with a state machine and I am unable to get it to work like how I have it with the sequences. Trust me I don't want to use the sequences just cant seem to get the case structures and event structures to do what I want.