Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with clearing the buffer for contoured motion; Errors -70061 and -70137

Solved!
Go to solution

I am trying to generate a motion code which synchronizes a contoured motion with data acquisition using breakpoints; the VI (attached) is loosely based on the 25229.vi provided on ni.com.  I am using a PXI-7354 motion controller and running Labview 2011.  I can run the VI once (successfully), complete the desired motion, trigger the breakpoint, and take data with no error messages.  Then if I try to run the same VI immediately afterwards, the motor will move only 5-6 steps and then stop; no data is collected and no error messages are displayed.  Then when I run it a third time, the motion and DAQ complete but I get error messages at the Clear Buffer.vi saying that the buffer is in use (Error -70061).  I also get Error -70137 at the CheckBuffer.vi, which I think is because it is still monitering the buffer after the ClearBuffer.vi fails.  

 

Do I need to include an additional initialization/clearing of the buffer somewhere?  

 

Thanks,


Matt

0 Kudos
Message 1 of 3
(5,086 Views)
Solution
Accepted by topic author MattCS

Hi MattCS,

 

I believe you are seeing this undesired behavior because you are not initializing your shift registers. The data from your last run will still be saved in your shift registers so next time you run it will start from where it left off. So if you push the stop button while running the VI the first time it will stop and everything works, but then the second time you run the VI the while loop will stop after its first iteration since its referencing the old value in the shift register. Also if you ever have an error in the while loop it will continue to be there every time you run the VI. Please try the changes circled in the image below and see if that help.

 

 

shiftReg.PNG

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(5,076 Views)

That was exactly the problem - thanks very much Tim!

 

Cheers,

 

Matt

0 Kudos
Message 3 of 3
(5,069 Views)