LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating structures: state machine with controls

Solved!
Go to solution

hi, sorry that i didnt get a chance to do this.

i was stuck doing validations for a couple of months. i want to go back at this and figure this out.

 for the producer/consumer structure,

why is there a "no error" and "error" case?

is that what I should replace with "state machine?

 

what do i do about the constants time displaying loop on the front page?

where do i put that?

 

Best regards,
Krispiekream
0 Kudos
Message 11 of 17
(1,414 Views)

here is what i have going from rev C of my first post.

i dont know how to keep the data from the big data cluster.

Best regards,
Krispiekream
Download All
0 Kudos
Message 12 of 17
(1,401 Views)

Hi Krispie

 

Thanks for the question, I know the producer consumer architecture can get tricky. The error wire that you see running from the event VI to the stop button on the consumer loop is used to stop execution when no data is in the queue. The error handling is used so that we do not execute any code when the error is detected as true. If the queue has no data to be operated on we simply finish the loop and initiate it again. Now I know this may be a little confusing as normally error would indicate something has gone wrong in our code, with the producer consumer design we simply use it to identify whether or not to run the consumer loop. Please let me know if this helps answer your question regarding what function the error wire performs.


Thank You
Eric Reid
National Instruments
Motion R&D
Message 13 of 17
(1,372 Views)
thanks for your help. can you suggest a solution to my answer? what can i do or write on to the code to make it stop only when i click on a button. i want that loop to be continous till stop button is press. i am learning to do more than just that, but i cant seems to get the easiest thing to work. i cant go on farther.
Best regards,
Krispiekream
0 Kudos
Message 14 of 17
(1,356 Views)

Hi Krispie

 

It looks like your code is designed to initialize data in a system and this is what you are using your state machine for. Based off the original paint drawings it looked like you intended to run the state machine to initialize your code and then run it continuously after until a stop button was pressed. In the current producer/consumer architecture we are running the initialize with new parameters everytime the button is queued. Is this intentional to the design? One way to always stop your code in a simultaneous manner would be to run another look in parallel (place a small wait timer in it) with a local variable that would communicate with all the loops to stop them. 


Thank You
Eric Reid
National Instruments
Motion R&D
Message 15 of 17
(1,336 Views)
"Based off the original paint drawings it looked like you intended to run the state machine to initialize your code and then run it continuously after until a stop button was pressed" you are right about that.. i have so many local varialbes that i want to get rid of. i was thinking about using wires to handle that but i am stuck at the point where two parallel loop are running. i dont know where the main bundle wire will go to. also with that method, i can't control the locals that control the buttons well due to when control values are changed, the wire doesn't know that because it was carrying data from the bundle. i hope its clear. john solde sugguested producer/consumer structure, but i can't seems to understand it yet..
Best regards,
Krispiekream
0 Kudos
Message 16 of 17
(1,331 Views)

Hi Krispie

 

It looks like the issue regarding the parallel loops is currently under your new discusion thread. Since it appears as though the state machine portion of your code is well understood, I believe we should continue the discusion there.


Thank You
Eric Reid
National Instruments
Motion R&D
Message 17 of 17
(1,309 Views)