From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA: Communication with "Optris Laser Modul" via serial port

Solved!
Go to solution

Hello,

 

I am using an "Optris Laser Module" for temperature measurements (see attached pdf). This modul could be connected over usb to the computer. The driver of the laser module generates a serial port (COM4 on my PC). The software of the manufacturer works without any problems.

 

The next step is to use labview for the communication. Sadly, I have not found any driver.

 

The manual tells the adjustments for the serial port

baudrate:     9,6 ... 115,2 kBaud

databits:      8

parity:          none

stopp bits:   1

flowcontrol: none

 

Normally, the module communicates with a binary protocoll. With a special command, it is possible to change the protocoll to ASCII. To change the protocoll you have to write "Dezimal: 131" or "HEX: 0x83". The answer should be 1 Byte with "0 = binary protocoll" or "1 = ASCII protocoll".

 

I wrote a little VI (see attached) to change the protocoll. I do not get any error, but also no answer.

 

Does anyone has an idea, where the problem could be located in the code.

 

Thanks a lot and best regards,

Michael

 

P.S.: If you attach code, please use LabVIEW 8.2.1, otherwise I am not able zu read the code. Thanks.

 

 

Attached: Short manual for "Optris Laser Modul" and VI.

Download All
0 Kudos
Message 1 of 6
(4,004 Views)

Try putting a wait statement between your write and read.  As it is now, you are writing a byte, then immediately checking how many bytes have been received back and reading that.  You really haven't given any time for the instrument to take the time to read the byte you sent and turn around to give a response.

0 Kudos
Message 2 of 6
(3,993 Views)

Hello,

 

I put a wait statement after (2s) the reading, no change.

 

Any other ideas?

 

Thanks a lot and best regards,

Michael

 

 

0 Kudos
Message 3 of 6
(3,967 Views)

Hi,

 

You probably need to add a temination character to tell the module that the command bytes you sent are complete. In youe VI try sending 830A (command followed by Linefeed char) or 830D (command followed by carriage return) to see which is the correct termination char to use.

 

cheers

 

David

Message 4 of 6
(3,959 Views)

Hello,

 

I got an answer (see attached VI). If I change the String element to show "hex" I have 04CE, which is decimal 1230, the correct value. But how do get this decimal number programmatically?

 

Thanks a lot.

 

Best regards,

Michael

0 Kudos
Message 5 of 6
(3,944 Views)
Solution
Accepted by topic author MichaGue_01

You would typecast it to U16

 

Message Edited by David Crawford on 04-26-2010 03:28 PM
Message 6 of 6
(3,940 Views)