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: 

CO Pulse Time

Solved!
Go to solution

How to use DAQmx CO Pulse Time to change duty continueously while not stop task?

0 Kudos
Message 1 of 7
(3,041 Views)

Hi Asian guy,

 

use DAQmxWrite to set new frequency and duty cycle…

LabVIEW and DAQmx come with a huge example library, and there are also exampleVIs on DAQmx-CO tasks!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,030 Views)

image.png

This is an example from labview library, I use a card USB-6210, but I get this error as below:

image.pngimage.png

0 Kudos
Message 3 of 7
(2,992 Views)

Hi,

 

that error description is pretty self-explanatory, so why don't you follow it?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(2,989 Views)

image.png

I get no error by this code, but this can only output the first setting pulse. How to do?

0 Kudos
Message 5 of 7
(2,985 Views)
Solution
Accepted by topic author 穆易

Try something like this:

 

grafik.png

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 6 of 7
(2,977 Views)
Solution
Accepted by topic author 穆易

Two points:

 

1. Your device is an M-series MIO board which does *not* support buffered pulse train output.  If you need to predefine a buffer of pulse params and then generate those pulses with hardware timing, you'll need a newer device such as an X-series board (model #'s 63xx). 

 

2. The post from JensG69 points you in a useful direction -- consider changing pulse params based on software timing.  However, be aware that the code may not *quite* work as-is.  You may find that you need to write *both* frequency and duty cycle in order for the duty cycle to update.  (This was definitely true some years ago, but it's possible DAQmx has changed to no longer require it.)  FYI, in case you don't see duty cycle changes take effect in you pulse train signal.

 

 

-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).
0 Kudos
Message 7 of 7
(2,966 Views)