LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from multiple sensors(same type) without copying the same VI in one VI for 4 times.

Solved!
Go to solution

hello everyone,

 

Im reading the 4 same type of sensors which is attached to Arduino. I can able to read one sensor using the my lab-view VI. now want read other three with same VI..can you give me some idea?? 

0 Kudos
Message 1 of 15
(1,741 Views)

First suggestion would be to attach the Source code for reference.

 

If all your sensors are connected to same Arduino with different I/O's / Channels with you can modify your code to read multiple channels (Multiple Sensors) using same VI.

 

If you are connecting multiple Arduino for multiple sensors then you can go Clone VI

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 15
(1,728 Views)

@jeet4230 wrote:

Im reading the 4 same type of sensors which is attached to Arduino. I can able to read one sensor using the my lab-view VI. now want read other three with same VI..can you give me some idea?? 


You could use a FOR loop to iterate through all of the readings you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 15
(1,726 Views)

Can you explain me bit in detail? how can i use the for loop? because i going to attach 4 different waveform chart to the 4 different sensor values.

 

thank you in advance.

0 Kudos
Message 4 of 15
(1,717 Views)

Share the code you developed which works fine for 1 sensor.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 15
(1,705 Views)

hello,

Im attaching the the vi. so this is for 1 sensor. i want to do it for multiple sensors. 

thank you

0 Kudos
Message 6 of 15
(1,697 Views)

Please down convert to LV17 version and share.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 15
(1,677 Views)

Hi jeet,

 

you are sending 14 command strings to your Arduino, just to read one specific sensor?

 

How do you switch the AI channel on your Arduino? Which command do you need to change to read a different channel/sensor?

 

In the end it boils down to "send the same commands again, but change the one command selecting the channel/sensor"…

 

Btw. do you really need to wait 200ms between each command?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(1,659 Views)

@GerdW wrote:

Hi jeet,

 

you are sending 14 command strings to your Arduino, just to read one specific sensor?

 

How do you switch the AI channel on your Arduino? Which command do you need to change to read a different channel/sensor?

 

In the end it boils down to "send the same commands again, but change the one command selecting the channel/sensor"…

 

Btw. do you really need to wait 200ms between each command?


If he had written his Arduino code properly, he could send back readings from all 4 sensors with 1 response.

 

 

0 Kudos
Message 10 of 15
(1,646 Views)