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.
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.
04-23-2010 09:17 AM
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.
Solved! Go to Solution.
04-23-2010 10:03 AM
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.
04-26-2010 03:26 AM
Hello,
I put a wait statement after (2s) the reading, no change.
Any other ideas?
Thanks a lot and best regards,
Michael
04-26-2010 04:11 AM
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
04-26-2010 09:21 AM
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
04-26-2010 09:28 AM - edited 04-26-2010 09:28 AM
You would typecast it to U16