LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ascii junk, or IS it?

Please review the attached (tiny) bmp. If you received that from a serial read, would you think:

A) The device is sending garbage, there's nothing you can do with that data.
B) The device is sending binary, which needs to be converted.
C) The device is sending specific ascii characters, and I need to make sense of them.

Let's assume the device is a generic meter of some type with a RS232 interface. You're using VISA to read the serial port data. The port IS set up correctly (9600, 8, N, 1, etc). The meter is working fine, and the data does make sense with the supplied closed source software.

Any help is greatly appreciated.
Richard






0 Kudos
Message 1 of 9
(3,470 Views)
Hi

I either would choose B or C. But first I'd like an interface definition which says what kind of data is sent and what it means.

You cannot just read from the serial port and expect the data to be like "1.54mA".


Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 9
(3,451 Views)

@broken Arrow wrote:
Would you think:
A) The device is sending garbage, there's nothing you can do with that data.
B) The device is sending binary, which needs to be converted.
C) The device is sending specific ascii characters, and I need to make sense of them

Probably B ... and then I'd right click on the string indicator and change to either "Hex" or "\code" display ... and dig out the manual ... or start counting in hexadecimal with the aid of my toes.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 3 of 9
(3,439 Views)
I should have said - you don't know the protocol, or what is being sent, in what format, etc.
I have read other generic serial devices, and while the output is never something like 1.5mA, it is often something like +>1%5A5%0V+00110000, which I can make sense of and parse out what I don't need.
Richard






0 Kudos
Message 4 of 9
(3,435 Views)
But you HAVE to know the protocol - otherwise it would be like reading a book in a language you don't understand.

Just for example - in a project I currently working on, I comunicate with a device over RS422. As an answer I get the following string:

X_0405_45523831_E

If I wouldn't know the protocol this could mean everything.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 5 of 9
(3,427 Views)
If the communication settings are correct, this is the real data, we just need to decrypt it. This can be difficult if the specifications are proprietary, but is often quite easy.

Could you please right-click on that text indicator and specify "Hex display"?

Now take a screen shot and post it here again. Could you also describe what it meant to the "other" software if possible? (e.g. how many data points, what values, what resolution, any other information).

If the reading changes with time, post a set of successive readings. Which characters change, which ones are constant?
0 Kudos
Message 6 of 9
(3,426 Views)
In the past, I've used a program called Portmon (www.sysinternals.com) to observe communication between closed source software and serial instruments. Sometimes it will help decipher the comms if you know what you are expecting using the supplied software.

Chris
0 Kudos
Message 7 of 9
(3,426 Views)
Like Altenback said, change the string display to show Hex Display. You should see Hex digits which can possibly mean that the data is binary data. Type Cast can be used to convert the data to something useful. However, you have to know if the binary data is 8-bit, 16-bit, or whatever. This makes a huge difference. Perhaps you can experiment using Type Cast with U8 then U16, etc., wired into the top terminal of Type Cast, until you see the data you are expecting.
- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 9
(3,401 Views)
Thanks for all the suggestions. I was looking at the HEX data, trying to decode it. Just by chance, I threw out the first two bytes of data on each four byte hex word, and the data now makes sense. All I have to do is get a string subset, convert to decimal string, and format a decimal point into it. I guess this means, ultimately, it was binary data being sent. Thanks again everyone.

Message Edited by Broken Arrow on 05-10-2005 04:58 PM

Richard






0 Kudos
Message 9 of 9
(3,378 Views)