From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pulse generation

Im new to LabVIEW, im using LabVIEW 2013, i try to develop a program to control a stepper motor.
I need three signals/inputs.......motor on/off (Boolean), motor direction(true=clock wise, false=counter click wise) and clock pulse for driver circuit. And i need to send all these signals to driver circuit using DAQ. Im using ni 6009....
My problem is i dont know how to create a pulse generator and how it configured with daq(port?....line?)...i need to control the time between each clock pulse (frequency)...
Please help me...thanks in advance..
Message 1 of 10
(4,500 Views)

 

LabVIEW ships with useful pulse generation examples you can find from the menu Help->Find Examples... then search for "Counter".   You can adapt one of these to include sequencing that sets the direction and enable bits before stepping and then turns off the enable when the motion is complete.

 

Unfortunately, the 6009 isn't a good choice of data acq board for this kind of app as it doesn't support counter output.  What other hardware is available to you?   Anything in the 62xx or 63xx families?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 10
(4,478 Views)
Thanks for your advice, but i don't have any other DAQ....can i use digital i/o port/line of ni 6009 for generating pulses?
0 Kudos
Message 3 of 10
(4,470 Views)

Hi mak,

 

yes, you could use them - to generate pulses at low frequencies.

 

Those DIO pins only support software-timed writes so you will be limited to less than 100Hz sample rate…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(4,464 Views)

 

Software-based timing for step pulses *will* be variable, and that can have unwelcome side effects with steppers.

 

There *may* be an option for hardware timing IF:

- you aren't using the 6009 for Analog Input

- the device supports the ability to export the AI sample clock out to a PFI pin

 

You would then create a dummy AI task solely to use its clock for your step pulses.  You can simply ignore any data being acquired by the AI task.  I'll attach a snippet at the bottom to give you a head start on something to try.

 

 

-Kevin P

 

export ai clock.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 5 of 10
(4,450 Views)
Thanks for you reply...but i want use analog inputs, because in my project value of a variable resistance measures continuously...
0 Kudos
Message 6 of 10
(4,430 Views)
Then you will be limited to the software timed digital I/O as already mentioned. The code its extremely basic with a write high, then a delay function, then a write low, then another delay. All of this inside a while loop.
Message 7 of 10
(4,427 Views)
Thank you very much for your valuable reply mr. Dennis....
I don't know how to write that code (write high, delay, write low, delay)....if you don't mind will you write that code fir me?...ut will veri helpful....
0 Kudos
Message 8 of 10
(4,386 Views)

Hi mak,

 

when you can't write code like this:

check.png

you need to take all those free online LabVIEW beginner courses offered by NI on their website!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(4,380 Views)
No, I won't write your homework for you. This is very basic DAQmx task. You can even use the DAQ Assistant. Place two assistants on the block diagram and configure them for single channel and on-demand timing. Place two Delay functions on the same diagram. Connect the error wires to control execution order. Wire constants for the logic levels and controls for the delays. If you've done any of the free tutorials, it should not take any more than a couple of minutes.
Message 10 of 10
(4,379 Views)