Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2181

NI 9401, Counter I/O, Digital Output

$
0
0

Hi,

 

I am using the DI/O module NI 9401 with a cDAQ 9178 chassis. I am trying to send a counter-output signal to a 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 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. 

 

Problem: whenever I run the program, the motor and the rpm encoder operate as intended; but once I ask the stepper motor to rotate (using a Boolean switch for a case structure), it throws an error - Error Code 201133. On the referenced page, it is recommended that 'all tasks but one must be reserved. Subsequently, the unreserved task must be started first.' This solution works when I use a single while loop and the start task VIs are placed inside a flat sequence. But this means that I can no longer run the sequencing part of my code (that runs the stepper motor only when desired, or as programmed).

 

Question: What do I do to continue having the case structures and still be able to operate the stepper motor on-demand?

 

I have attached an excerpt from my VI. Please let me know if any additional information is required.

 

Thanks

lza


Viewing all articles
Browse latest Browse all 2181

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>