Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

double buffered contouring move with PCI 7344

Hello, my spec is labview 7.0, PCI 7344, stepper motor.
i want to use double buffered contouring movement to generate a continuous movement.
i will key in an array of new data to the write buffer VI on the fly.the program works very well, if the new array has written to buffer before the read buffer VI finish reading the data of previous array. which means it will generate an error if i key in my data after the read buffer VI finish reading the previous data. how can i overcome this probelms ?

i intend to ask the motor to move in constant velocity in the time gap where the read buffer VI finish reading the previous array of data and the new data yet to come in.
am i allow to do that ? if yes , how ?
hope that u can unders
tand my problem.thanks
0 Kudos
Message 1 of 4
(3,357 Views)
Thank you for contacting National Instruments. From your description, it sounds like you are running into the problem because the expected error is being generated and causing your application to terminate. If I understand your problem correctly, then it sounds like you simply need to check for and examine the error cluster and handle it appropriately.

You can use the Check Buffer VI to examine the buffer and check how many remaining points are left. When that buffer reaches zero, meaning you have not inputted a new data set yet, then you can handle the error appropriately. I would recommend using a Case Structure where, if an error occurs, you clear out that error using the Clear Errors VI. At this point, you can also begin the constant velocity move that will co
ntinue until you enter in a new set of points. When you enter in the new set, have your application stop the constant velocity and continue on with the next contour move.

It sounds like your code is working and that you just need to add in a little more code to handle the two cases: when an error occurs and when your buffer still has valid points in it. Hopefully this will help give you a few more ideas and let us know if you have any more questions or comments.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,357 Views)
Thanks for ur help,

am i correct to say that, your total points is equal to buffer size ?
for my case, my total point is bigger than buffer size. how i know when there is no data in.
regards
Haw Keat
0 Kudos
Message 3 of 4
(3,357 Views)
Unless you are dealing with a large data set, then generally you will have your buffer size equal to the total points you want. In other words, if you have 10 points then your buffer size will be 10 -- and so forth. You can use the Check Buffer VI (Check Buffer.flx) to get back several pieces of information about the buffer. Refer to the help for this VI in LabVIEW to read more about it.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,357 Views)