06-30-2016 08:15 AM
I have a front panel that has an "EXIT" button for the purpose of killing the two independent while loops running in the block diagram. But it does not seem to work. Could anyone offer me a way to do this?
06-30-2016 08:18 AM
Do you have an example image of the block diagram?
06-30-2016 08:29 AM
Here is the meat of it:
06-30-2016 08:29 AM
Click File -> New.... (Not New VI). Under the From Template category, there are some design patterns that have multiple loops. (master/slave, producer/consumer).
06-30-2016 08:49 AM
I do not think that is what I want though. I want indepent loops not driven buy some other loop that can be "killed" from a single "kill" button...
06-30-2016 08:55 AM
What does debug say?
Does stop event happen?
What does it read in while loop?
Do you have false connected to shutdown after bottom loop?
06-30-2016 09:21 AM
Error code -1074384860.
Anyways, I discovered that the application protocol in the CAN DBC file being used was not set to SAE J1939 as it should have bee.. This caused an error to propagate throughout the block diagram. I will retest again see what happens.
06-30-2016 09:23 AM
@swbpnole wrote:
I do not think that is what I want though. I want indepent loops not driven buy some other loop that can be "killed" from a single "kill" button...
Then you misunderstood some very basic concept of dataflow programming. Maybe you should reconsider using NI LV.
That being said, it is always VERY BAD PRACTISE to 'kill' loops without running through proper cleanup routines inside the loop.
Passing "Shutdown" via queue to run through the Shutdown state of the slave/consumer (whatever name you choose) is the highly recommend way to do a shutdown.
When having multiple loops in parallel, a broadcast technology like notifier could be easier to use compared to queues; however, the concept still stays the same.
Norbert
06-30-2016 09:26 AM
@swbpnole wrote:I do not think that is what I want though. I want indepent loops not driven buy some other loop that can be "killed" from a single "kill" button...
Your loops don't appear to be independent to me. You reference the same queue in both loops so I would assume data is flowing between them. Why not use that queue structure to kill your loops, similar to the Producer/Consumer design pattern? Since your queue is string based, you can send a "STOP" message when the button is pressed and use that message to kill the top loop.
06-30-2016 09:31 AM
The queues in image have CAN frames as their type.