Hi,
I have created a test.vi which writes the PWM values (uS) of 4 servo actuators and 8 Motors to Arduino Mega 2560 PWM pins 2 to 13. The Vi also calculate the time interval between the current and prev timestamps from the log file and feed it as input to the function-wait until next ms Multiple. The total time duration of log file is 206 seconds. But the vi completes the execution taking 537 seconds. When I checked the loop rate of this vi using function - LINX loop frequency and converted to milliseconds, it shows of 58.83 milliseconds. The PWM values were logged at time interval of 20 milliseconds approximate.
My question:
Is there a way to tweak the while loop rate to 20 millisecond (time stamp interval of PWM signals) to match the elapsed time of test.vi with the timestamp duration (206 seconds) of logfile ? I tried wiring a constant 20 ms to the function-wait until next ms Multiple and replaced while loop with Timed loop wired with constant 20 ms. Still, there is no change in output from LINX loop frequency.
I have attached the vi, log file (CSV format) and screenshot of vi showing the time difference between the elapsed time of test.vi and timestamp of log file for the reference.
About log file: 1st column is the timestamp in seconds and rest all PWM values in uS of 8 motors and 4 servos.
Either any suggestions to improve this or highlighting the mistakes in test.vi will be helpful and appreciable.
Thankyou.