LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i extract data strings (temp. press. rel.hum etc) using a Virtual interface through an RS-232 connection?

How can i extract data strings (temperature, pressure, relative humidity etc) using a Virtual interface through an RS-232 connection?
0 Kudos
Message 1 of 16
(4,990 Views)
To better help understand my question as i am new with labview 8.5, i need to extract certain data strings from a source of data which i am getting every second and send these to numerical indicators for display. Please help me 🙂
0 Kudos
Message 2 of 16
(4,986 Views)
Search the Labview examples for Basic Serial Write and Read.vi.  If the device is sending data continuously, you won't need the VISA write commands.
 
For parsing the incoming string, look at the Scan From String function on the Strings Pallette.  With that, you tell it a format string, and it will output a number for each value in the string based on the tokens that are in the format string.
 
You could also look at the Instrument I/O assistant VI to get started.
 
 
0 Kudos
Message 3 of 16
(4,981 Views)
I am also new to LabView, and have found it surprising that LabView doesn't offer as much support as expected built into the software for serial devices.  I wanted to just clarify that you are connected to an actual instrument-- because you will have to write a program yourself if you want to simulate a serial instrument.  If you just want to be able to write to an instrument and read the data, then I think the instrument assistant is the way to go.  You just need to make sure you either have the command set from the vendor, or you can locate the drivers either online, or compile a driver from a vendor's copy.  Within the intstrument assistant, you just need to right click on the column and add a query/parse step, which is where you add the command line for the info you want to receive back.  If you are actually connected to the instrument, LabView does a very nice job of autoparsing the data, and you can usually easily pull the values you need from there.
0 Kudos
Message 4 of 16
(4,968 Views)
What exactly do you think is missing in the LabVIEW support for serial instruments? You just gave a good description of the Instrument I/O Assistant capabilities. Along with the low level functions, it seems to me that there is a lot more in LabVIEW than any other programming language I have ever used. If you have a suggestion as to an enhancement to LabVIEW, you can use the Product Suggestion Center.

Message Edited by Dennis Knutson on 02-12-2008 07:32 AM
0 Kudos
Message 5 of 16
(4,954 Views)

Here is the data i am receiving from the hyperterminal; (note; this data is updated every second)

Time = 09:26:23

Tdew C = 11.78

%RH = 57.15

Tmp C = 20.54

On my front panel I have 4 numerical instruments, how would i go about assigning these terms into each appropriate instrument. Can anyone suggest a step by step process? Your help would be greatly appreciated. Labview seems like a very powerful tool, however i have only been using it for 2 days and my knowledge is not the greatest yet. 🙂 thanks guys.

 

0 Kudos
Message 6 of 16
(4,927 Views)
 
Try this.  It is in LV 8.5.
 
Note the double % in the format string.  This is so the % in the input string is treated as a percent rather than a code.
You may also have to work with the line feed characters in case they are different in the string coming in compared to how the string shows up in the web browser.


Message Edited by Ravens Fan on 02-12-2008 10:19 PM
Download All
0 Kudos
Message 7 of 16
(4,913 Views)
Not sure how this board works because I am so new, but I am responding to the questions earlier in this string about the serial control.  It is not the software capability that is the problem, because there are seemingly work arounds for everything imaginable, however as a new user, I find the help section on serial devices a bit thin, as in how to get started.  I went through the basics course, and the instructor couldn't even answer my questions concerning serial control at all.  I would like to see a simulated serial device integrated into the intrument I/O assistant.  Also, the inst. asst. doesn't even handle hex, only binary and ASCII, which is limiting with serial connections.  The instrument assistant help section is a bit convoluted, and I think it could be improved for clarity.  A lot of what I know is from this board, not from the help sections!
0 Kudos
Message 8 of 16
(4,890 Views)
The instrument I/O Assistant has no simulated devices at all and simulating serial is more difficult than any other type of communication the assistant is intended for. What baud rate, parity, handshaking, termination characters, data format, would you like to see simulated? There is an almost endless number of possibilites. Even though I have been using serial instruments for years and years, I still find situations that puzzle me too. Serial can be plain difficult for anyone and there is no one solution fits all unfortunately.
 
Since the assistant does not give you the option to send hex commands, I would recomend you just use the low level VISA functions. Aside from the ability to automatically parse data returned, you are not loosing much functionality. Even if the assistant did allow for hex commands, I suspect you would still be left with a lot of work modifying the assistant to parse the return data anyway.
0 Kudos
Message 9 of 16
(4,882 Views)
Yes, I should have made it clear I was talking about MAX for the serial device.  I took your advice and suggested these things "officially".  Thanks!
0 Kudos
Message 10 of 16
(4,879 Views)