03-13-2015 09:00 AM
I am trying to make a simple jog program for a stepper motor using my cRIO 9073, which includes my NI9512 and the stepper driver 70530. I can communicate and control the motor, except when I write a program using an event structure.
Does this configuration not allow the use of a Event structure in a while loop?
Thanks
03-14-2015 12:05 AM
03-16-2015 08:15 AM
Thank you for answering Mike. That is what I thought. I am obviously using this one incorrectly. I have attached my simple VI.
When I run it through highlighted, it stays in the Timeout event.
Thanks for looking at it.
03-16-2015 11:56 AM
Ok, first a recommendation. To make sure the basic interface works as intended, remove all the motion control stuff and simply put in a string indicator that shows the name of the last state to execute. With that modification in place I see that the code does indeed run in the timeout event every 50 ms. When you mouse down on a button, that cycling is interrupted and one mouse down event is executed, after that it goes back to the timeout. Likewise, when you let the button up, one mouse up event is executed, after which it goes back to the timeout.
Is this the behavior you want?
Also you should have the event structure handle the stop button as well, that is where the deinitialization logic really belongs.
Mike...
03-16-2015 12:09 PM
Mike,
I did exactly that before I posed my question. It worked exactly as you discribed it. The problem is when I I add the motion back in it seems to inhibit the events. I had the Stop in the event structure, however it didn't work with the motionin the events.
I actually just created this event structure with only one event
The stop button will not stop the loop. The event structure stays in the timeout state.