Solved! Go to Solution.
one simple way is the Counter - Continuous Output.vi you can find this inside of the example finder, if the 9401 is based in a cDAQ it can used as a counter input. The frequency can be changed, if the vi will be modified so a new value will be written, inside of the while loop, to the card.
Hope it helps.
Thank you for your response and I have reviewed the VI you have suggested. I am only a beginner in LabVIEW programming could you explain to me exactly what the trigger is and how it would affect my program as well as the duty cycle? If I understand correctly the duty cycle should be default 0.5 i.e. 50% in my scenario? If I am also aiming for a 8 Khz signal wouldn't the 100 ms delay greatly affect my timing?
the 100ms inside the while loop is the iteration time to check, if the DAQmx driver returns an error or not. The trigger can be used to start the PWM generation depending on an external signal. The PWM generation starts when the DAQmx start.vi is executed. The duty cycle in percent describes the division between high and low during a cycle, with 8 Khz high and low then are 62,5 µS long, if the duty cycle is set to 50%.
Is there a difference between what I wire for my counter input versus the output of this VI? I am using nearly all my channels on my NI 9401 to obtain encoder feedback, direction, 5V supply, and pulsing the driver. I have only one or two spare channels available.
I have accepted your response as the solution, however I just ran into a major problem while running this VI. I am able to run my motor fine at 900 Hz, but the motor I try to run at anything above and especailly 8 KHz my motor doesn't move and all I all hear is a loud ramping sound. Do you know the cause of this issue potentially?
I am using a LIN Engineering R701 driver, which should be able to handle 200 KHz stepping. This is very odd to me as I have never seen this before and my current rating for this driver and motor should be well more than enough.
I am running a SonceBoz 2A phase 1.8 degree motor using a LIN R701-710 driver (link is in previous post) using half stepping mode, which should work. The driver is set to run at its appropriate current rating and the duty cycle is far more than enough from the minimum of 100 ns for the NI 9401. The driver also can step at a maximum of 200 Khz