LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB: I am having some problem in running Labview code properly.

Hello,
I have written a labview code to drvie my stepper motor (using GPIB function). This code is supposed to move
the stepper motors and keep updating the current position of motors. I am having an unique problem. This code runs fine for trial no.1st, 3rd, 5th and so on. While it fails to update for trial no 2nd , 4th, 6th and so on.

The main code is "motion_update_Final_Newport.vi". It will work for labview 7 as well as 7.1.

You may not be able to run this code. However, you may be able to understand my error easily as I have figured out where is the error. The update is based on a function, which returns (string) 0 for motion not done and 1 for motion done. This value is diaplayed in "output 1" and works fine. However, "check 2" which is an indicator does not work for trial no 2nd , 4th, 6th and so on.
If you go where I have "output 1", there is a while loop and "check 2" is an indicator for check. It remains on for trial no 2nd , 4th, 6th and so on.

I am attaching the code and this is for ESP 300 motion controller Newport co. I am certain that some of you would be able to figure out the error without running the code.

Thanx in advance,
Dushyant

Message Edited by Dushyant on 04-18-2005 04:43 PM

0 Kudos
Message 1 of 6
(2,922 Views)
Dushyant

I looked at the code and decided to instead ask for clarifications.
Tell me what you need to accomplish in the application, step by step.
I use the ESP300 and may be able to assist.

James

PS. Please take the time to read, Rules to Wire By.
LabVIEW 5.0 seems so long ago...
0 Kudos
Message 2 of 6
(2,899 Views)
Thanks a lot for trying to help me.

I am sure that I am not moving any subvi.

Steps that I am trying to accomplish:
(i) I am moving the stepper motors for a relative distance.
(ii) Then I am trying to get the motor position after delay (ms) [defined in front panel].

Now, how I am trying to accomplish:

First outer stacked sequence:
seq 0 of outer: This sets GPIB as controller in command (without this I was having trouble when I was combining this with photodiode code). Please avoid this seq.

seq 1 of outer: The motor moves to certain relative distance. (I do not think that there is anything wrong here).

seq 2 of sequence: This part does updates the motor coordinate after delay (ms). Inside this, there is a case structure to choose whether I want the update.
If I want the update, then following steps take place inside the case structure:

Inner stacked sequence:

seq 0 of inner: [This is where I think that error is taking place] Inside this, There is a while loop which terminates when the "Motion Done?"
function returns "1", else "0". Inside the flat sequence structure, first sequence "updates" the motor coordinate while second check
whether the motion is done .
Seq 1 of inner: Controller wait till motor stops.
seq 2 of inner: The motor coordnate is updated for the last time.

seq 3 of outer: It clears the GPIB.

Message Edited by Dushyant on 04-19-2005 10:22 PM

0 Kudos
Message 3 of 6
(2,885 Views)
WHAT I OBSERVED TO BE WRONG WITH MY CODE:

The update is based on a function "Motion Done?", which returns (string) 0 for motion not done and 1 for motion done. This value is diaplayed in "output 1" and works fine. However, "check 2" which is an indicator does not work for trial no 2nd , 4th, 6th and so on.

But "check 2" works fine in case of 1st, 3rd, 5th..

This seems quite strange to me.

Has it something to do with "integer/ float" issue?

Message Edited by Dushyant on 04-19-2005 10:29 PM

0 Kudos
Message 4 of 6
(2,883 Views)
Dushyant,

Here's a few subVIs from one of my Newport libraries help you get started.
I'd scrap what you have and start over; avoid the unnecessary use of sequences!
You might want to sketch a state diagram before you start writing the code.

The application I use these VIs with uses a Newport RV120 rotational stage.
The "RV120CCHL - INIT.vi" is used first in my application for obvious reasons.
For a Move and Check of position, look at "ESP300 - Move ABS w Delay-Check.vi".

There are several other VIs included that are subVIs of these two top-level examples.

Hope this helps get you started,

James
LabVIEW 5.0 seems so long ago...
Message 5 of 6
(2,874 Views)
Thanks a lot James!

I removed undesired stacked sequence and my code is working now.
I am attaching the modified version of "Motion_Update_Final_Newport.vi" just incase someone needs the code. Anyway,
Newport tech support is not so great...

Message Edited by Dushyant on 04-20-2005 03:36 PM

0 Kudos
Message 6 of 6
(2,853 Views)