LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Serial Read & Write - how to understand the string?

Solved!
Go to solution

Hi all,

 

I'm trying to use the Basic Serial Read & Write.vi to read a measurement from a USB light meter. LabView knows it's there (under COM 3) and data is displayed in the "read string" box when I run the VI. 

 

I'm hoping that someone with more experience with LabView and serial devices can give me some guidance on how to convert this data into some usable form. 

 

In the "string to write" box I have "*IDN?\r\n" and depending on the light in the room, the symbols shown in "read string" box are always something like Î€@“ or other series of random symbols. I need a way of getting this into a decimal format. 

 

The port settings are:

Baud Rate 9600

Data bits: 8

Parity: none

Stop Bits: 1

Flow control: none

 

I'm completlety new to using serial based devices and as such I'm not sure if my problems are because of incorrect port settings or that I just don't know how to convert the string output into a decimal number ( if this is even possible). I've tried contacting the device supplier about Baud settings though they said they "have no such information".......wierd.

 

The device is a DT-1309 Light Meter.

 

Does anyone have any idea where I should start with decyphering these symbols?

 

 

0 Kudos
Message 1 of 5
(4,568 Views)

When you get a string like that it is usually an indication that the port settings are wrong.  Sometimes a USB emulation of RS-232 does not need port settings at the computer end.

 

A search for that meter produced several sites which sell it and some of them include a statement that no software support or SDK is available.  That raises a big red flag for me which says that teaching this thing to talk to LV may be a challenge.

 

The *IDN? is for instruments which support that standard. It started out mostly on GPIB instruments althoug many others now use it.  My guess is that this thing does not.

 

Given this whole scenario, they may be returning data in an undefined binary format. If that is the case you have very little chance of decoding it unless you get lucky.

 

Lynn

Message 2 of 5
(4,554 Views)
Solution
Accepted by aconn

You have to get the programming manual from the vendor. You are just wasting time if you don't have that. The device is probably sending hex instead of ASCII text, though you could also have the wrong com settings. Right clicking on the indicator and select 'Hex Display'. Sending the *IDN? is almost certainly incorrect. Unless you have the manual and that command is listed there. Serial devices have no standard communication protocol so just guessing on how to convert to something understandable is pretty futile.

Message 3 of 5
(4,549 Views)

Believe it or not, selecting 'Hex Display' actually worked! Thanks so much for both of your help. You've made a happy man.

 

Have a great day.

0 Kudos
Message 4 of 5
(4,530 Views)

Hex display was Dennis' suggestion.  Please mark his response as the solution.

 

You got lucky.

 

Lynn

0 Kudos
Message 5 of 5
(4,503 Views)