LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial control with VISA write

Hi,

I'm trying to write a vi that will control a stepper motor that moves a linear stage, and use a linear transducer (potentiometer) as feedback to get precise placement of the stage.  I'm having difficulty using VISA write to send commands to the stepper motor.  I can use the HyperTerminal to send commands, for example /2P0R to start the motor moving.  But when I try to get VISA write to write the same command to the serial port, nothing happens.  My code is attached.  Can anyone tell me what I'm doing wrong?

Thanks in advance.
0 Kudos
Message 1 of 6
(3,187 Views)
This topic has been discussed recently.  Make sure your termination charachters are correct.
 
Brian
0 Kudos
Message 2 of 6
(3,164 Views)
I've got it working now.  I don't know if it was the TermChar problem, or the fact that I had HyperTerminal open at the same time (evidently things go haywire if more than one program is trying to talk to the motor.
0 Kudos
Message 3 of 6
(3,159 Views)
yes you need to close out hyperterminal.  that has given me a headache before.  live and learn.
Brian
0 Kudos
Message 4 of 6
(3,150 Views)

Greetings,

You are correct to not have HyperTerm open at the same time.  Multiple applications trying to claim 'ownership' and control over a single piece of hardware produces strange results or no results.  I'm surprised the VISA vi (open and write) would let you use a resource already allocated and not throw an error.

 

JMASmiley Very Happy

0 Kudos
Message 5 of 6
(3,142 Views)
VISA will indeed throw an error if the COM resource is tied up. But the OP's program does not use any error I/O wiringindifferent smiley
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 6
(3,138 Views)