Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing data from a serial string

Solved!
Go to solution

Labview 7 Express Alert 😞

Sorry, this all I have to work with and there is no budget at this time to upgrade.

 

Hello, I am in stage 1 (transferring data reliably to labview 24/7) of my little sideproject which is to display and log Lab Environmental Data 24/7 from our Fisher 02-403 Digital Barometer which has a serial port. It actually came with software but no one here seems to like using it so I'm trying to come up with something more intuitive. I can find no info at all concerning I/O with this device so I am reverse engineering. I am pretty sure you cannot write anything to this device only read.

 

I started by hooking up the device and looking at the interface with  NI Measurement and Automation, and received the following string: P,43,1019,44,31,01,0023.0\r\n.

 

I then tried using the Labview 7 Express Instrument I/O Assistant, selected COMM 1, changed the timeout to 5000 (trial and error), added a Read and Parse step, ran it and received the following string: P,43,0999,44,41,01,0018.0,XX. After much guessing, I have determined that the values that I have bolded change with the environment and the other 3 are always the same 9no clue what they represent). The 1st bolded alphabetical represents weather trend S= sunny P= partly sunny C= cloudy etc., the 2nd value is the barometric pressure in hPa, the 3rd is % relative humidity, and the last is Temperature in Deg. C.

 

At first I tried just creating tokens for the data I want and running the I/O Assistant in a while loop, but often got error messages suggesting that I needed to define all the tokens in the string. I have done that and it worked, then I opened the front panel to access the underlying diagrams from which I came up with the attached VI. I have let this run for more than 24 hrs, no errors, looks good.

 

My question to this forum is, can I at this point simplify this VI by losing some of the parsing for the data that I don't need?

 

Please let me know if you cannot access this VI maybe I can do a screen capture or something.

 

Thanks,

Doug

0 Kudos
Message 1 of 5
(6,382 Views)
Solution
Accepted by topic author Doug_M.

Yes, it can be simplified just a wee bit.

 

 

Since you are new to LabVIEW, you might want to start with the basic tutorial.

Message 2 of 5
(6,368 Views)

Wow that was an understatement, much simpler! I am going through the tutorial now, any idea why the videos won't run? I have tried different computers on different networks and can't get the videos in the basic tutorial to work.

 

Getting back to my vi, I am thinking to use the 'Serial Read with Timeout' vi from the examples as a sub-vi to handle the acquisition of the data from the barometer, do you foresee any issues with this approach? Thanks for your help!

 

Doug

0 Kudos
Message 3 of 5
(6,311 Views)

Serial Read with Timeout is an obsolete example if I remember correctly that used the old serial functions and not VISA. I could be wrong about that since that example no longer comes with LabVIEW. Look at the Basic Serial Write and Read.

Message 4 of 5
(6,296 Views)

Thanks for your help, this works great and is waay more simple, now for step 2!

 

Doug 

0 Kudos
Message 5 of 5
(6,228 Views)