I am using DI/O module NI 9401 with a cDAQ 9178 chassis. I am trying to send a counter-output signal to a brushless DC (BLDC) motor so that it operates for the entire duration of the experiment (meanwhile allowing the rotational speed to be varied by changing the duty cycle). I am measuring the bldc motor rpm using an optical encoder (counter input). While these two components run without a break, I want to run a stepper motor on-demand (by sending a counter output signal to it, and a digital output signal to fix its direction of rotation.
As explained on the NI's website, Error Code 201133, the tasks must be reserved before they are executed. I have updated my code (attached) based on these guidelines and it works as intended.
There is one improvement that I would like to make to it: I want to change the values for both 'Displacement (deg)' and 'Speed (deg/s)' while the program is running. Right now, the 'Speed (deg/s)' is not updated on the go. How do I modify the code to achieve this?
P.S. I have posted a thread elsewhere, but I did not get any response; so I thought to try it on a different board.
Thanks,
lza