Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem communicating with a serial device

Hi,

 

I have a power meter from Thorlabs which is connected to a PC using serial cable and is connected to the COM1 port. I can read and write from the port from the test panel in the Measurement and Automation Explorer. However, whenever I try to communicate through a VI I can write to the port without any warning; however, irrespective of the command issued the available number of bytes on the serial port to be read always turns out to be zero. Could anyone let me know what might be the cause for this. Since I can communicate through the test pane, the cable and the connection is not a problem. I have checked the baud rate, parity, stop bits, data bits too.

 

Thanks.

 

 

0 Kudos
Message 1 of 2
(3,037 Views)

 It sounds to me like you're missing a termination character on the commands you are sending. Check the documentation for the instrument to see what it says about requiring a character (such as a carriage return and/or linefeed) to indicate the end of a command. This is quite common. And has been asked many time before. Did you try a search?

Message 2 of 2
(3,014 Views)