LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there any way to control the duration of each bit when it is high or low on a DAQmx write function

I am writing a pattern of 1's and 0 on a pci-6024 DAQ card to close and open some swithces. last time sal and allen suggest me to see the example on the help menu. that help me a lot but still i have a question which i couldnt get answer from the example. I am using 6 channels(line 0-5) to write data on DAQmx function. when the program runs the function write and finish all data at the same time. but i want each data to have different high and low time (pulse width). is there any way i can control the duration of each bit when it is high or low? can anyone help me?
tahnkyou
casu
0 Kudos
Message 1 of 14
(3,351 Views)
Hello Casu,

If you want to control the duration of different pulses, you can use analog output instead of using counters and digital. Counters allow you to generate digital pulse trains with a specified duty cycle and frequency. However, you cannot output a pulse train that contains pulses of different widths and frequencies. To do this you can use the analog output capablities of your DAQ board.

The example below will show you how to create a Custom Pulse Train Using Analog Output Instead of Counter.

Hope this helps,

LA
0 Kudos
Message 2 of 14
(3,335 Views)
thanks LA for your help. I got some difficulties to apply your idea. there is only two analog output channels on PCI-6024 DAQ card but I need six outputs from the card. I didnt understand how to use it. would you make it more detail so that it is easy for me to understand.
thanks
casu
0 Kudos
Message 3 of 14
(3,328 Views)
Hello Casu,

I'm sorry, I forgot you had that many channels. What we can do then is create an array of booleans for each channel that you are going to use. In that array, we can specify the different 1's and 0's on each signal that you want to send. Send me the program that Sal and Allen gave you so that I can have a better idea of what are you currently looking at.

Thanks,

LA
0 Kudos
Message 4 of 14
(3,312 Views)
...actually, this is going to be a little bit tricky with your board. Since you have an E-series board, we won't have much control of the digital lines as if we would have a digital board or an M-series board. It would be much easier though to develop what you want to do if you would have a timer/counter board (because you only have 2 counters as well). With a counter board, you would have more channels to play with, and we could pulse width modulate signals really easy.

Hope this helps,

LA
0 Kudos
Message 5 of 14
(3,314 Views)
hi LA since the PCI-6024 doesnt give me a solution for my project I am trying the PCI-6602 DAQ card and SCB-68 breakout box. I think this must be the one you sugest me (timer/counter board). I tried to see some examples but a lot of confusion. I dont know on which pin the signal is coming (gate or up-down counter).? would you please give me an idea ?
thankyou
casu
0 Kudos
Message 6 of 14
(3,271 Views)
hello Casu,

Yes, we should be able to work better with that board. Tell me what version of LabVIEW you have and I'll point you to what examples you need. You can find a detailed description of all the applications you can do with that baord on the manual below:

http://digital.ni.com/manuals.nsf/websearch/DD0DBB6404BC139886256721007CF16D?OpenDocument&node=1123_US

Please let me know if you have any additional questions.

Thanks,

LA
0 Kudos
Message 7 of 14
(3,265 Views)
thankyou LA for your help. I am using LABVIEW 7.0 would you tell me where to find some examples.
thankyou
casu
0 Kudos
Message 8 of 14
(3,256 Views)
Hello Casu,

This is actually an example program that was written in LabVIEW 7.1, but I converted it to LabVIEW 7.0. The best way to generate pulse trains with accurate control over the frequency and duty cycle is to use a counter on the 660x or E Series multifunction DAQ device. The E Series devices have two counter/timers while the 660x devices typically have eight.

The NI-DAQmx driver allows you to reprogram the counters on the fly during continuous pulse train generation. This means that you can change both the number of pulses per second and the pulse-width while pulse train generation is in progress without glitching.

The attached example program demonstrates this capability. It can be used with E Series or 660x devices. The accuracy of the pulse train frequency and duty cycle is limited only by the resolution of the internal timebase. You may choose any timebase supported by your device. The timebase you choose determines the range of frequencies you may produce.

A Note on Accuracy:

For E Series devices, there are two timebases available, yielding a counter resolution of 50 nanoseconds or 10 microseconds. For 660x devices, there are three timebases available, yielding a resolution of 12.5 nanoseconds, 50 nanoseconds, or 10 microseconds. If the pulse train specification you desire is evenly divisible by the timebase, then you can achieve within about 0.01 percent of the timebase on E Series devices or within about 0.005 percent of the timebase on a 660x device.
0 Kudos
Message 9 of 14
(3,237 Views)
hi LA I have a question if you can help me . the example you suggest me last time to work on DAQmx is not working on my board I dont know why instead I use traditional DAQ. I try to build a program following the example on the help menu which is traditional DAQ/counters/NI-TIO/generate singla pulse. my question will be how can I write high and low ( I did change the pulse width from 0.5 to 0 to write low and leave it on 0.5 to write high ). Is that the way it should be or any other means. I am using labview 7.0 and pci-6602 DAQ card. can you tell me also how to attach labview program on a clipboard
thanks
casu
0 Kudos
Message 10 of 14
(3,195 Views)