LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa write problem

hello,
I am trying to control a Coherent Cube laser with labview 8.0 (RS232)
I always get the response 'invalid cmd' from the laser.
There is a software furnished by Coherent which works without any problem.
I monitored the datas sent by this software and labview through the serial port but I did not notice any difference.
Have you got an idea? (the baud rates is well configured)
0 Kudos
Message 1 of 12
(3,754 Views)
This kind of problem is often a result of missing or changed termination characters. Does the laser documentation specify the syntax of the commands? Note that LV does not automatically append any termination characters, you must explicitly include them.

Lynn
0 Kudos
Message 2 of 12
(3,746 Views)
Effectively, there is a termination character (carriage return=0xD) employed by the laser software and I added it on LV but it still does not work.
In fact the laser documentation specify the syntax of the commands but not the termination character, I saw it by monitoring the serial port when the laser software runs.
0 Kudos
Message 3 of 12
(3,735 Views)
Could you post the code you've written and the manual for the instrument?
0 Kudos
Message 4 of 12
(3,728 Views)
I post the .vi but I cannot find the user's manual in pdf.

baud : 19200
parity : none
data bits : 8
stop bits : 1
flow control : none

Syntax :
command=<value> (for instance : ?C returns the present operating current)
?<query> (for instance : L=0 set the laser off)

0 Kudos
Message 5 of 12
(3,721 Views)
I don't see anything in the VI that would cause the write problem. Have you tried using Hyperterminal to communicate?
0 Kudos
Message 6 of 12
(3,707 Views)
The VISA configure serial port.vi termination character defaults with the LF ( line feed ) termination character enabled.   That means your vi is transmitting a LF after the command you put together.  This may be causing your problem.
 
0 Kudos
Message 7 of 12
(3,700 Views)
Scratch that last bit of babbling.   The termination character set by VISA serial config is only for the VISA read.  Has nothing to do with write.
0 Kudos
Message 8 of 12
(3,693 Views)

Hi,

So your query works but your command doesn't, is this correct?

(Query being the string which starts with ? eg "?S".      Command being "Command=<value>" eg CW=1)

If this is correct then you haven't got a problem with your Write because the Query has to seed the "?..." charaters before you can perform the Read.

Therefore the problem is on the exact syntax of the command string. There can't be any spaces between the command, the = and the <value> ie CW=1 not CW = 1.0.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
Message 9 of 12
(3,666 Views)
Yes, my query works but my command doesn't.
In fact I checked my syntax by monitoring  the information sent through the serial port.
I compared the syntax from the company's software (which works) and from my .vi (which does not work) and I did not notice any difference!!!!
I don't understand anything.

regards

hadrien
0 Kudos
Message 10 of 12
(3,649 Views)