Motor direction and Speed Control using Joystick and LabVIEW Front Panel Switches
The sample code shown in the block diagram below would typically be placed in the Periodic Tasks.vi of your LabVIEW project. This example enables us to independently control two motors A and B connected to PWM channels 3 and 4 in the Begin.vi. For Motor A we can use joystick buttons 3 and 5 to drive the motor in either direction. For Motor B we can use the LabVIEW "Accelerate" and "Decelerate" switches on the front panel of the Periodic Tasks.vi to modify the motor speed.
Sample 'Begin.vi' Block Diagram:
Sample 'Finish.vi' Block Diagram:
Sample 'Periodic Tasks.vi' Block Diagram:
Sample Periodic Tasks.vi Front Panel: