• Home

Serial Communication With Labview Tutorial Timed

 
Tutorial

Jun 19, 2012  Serial communication GUI using Labview. How to create a 3D Terrain with Google Maps and height maps in Photoshop - 3D Map Generator Terrain - Duration: 20:32. Orange Box Ceo 7,410,357 views.

Hello, I'm about to start working with LabView for semiconductor electrical validation, so far I'm completely novice in LabView. I'm assined to perform certain validation tests that require synchronization with hardware events by means of serial communication with the external hardware on which measureemnts are conducted. The communication is to be handled by means of RS232 port message reception, parsing and decoding. I understand LabView is able to communicate with measurement equipment by several ways, including RS232, so I though to employ this method in my approach.

We will have our hardware connected to PC via COM and the hardware will sent text messages (such as text lines in TXT file) to the PC where they would be picked by LabView. The parsing needs to be performed on these text lines to fetch out only those that correspond to our required measurement tasks (these text lines are flags to start particular measurements). As soon as the text message is accepted and parsed, given it is recognized as relevant one by LabView, certain decoding is necessary to be performed on these message in favor of further test report and then the necessary measurement is to be triggered. I guess I'll have to write my own code of text message parser and decoder. Once the measurement is initiated, the samples stream (to be compiled into Excel tables) must be synchronized in time as much as possible with the following text messages received through COM that are relevant to the test. Each text message that is relevant contains a running unique time stamp marker, so the measurement samples are need to be somehow synchronized to these messages by means of these time stamps.

I hope experienced users out there will be able to hint me whether the said above is viable and realisable in LabView without some without some heavy coding overhead? Thanks in advance, Alex. This sounds like a fairly common use of LabVIEW and you should certainly be able to do it. There are shipping examples for serial communication (i.e. Basic Serial Write and Read) that can help you get started with that. The parsing of the response can be done with the Scan From String.

A simple shipping example is called Parse String. The majority of the instrument drivers at the involve string parsing in one way or another so there are additional VIs there that you can look.

You might also want to look there to see if drivers already exist for the instruments you plan on using. I would recomend you use GPIB or Ethernet based instruments instead of serial though. The communication is more robust and faster.

Labview Serial Communication Example

Getting a timestamp just requires you to call the Get Date/time In Seconds whenever you do a serial read. This data can be combined with the serial read and written to a text file in spreadsheet format with Write to Spreadhseet File. If you want to write directly to Excel, I would recomend the as the easiest way to do that. Hi spider1112002, I am working with RS232 communication using Labview. I have thermocouple input module connected to the PC through a RS232 serial port.

I am using the labview example file Basic serial read and write to communicate to it. I am able to configure the module using the Write string and reading the output from the module in read string.

The output it shows in read string is something like this, A25 r here, A refers to the header, 25 the temperature I am reading and r the carriage return. Intend to operate the thermocouple input module in a continuous fashion at different frequency and I would like to get this output (either in the form of string (A25 r) or just the temperature value (25)) in a text file. I tried using the ' write to measurement file' but it doesn't write the value displayed in the read string to the output text file.

Also I tried using write to text file option and it writes only one data (such as A25) to my output text file. Can you help me get over this problem. Appreciate your help. If I had posted this in an inappropriate section please direct me to the right place. Thank you, vzv. Hi spider1112002, I am working with RS232 communication using Labview. I have thermocouple input module connected to the PC through a RS232 serial port.

I am using the labview example file Basic serial read and write to communicate to it. I am able to configure the module using the Write string and reading the output from the module in read string. The output it shows in read string is something like this, A25 r here, A refers to the header, 25 the temperature I am reading and r the carriage return. Intend to operate the thermocouple input module in a continuous fashion at different frequency and I would like to get this output (either in the form of string (A25 r) or just the temperature value (25)) in a text file. I tried using the ' write to measurement file' but it doesn't write the value displayed in the read string to the output text file. Also I tried using write to text file option and it writes only one data (such as A25) to my output text file.

Labview Usb Serial Communication

Can you help me get over this problem. Appreciate your help. If I had posted this in an inappropriate section please direct me to the right place. Thank you, vzv. That post was from 2006 but you're in the right place.

Sounds like your problem is NOT with RS-232 but rather writing data to a file correct? There are many examples that show how to do this: Help Find Examples. Fundamentals File I/O If none of those help you, post your code.

This is usually a pretty trivial task but your problem description isn't sufficient to guess what's wrong. Although you may want to make sure you are APPENDING to the file to avoid overwriting it each time you read data.

Hi NIquist, Appreciate your reply. I am reading the serial port and yes, my problem is with writing data into a file. The examples files were a little helpful and I have constructed a VI with that and attached with this post. I am reading the port at 500 ms frequency (delay before read) for 5 seconds, for which I expect upto 10 values logged into the file. But I see only one ('A25'). I am operating at room temperature (no fluctuations in temperature), so I am not sure whether this 'A25' is the first or the last read string from the port.

I am using LABVIEW 2012 SP1 (32bit) Thank you, vzv. Vzv wrote: I am using continuous run for my work. My intended idea was to select the text file at the beginning of each data collection (create/open existing file) such that the values from the board are stored as a list in a new text file or get appended (if it is an already used text file) during the continuous run.

I don't see a difference when I change the set file position between start/current/end. How do I avoid this overwriting of the data? Thank you, vzv You need to set the file position before writing to the file.

This requires opening the file first and also be sure to close it when complete.