11-26-2005 10:37 AM
11-29-2005 10:40 AM
Hi Laine,
You can use datasocket, TCP or UPD to transfer the boolean values between the host and the traget vi. In the target vi, you can read this boolean value and pass data across the while loops using RT FIFOs. You can create an RT FIFO for each while loop you want to stop. On the host vi you can use local variables to pass data between loops. The links below give more information:
Command-based Architecture for LabVIEW Real-Time http://zone.ni.com/devzone/conceptd.nsf/webmain/CD63FD0F746B17A686256F090065F572
TCP/IP between the Host PC and Real-Time Series Hardware http://zone.ni.com/devzone/conceptd.nsf/webmain/d02ce14a6781d1b7862568d200554988
11-29-2005 11:53 AM
11-30-2005 10:37 PM
Hi Laine,
Do you see any issues with using a stop button with a switching action and changing the termination condition from 'Stop if True' to 'Continue if True'? This will let you use local variables.
Regards,
Prashanth
12-01-2005 03:59 PM
I have tried this. A little more complicated (must write F before or after loop runs) & seems more like a workaround.
I though more about it and am now trying to just pass the criteria values back to the host, then let the host make the judgement. The host would stop its loop on StopButton OR criteria_met condition, then just pass a stop command to the target (which can't tell the difference, it just knows it needs to stop). This eliminates the stop command bidirectionality. Looks ok on a small test program.
But I am interested in comments from anyone who has used the Command-Based Architecture. Such a simple task seems unusually difficult.
Thank you for your input.
12-03-2005 04:45 PM
Hi Laine,
The issue primarily reduces to choosing different mechanisms to transfer a boolean data between loops on your host VI.
You can use a boolean button with a switching action on your target vi's front panel which is set to true when your motor condition is met and then initialized every time the target vi starts. This boolean data can be transferred to the host vi using TCP. You can then create a boolean control with a switching action on the front panel of your host vi to indicate that the condition to stop has been received from the target vi. This vi will also have to initialized every time your host vi starts. Now the issue reduces down to choosing a mechanism to transfer this boolean value between loops on your host vi. Besides using local variables and propery nodes to pass the data between loops, you can just add another condition [value change event of the second boolean button with switching action] to be monitored by the 'Stop' case of your event structure.
Hope this helps!
Regards,
Prashanth