LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get Multichannel output in LABVIEW

Solved!
Go to solution

Hello,

Basically my project is based on Multi-channel Data acquisition system in LABVIEW. My requirement is to get the data of various sensors in LABVIEW through micro-controller (89C51).

 

The micro-controller transmits the data serially which I am supposed to get in LABVIEW.

 

The controller part is ready, it is transmitting data of various sensors(channels) serially in a fixed time period i.e 10 sec for each channel (for this I have used ADC0808).

 

But the main problem is that I am not getting the data of all the channels in LABVIEW, only first channel output is coming in the serial buffer.

At present I have used Array to Spreadsheet Converter to get data of various channels in the serial buffer, but it is not working properly (only showing data of first channel).

 

Please help in this regard whether to use any other Function block and provide valuable suggestions / guidelines.

 

0 Kudos
Message 1 of 19
(3,615 Views)

There is now way to give valuable suggestions or guidelines because we have no idea what you are doing now.

 

Attach a VI!

0 Kudos
Message 2 of 19
(3,593 Views)

I have attached the Proteus file, LABVIEW block diagram, LABVIEW front panel so you can get a better idea of the concept.

 

The 3 data's seen on the virtual terminal (figure 1) are the data from different sensors(here potentiometers are used), and we are supposed to get the data serially in LabVIEW as different serial readings.

 

For that, we have attached the LABVIEW block diagram (figure 2) so that you can get a clear idea.

 

our aim is to get a data in 3 individual arrays Please see the LABVIEW front panel (figure 3), we are not getting data in the individual arrays but getting in the same array.

We have used Spreadsheet string to Array and after that the Index Array to get data in different arrays but we are not getting the proper result.

 

So please suggest what additional we have to use to get data of individual sensors in individual sub-array.

 

Please help in this regard as soon as possible.

0 Kudos
Message 3 of 19
(3,565 Views)
Solution
Accepted by topic author pdpanchal05

Hi pdpanchal,

 

you REALLY should put a delimiter between those values from your "proteus"!

 

See this:

check.png

Two ways to convert your string into numeric values.

One of them is just for fun, the other is recommended…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 19
(3,562 Views)

Hello,

I used the given vi file but there is some error occurring in the "Scan form String function block".

 

I have attached the screenshot of the error occurring.

 

Please help in this regard.

 

0 Kudos
Message 5 of 19
(3,549 Views)

Hi pd,

 

I have attached the screenshot of the error occurring.

That screenshot is "nice", but hides all the relevant information!

 

What does the "received" string contain?

Which code is hidden behind the error dialog?

Why don't you handle the error output of the ScanFromString function?

Why does your VirtualTerminal now contain much more characters than what you have shown before?

What is the exact data format you want to receive from your "proteus"?

Did you think about using some delimiters between your data values?

Lots of question, but (nearly) no answers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 19
(3,544 Views)

I am reading a decimal serial data from a microcontroller, where 3 data is coming serially and I want to separate that data. so I am using a SCAN FROM STRING as shown in below image. 

but error 85 occurred 

how to solve this error 85?

Download All
0 Kudos
Message 7 of 19
(3,543 Views)

Your incoming data string has spaces.  But your format string does not account for that.  Add spaces to your format string.

Message 8 of 19
(3,541 Views)

For simplicity, you could even use "spreadsheet string to array" with a 1D I32 array as type, %d as format, and "space" as delimiter. Now you would get an array of three elements and 3x fewer terminals and clutter.

0 Kudos
Message 9 of 19
(3,536 Views)

Hi pd,

 

it's nice to see you took the suggestion to put some delimiters between your values!

But you need to adapt your format string to those delimiters…

Or use (as suggested before) SpreadsheetStringToArray instead!

 

(I merged your threads to allow others to see the history of your VI development.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 19
(3,528 Views)