LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structures and soft Motion

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

 

0 Kudos
Message 1 of 5
(2,507 Views)
Event structures inherently make no difference, it depends on how and where you use them. Can you show some code? How is it structured? Where is the event structure located?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(2,481 Views)

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.

0 Kudos
Message 3 of 5
(2,436 Views)

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


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(2,425 Views)

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

diagram3.png

 

The stop button will not stop the loop. The event structure stays in the timeout state.

0 Kudos
Message 5 of 5
(2,419 Views)