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.
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.
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).
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.