LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication rs-232

HI
 
I am trying to communicate with a OMEGA gas flowmeter. It communicates trhough a RS-232 serial DB-9 cable using a message-based language. So far I have done the followings:
 
1- Loopback test using basic VI programs, it was ok!
2- Hyperterminal test, the device is able to communicate with Hyperterminal, attched is a snap shot of the resualt
3- Run the basic read and write VI's. I don't get any error in writting but fail to read the data which comes along with run time errors or warnnings. The attached is the latest VI that I found useful in this froum.
 
Problem:
I want to read the stream of data from the device (as it is shown in the attached) and transfer them in to a spread sheet file.
 
Thanks in advance
Download All
0 Kudos
Message 1 of 9
(4,085 Views)

One thing is that you are not sending a termination character such as CR or LF after each command. Hyperterminal automatically appends both so you could try one or both. In your example, an easy way to do it is use a Concantanate String function inside the loop with the constants that are on the String palette.

Message Edited by Dennis Knutson on 06-28-2007 03:05 PM

0 Kudos
Message 2 of 9
(4,068 Views)
Thanks Dennis for your posting. I am going to impliment your comments and get back to you asp.
0 Kudos
Message 3 of 9
(4,020 Views)

Hi Dennis

I am back again. I added an Concatenate Strings commond inside the loop and put it in a Flat sequence structure and tried different chracters like CR and LF, but still I am not getting any read from the device.

I think the problem with my program is more serious than that, becuse  when I use single stepping execuation, the command flow stucks at the Read function and retaines error number 1073676294! I hope this can explain my problem.

Thanks

0 Kudos
Message 4 of 9
(3,969 Views)
You are not sending the control characters CR or LF. You are sending the text 'L' and 'F'. The control characters are constants on the string pallete. You are also not getting an error. You are getting a warning. The sequence structures are not necessary at all. Here's a modified version of your VI.
0 Kudos
Message 5 of 9
(3,966 Views)
Thanks Dennis it works! despite getting the same warning ,I am able to read one line at a time, now can you please help me to write the stream of data in an Excel file. for that I need to send "*@=@" and the device sends data at 10HZ , , the device is supposed to halt once *@=A" is write on the port.
 
Thanks again
0 Kudos
Message 6 of 9
(3,948 Views)

hello i just read your thread,

I have a device which outputs data on Serial port.

This data is in .csv format.

I was able to run the example codes, but what i want is

1) Start the communcation from PC side.

2) Stop the retreival of data from the COM port and
3) plot the Graph of currently read values.

 

I have done the 1) and 3) part but i dont know how to stop retreiving the data and pass the control to 3) part to plot the graph.

 

please help??

I am using LV 8.0 so please attach a code in this version.

I think my problem is similar to yours , so it would be gr8 help if you can attach your code.

 

Thanx and Regards

0 Kudos
Message 7 of 9
(3,370 Views)
0 Kudos
Message 8 of 9
(3,358 Views)

Hello 1232,

 

I posted this thread long time ago and need to refresh my memory 🙂 here are a few point that might be helpful:

 

1- if your device is comunicating on message-based language you should be able to finde the stop character in the device's manual. for example in my device the stop chracter is "b" so whenever I write "b" at the port , the device stops streaming data and goes to the next command.

 

2- an alternative for 1 can be using a stop characteristic in your vi program. for example if your are using while/for loop set a conditon (like time or boolean condition) to the loop's stop.

 

you can also find good stuff in the link that Eugen has posted.

 

 Hope it helps.

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