LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving stage with Newport ESP 300 motion controller

Hi,

 

I am new to LabVIEW so please forgive me if I ask any stupid questions.

I am trying to control 2 stages with a Newport ESP 300 connected to my laptop via RS232, but I can't really get it to work. I just want a vi which enables me to move a stage for a couple of mm or get it to a preselected point. But I am sure that the second part will be a piece of cake once I get control of the movement.

Of course I have been looking on the internet for some examples and found an example on the Newport website. This seems to do the job, but it keeps giving me an error: "Send in ESP Send.vi->MO-Motor on.vi->Example1.vi" (code -572662099) and therefore I am not able to do anything with this example (I have downloaded everything provided on their website).

 

Next to that I found some program's on this forum but I cannot get any of them to get to work properly (remember I am not really a professional with LabVIEW) and I am not completely sure that they are made to do what I want either.

 

I hope that anyone on this forum has tried to do the same thing at some point and can provide me with something to get started with.

Any help will be more than welcome.

 

Thanks

0 Kudos
Message 1 of 9
(8,898 Views)

You should also try to contact Newport directly to get help on this.

 

Christian

0 Kudos
Message 2 of 9
(8,886 Views)

I have contacted Newport, but they haven't replied yet. 

In the meanwhile I have been looking at Newport's example again and noticed that they made it for a GPIB connection, but I am using a RS232 connection.

So I replaced some of their items with VISA (which is for serial communication right?). But this still gives me an error (must admit that I do not always know what I am doing):

 

"Error -1073807339 occurred at VISA Read in ESP Read VISA.vi->ESP Motor On.vi->ESP 300 motion.vi

Possible reason(s):

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed." 

 

I think there is a problem in the "ESP read VISA", because this gives a red dot on the "byte count" input. But I can't really figure out what the exact problem is. Can anyone see what is going wrong?

0 Kudos
Message 3 of 9
(8,862 Views)

Hey,

 

VISA is for both, GPIB and Serial Interface because its a overlaying API.

 

This error can have different reasons, however one try could be to set the timeout value to a higher one (for testing purpose 30sec or more) to see if its just a long message which is unable to complete within the default timeout.

You can also search for this error on this forum or ni.com to see other possible causes and solutions.

 

The red dot means that there is a datatype conversion, e.g. I32 to U32.The VISA Read's byte count input is a U32.

 

 

Christian

0 Kudos
Message 4 of 9
(8,856 Views)

Hi,

 

I have been getting on quite a bit now. But there are a few more things I have got some difficulty with:

 

First of all I want to be able to get the stages into the preprogrammed home positions, preprogrammed on the ESP300 this is not done in my vi. I thought this vi should be able to do that but nothing happens when I run it. Can anyone see where it goes wrong?

 

Next to that I can read the position and set a new one, but only with a accuracy of a millimeter. Is it possible to do this more accurate?

 

Cheers

0 Kudos
Message 5 of 9
(8,824 Views)

Well not sure why your OR1 command does not work. Maybe you have a stepper motor stage without index signal then option 1 would not be valid.

 

As to the reason why you can't seem to get sub millimeter accuracy I would guess you have a localization problem with the decimal point. the string formatting functions in LabVIEW do use the local decimal point format (comma or point) by default. Instrument control however usually always uses a point as decimal point. So when formatting your strings or scanning the response you have to tell LabVIEW to ignore an local number format settings at that point. For Format into String and Scan from String you can prepend the format string with %.; to do so, for old style floating point number conversion functions there is aboolean input ignore local decimal point, forcing the function to use specifically the point.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
Message 6 of 9
(8,819 Views)

Hi,

 

Thanks the comma and point suggestion solved the accuracy problem completely. Unfortunately I still can’t get my motor to the home position, changing the 1 from “OR1” into other options still did not give me any reaction from the ESP 300.

 

Next to that I have got myself a new problem. I want to let the program wait till the motor has stopped moving, someone else gave me his routine to do this (attachment). This works, but it is a bit slow. I have to wait a few seconds after the motor has stopped before it continues with the next step. I don’t really understand what is happening so I can’t see how to improve the reaction time. Is there any way to improve this, or is there another way to wait till the motor has stopped? I have been trying the “WS” command, but I can not get that to work, I can only write it to the ESP but when I try to read the reaction it always gives me a timeout error.

 

Cheers

0 Kudos
Message 7 of 9
(8,800 Views)

A well! The ESP300 can be a real pain in the ass to work with. I've used it with GPIB and had my share of trouble with that. The timeout error is a very common error with that device, as it is very tricky in what commands you can send it at what time.

 

I can show you what I have for that for myself but even that had its quirks. First the GPIB SRQ, not working on RS-232 anyhow, was no good at all, as it did often not trigger properly and caused internal communication errors in the controller.

 

So I made the alternate variant using the MD? command. That had the problem that it did return often to early so that when I disabled the axes immediately afterwards I was stopping them in fact before the stage had reached the desired position, which the MD command should have waited for. So I had to actually add position polling after the WS command to wait until the stage had reached the desired position to 0.001 degree. Quite strange that this is necessary.

 

I have included the ESP300 Wait for Motion Stop.vi here. I have never tested the RS-232 communication although I have tried to make the VIs I wrote tolerant to work both on GPIB and RS-232. But the GPIB driver took so much more time to develop and debug, that I had no energy and interest to test the RS-232 variant too

 

And no, sorry, I can't post the whole instrument driver here, first because it is really part of a project, and second since it is only developed as far as was necessary and there are many areas that would need a lot of love before it could be considered and instrument driver that can be distributed to others.

 

Rolf Kalbermatter

Message Edited by rolfk on 08-18-2009 08:44 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 9
(8,789 Views)

I don't know if it helps at this point but here is a link to LabView drivers that use the RS-232 port:

 ftp://download.newport.com/MotionControl/Current/MotionControllers/ESP300/Software/

 

and here is a link to the user manual:

ftp://download.newport.com/MotionControl/Current/MotionControllers/ESP300/Manual/

0 Kudos
Message 9 of 9
(8,650 Views)