Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate continuous PWM using DAQmx USB 6216 and stop based on Button Click events.

Hi,

 

     I have a USB DAQ 6216 and I have to control 6 motors by sending them a PWM. I have 3 L298 drivers (each capable of driving 2 motors, forward or reverse depending on the digital selection). I need to send 4 digital signals/enables/bits (2 for selecting which motor line and 2 for selecting the direction of rotation) for selecting the motor driver and send a PWM to a particular motor. 

 

    I did a small vi where if I click a button, i glow a LED continuously on the front panel using events. But, now I am trying to implement the same event driven programming for driving the motors. I have Forward and Reverse for each motor on the front panel. If I click it (as long as I pressed the button), the VI should send a continuous PWM by setting a particular motor configuration using the digital port outputs.

 

    I have seen the examples under LabVIEW for PWM, I have seen all VIs have while loops for one single continuous generation. But, I should be able to stop one motor and start the other motor with change in Button Click.

 

If someone has understood the scenario, can you please help me how to do it? 

 

Amar Makana.

0 Kudos
Message 1 of 2
(2,224 Views)

Hi AmarMakana,

 

Have you seen this example about using event structures inside a while loop? It looks like this should work for what you are trying to accomplish with different events for the different buttons to activate the motors. In the different events you can set up all of the DAQ calls for the motors.

 

Regards,

Tommy G.
Product Manager - Search
0 Kudos
Message 2 of 2
(2,211 Views)