From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh controls with asynchronous motion

I'm using SoftMotion on a cRio 9047. For testing, we have controls in a simple Vi using express Vis on asynchronous timing. Once the execute button is pressed, I'd like for the button to be unpressed once the move signals done. I'm using a case structure to do this in the snippet, but I'd like to know if there is another way (perhaps more compact). I'm guessing a feedback node could do the same thing, but I'm not sure how to do it.

refresh_ansyc.png

0 Kudos
Message 1 of 3
(1,970 Views)

Using this code with Asynchronous calls would be a huge race condition. For example, the Power call would not block, so the Straight Line Move may not start until the drive is actually enabled. I would recommend just going to Synchronous Express VIs, let the calls block until the action is completed, and writing loops in such a way that you can have other asynchronous actions if needed (which I assume is why you wanted un-blocking code in the loop).

0 Kudos
Message 2 of 3
(1,935 Views)

Thanks for the reply. I realize the example doesn't test for completion when entering the loop. With sync timing, I believe I need one large, or many small state machine loops; whereas with async, I can put all the express Vis in one loop. I can do either. I'm most interested in what other ways you can use the "done" (or abort etc.) signals to revert the control to false. Thanks again for the reply.

0 Kudos
Message 3 of 3
(1,923 Views)