LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView coding and Newport's ESP 300 Motion Controller

Hi everyone,
I am trying to coordinate two DC motors (a stage moving on the x-axis and another motor moving up and down on the z-axis) with Newport's ESP 300 controller by writing a control algorithm in LabVIEW 8.2 with the GPIB library Newport has provided on their webpage. The movement I want can be divided into four parts and in each part, both motors move at the same velocity, same acceleration, and travel the same distance. As well, in each part, I want to provide a continuous digital output of 0 or 1 until the start of the next movement and I copied an example VI to provide the output.

1. Stage goes left, Z goes down, write 1 until 2. starts
2. Stage goes right, Z goes up, write 0 until 3. starts
3. Stage goes right,  Z goes down, write 1 until 4. starts
4. Stage goes left, Z goes up, write 0 until end of this movement

The biggest problem with my code is with the digital output - it is not changing at all as the motors move through the four parts. I also don't understand why if I stop the VI, the motors don't stop and continues to move until all 4 parts are done. Shouldn't my shift register be changing the 0 and 1 output every loop?
 
I have attached my code and the library but some of you may not see the example VI I copied. I would greatly appreciate it if anyone looks over my code and provide me with some feedback. Thank you all for your patience, time and help.
0 Kudos
Message 1 of 7
(5,014 Views)

Hi diishen, Thank you for using our discussion forums.

I have had a look at your code and I have been able to successfully run the DAQ portion of your code, the portion that you copied from the example. It starts out low then goes high, then low and then high again.  What behavior are you seeing when you run your code with respect to the digital outputs?   

A few things to note:

There is nothing that is enforcing the order in which your program executes, for instance, the for loop could start iterating before all the VIs outside of the loop have a chance to finish executing.  This may lead to race conditions and other problems.  I also notice that you are not using any error handling so it may be difficult to troubleshoot any specific problems.  I would suggest using the error wires on the VIs that you are using to run your motors to both enforce an execution order, as well as handle errors.  If you are unfamiliar error handling, look at some more of the example programs and follow how they use the error wire.  Also using the highlight execute debugging tool may be helpful.

Secondly, when you stop your program, you see it finish the all four iterations of the loop execute.   How exactly are you running and stopping your program?  The way your program is setup right now the only way you can run it is once all the way through.  If you want to be able to stop your program a simple way would be to add a conditional terminal to the for loop (only available in LabVIEW 8.5 and later).  It can be selected by right clicking on the border of the loop and selecting conditional terminal.  You can use it as you would a conditional terminal in the while loop.

Lastly the manner in which you are creating your digital output is non ideal.  You are creating, starting, and clearing your task each iteration of the for loop.  I would suggest creating and starting the task outside the loop having the DAQmx Write VI in the loop, and then clear the task after the loop has run.  For an example of this, have a look at any of the continuous DAQmx example programs.

Once you have made these changes you should be at a better point to better trouble shoot your program.

Chris_K
0 Kudos
Message 2 of 7
(4,983 Views)

Hi Dishen,

 

  I also had issues using labview to control the Newport ESP3000 Motion Controller.  Similar to you, i downloaded the LabView library from the Newport website.  My issue was the program just crashed at the oddest times and hung the controller.

 

  The hard fought solution was achieved when i talked to Newport.  I updated the Firmware for the Controller (this may not have been a problem), received new GBIP communication routines from Newport, and did not send mulitple commands until the last command was finished.  I believe that the new GPIB routines were essential - since i have used them, the program has not crashed once.

 

 hopefully this answers your question -  joseph

0 Kudos
Message 3 of 7
(4,756 Views)

Hi, could tell me how did you update the firmware? because I tried to update mine but now it seems not working.

0 Kudos
Message 4 of 7
(3,407 Views)

Hi Susi3, I would also recommend contacting Newport support about firmware compatibility and see if they're able to provide more insight. Additionally, can you elaborate on how it seems to not be working?

 

Angela L. 

National Instruments 

0 Kudos
Message 5 of 7
(3,393 Views)

Hi, thank you for the reply

I tried to contact them and get it fixed but they gave me different versions of firmwares but nothing seems to be working. Before I upgrade I had ver 3.02. but I can downgrade to ver 3.02 then it doesn't give me any emergency stop error but give me servo tick failure error. Don't know what that is

Thanks

Susi

0 Kudos
Message 6 of 7
(3,384 Views)

Hi SUSI,

 

Can you please provide a detailed description of the problem including all hardware and software you are using and screenshots of any errors you are seeing? 

 

This will help a lot with troubleshooting.

Aaron Douglass
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(3,372 Views)