12-17-2014 12:58 PM
Here's a code snippet that you can drag and drop to a LV 2009 block diagram.
Kurt
12-17-2014 06:49 PM
Hey Kurt
I will try to incorporate your code into my vi.
I will go with the first vi you attached earlier.
Get rid of the while loop
Thanks for the help.
I will post the final product when done.
12-21-2014 04:18 PM
Hey
Here is the final VI
I attached version 9
version 13 and a pdf directions doc
Thanks for all your help!
12-22-2014 02:41 PM
Why are you resisting using the state machine for this? You could to all of that on a much simpler code structure.
If I had to modify your code, I'd scrap it and reprogram it. too complex and your block diagram is MASSIVE.
12-22-2014 03:37 PM
I have never used or programmed a state machine
I am not sure how to begin.
12-22-2014 03:42 PM
Start by reading this: Application Design Patterns: State Machines. If you look in the project templates, there should be a simple state machine to give you a start. State Machines can be really simple and are very powerful.
12-22-2014 04:02 PM
I get it.
So my states:
All can be done using this architecture?
It would be easier now that i know what to do with the coding
Thanks!
12-22-2014 04:07 PM - edited 12-22-2014 04:10 PM
Yes. You can use those states to do everything you need to. If you need more states, that's fine. You can have an infinate number of them. Think of a flowchart when you design it.
I would strongly suggest using a 'Wait on Event" state and place a Event Structure within that state so your not pooling and using up CPU resources. Look them up. Another powerful tool you can use with the State Machine.