Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Only send a new command, when the answer for the last one has arrived

Hi,

I'm trying to control several stepper motors via LabVIEW. The interface is RS232.
If I only actuate one motor, everything is fine. My Code is attached.
To control several motors, I take this code several times.
But here's the problem: while controlling several motors, it happens that the programm sends a new command for the next motor before the answer for the first motor's command has arrvied. Is there any VI which causes, that a new command is only sent, when the answer for the one before has arrived?
0 Kudos
Message 1 of 5
(3,523 Views)
As you know, you must respect following sequence : send command to motor #1 --> wait until answer from motor #1 --> send command to motor #2...

The examples and the comments of this discussion should help. Please notice that the terminal char must be set to the proper value and enabled and that every message from the controlers must end with this char.

Feel free to post back if this shouldn't resolve your problem.
0 Kudos
Message 2 of 5
(3,515 Views)

Hello,

Using a sequence structure with multiple VISA steps for successive motors is one way in getting what you need.  Simply do what you have already, but only for motor 1.  Once the first motor works properly, begin the process again but for motor 2 and so on...

Regards,

0 Kudos
Message 3 of 5
(3,511 Views)
Thank you very much for your quick answers! I changed the structure of my program, now it works ... or at least that one problem is solved Smiley Happy!

Message Edited by anur on 06-20-2007 07:52 AM

0 Kudos
Message 4 of 5
(3,457 Views)
According to a French dictum : "A train can hide another one". Unfortunately, sometimes this is also true for problems !
0 Kudos
Message 5 of 5
(3,446 Views)