LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LMT Luxmeter Serial port RS-232 data string issue

Hi all

I had a diagram to acquire data from luxmeter RS-232 serial port.

data is acquired but as shown in figure (COM Data)

I need to know how to read this data and separate or just take the numbers from the string

I tried to separate the string but still could not target the numbers only

Thanks in advance

the light intensity.vi is also attached

Download All
0 Kudos
Message 1 of 2
(1,753 Views)

DON'T USE BYTES AT PORT!

 

You will get partial messages that you can't parse into anything meaningful.

It is interesting that you are concatenating the messages together via the feedback node, but proceed to write that data to a file.  That means every write to the file is going to have the new stuff and everything that came before it.  Then the next stuff is going to have even newer stuff and everything from the previous iteration, written after that.  You'll exponentially grow that file!

 

Did you read the manual for the communication protocol for your device.  I'm going to assume it uses a termination character.  Your VISA configure has those terminals unwired which means it defaults to the termination character disabled, and a linefeed character.  Make sure that agrees with what your device manual tells you.  If so, just wire a large number into the VISA Read and DELETE that Bytes at Port node.  Then you'll get complete message packets.

 

Then read your manual to see how the data is structured in that message.  Your Spreadsheet String to Array is set for floating point numbers separated by commas.  Hopefully that is in agreement with your manual.

0 Kudos
Message 2 of 2
(1,732 Views)