From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Arduino Mega 2560 executing only one while loops among two parallel while loops

Hello,
 
When I run the attached vi, Only one while loop (motor control) executes while another loop (servo control) is not executed. 
 
Purpose of this Vi is to run the log data (.CSV) file to the respective PWM channels of  Arduino Mega 2560 to run 8 motors and 4 servo actuators. The 8 motors PWM signals are logged at time interval of ~20 millisecond and 4 servo actuators signals are logged at time interval of ~80 millisecond.
 
So, I used two parallel while loops (one for motors signal and another for servo actuator signal) whose Time delay is determined by the time interval signal of motor and servo.
 
About CSV file - 1st column time (seconds), 2nd column- time interval/ delay (milliseconds), rest all PWM signals.
 
It will be appreciable if you help me to work this out.
 
Thank you.
0 Kudos
Message 1 of 4
(753 Views)

You don't have parallel while loops.   You have a wire that leaves the top loop and enters the bottom loop which thus makes them sequential.

 

You've made a basic data flow violation.

0 Kudos
Message 2 of 4
(722 Views)

On top of what ravensfan said, I don't think what you are attempting will work as an Arduino is a single core microcontroller and is not running any type of multitasking operating system. 

 

I don't think your paralleled loops will run at all even if you fixed the dependency.

 

But I don't know for sure, maybe LINX can do some tricks that can make something like this work 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(705 Views)

Thank you for your comments

0 Kudos
Message 4 of 4
(671 Views)