LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Troubleshooting myRIO with two Ultrasonic Sensors

Hi, I am a beginner to myRIO and LabVIEW. I am trying to run two ultrasonic sensors simultaneously by modifying the code from here . (Credits to the owner with multiple thanks!)

 

Below is the main VI file of the coding. However, when I try to run, I found out that only one ultrasonic sensor can run at a time, while the other remain 0.

 

After multiple times of closing and opening the file, I found out that sometimes the first ultrasonic sensor can work and sometimes the second can work. While one can work, the other remain 0cm.

jocelyn7123_0-1625902612835.png

jocelyn7123_1-1625902901568.png

 

May I ask how should I modify the code so that I can run both of them simultaneously? Especially how can I modify so that the main VI is able to accept two inputs from the pulse files together?


Thank you very much in advanced!!

 

 

0 Kudos
Message 1 of 3
(785 Views)

You can't run the FPGA VI twice in parallel. There is only one FPGA in your myRIO and only one FPGA bitfile can run at the same time. You will have to modify the FPGA VI to handle both sensors in parallel and report their value in their own individual register (front panel control) and then query these two registers in your realtime application.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(736 Views)

Thank you very much for the reply!

 

May I ask do you have any other example code on this? Because I am quite new so it sounds a bit complicated for me 😞 I apologize for any inconvenience caused. 

0 Kudos
Message 3 of 3
(682 Views)