LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving Multichannel data serially on Labview

Hello,

I am working on a task in which i am getting three different data which i have to display on three seperate indicators.

The description is as under

I am using 8051 controller and 8 bit adc. Sending the data through RS232. The data can have any possible value from 0-255.

What technique should i use.

Thanks

0 Kudos
Message 1 of 10
(5,442 Views)

pls give some solutions

Thanks

0 Kudos
Message 2 of 10
(5,426 Views)

Use the built-in Find Examples function of LabVIEW.

 

The example you shuold look at should be under

 

hardware Input adn Output >>> Serial

 

Read the help on thos examples.

 

Tread the help on the functions used in that example.

 

Break-out the protocol document for your widget and set your baud rate start stop bits and termination character as indicated.

 

If you still have trouble, post your code and screen shots along with data and someone will give you another push.

 

Note:

 

NI Spy is a utility that installs with NI-VISA (I think!!!) and will let you monitor and log the data from your port so use that if you need to  "look at the wire".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 10
(5,419 Views)

i am already fimiliar with serial communication with labview. But at the moment the task is to receive different data and plot it seperately for simplicity i explain it further.

I have three types of readings coming

1- Stress

2- Ressistance

3- Rate

 

The values for all the three types is calculated through the controller. And then it is required to send it on the P.C. for display and recording.

The question is how to decode it seperately so that they could be displayed and recorded.

Thanks

0 Kudos
Message 4 of 10
(5,397 Views)

The following images show how I handled a similar (???) situation. THis code monitors a serial port to which is attached a 3-axis anemomter that gives me three values that record the air speed as vector of (U,V,W). Depending on the model it may have a 30 degree offset in the UV plane or could be mounted upside down (inverted).

 

When the time comes to check the port the following code is invokde.

 

Parse_Packet.png

 

after reading all of the bytes waitng at the serial port (Visa Property nodes >>> bytes at port tells me the count) the new data is passed to a sub-VI (see below) that determines if we have a complete frame of data coming from the widget. If so the packet is parsed for the data using "Scan from String" (Note: Packet also contains anemometer name that I used to make sure users did not connect wrong widget to port). The thrre values of the vector are then passed to another sub-VI where the values are adjusted and packed into an array of waveforms that can be plotted on a chart or pltted to a 3D garph to illustrate the wind direction and magnitude.

 

Images of the two mentioned sub-VIs follow

 

Find_Frame.png

 

FInd Frame

This sub-VI uses a shift register to accumulate the data from the serial port into complete packet that start and end as we expect by seraching for the "Terminator". Whn a complete packet is found the packet is returned andthe caller flagged that a packet was found. If there are extra bytes left over, they get strored in the SR for use in the next packet.

 

Build_Waveform_array.png

 

 

THis sub-VI does the adjusts and then builds an array of waveforms that can be plotted on a chart. I like the "waveform" (WF) data type because it lets me control the time stamp (see above) so that when the data gets plotted, it is ploted at the correct time (since serial is seldom periodic). WF data types also allow assign attributes to the data. One attribute I use is the name so that the charts will automatically pcik-up the name for the plot legend from the data and it will automatically adapt when another set of data is presented to the chart ( but now I digress)..

 

So that is how I typically handle serial. I hope it gives you some ideas to work with.

 

Ben

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 10
(5,388 Views)

Thanks alot Mr. Ben for sending the solution.

Could you pls also send a simplified solution of it too.

Thanks

0 Kudos
Message 6 of 10
(5,333 Views)

@Intelligent wrote:

Thanks alot Mr. Ben for sending the solution.

Could you pls also send a simplified solution of it too.

Thanks


No. I am allowed to answer q's but not provide code*.

 

If there are items that are unclear, ask about them. This forum is all about "teaching to fish" and your questions will help others.

 

Ben

 

* If you go back through my post history you will find working code to be rare. Those post that did contain code where almost always "worthless examples" that can not be used in applications with work adaptation by the user.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(5,309 Views)

Actually its hard to understand from that example. So i requested if you have any simpler form of explaination for the task of multichannel.

Thanks

0 Kudos
Message 8 of 10
(5,256 Views)

If working from my end toward yours is not to your liking, then start working from where you are.

 

Post images (or code) of what you have done or have attempted and start asking questions.

 

Sooner or later we'll meet in the middle.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 10
(5,232 Views)

Hello sir, I am also working on the same project (multichannel DAQ using 89c51) but in my case the sensors are different, can you please send me your vi code for references. I got to succeed in a single channel but I got stuck in multichannel

0 Kudos
Message 10 of 10
(3,630 Views)