Discussion:
how do I send a digtal pulse at a .9ms rate without comprimising my programs speed?
(too old to reply)
ewong
2008-08-13 20:10:08 UTC
Permalink
I have a program where I need to send a digital pulse to 6 strobe boards in order to make them flash. However when I use the DAQ assistant along with a data constant to sen dthe signal it clogs up my loop slowing it to a rate that is not efficient. I need the flash triggers to be seperated by 0.9ms and flash in a triplets (flash-.9ms-flash-.9ms-flash-"gap of time specified by frequency"). My issue is there isn't an external clock I've found that solves my problem. If someone has a method of making this work or an alternative method it would be much appreciated. Thanks! :smileyhappy:
ewong
2008-08-13 20:10:08 UTC
Permalink
here's a pic of my code.


code.JPG:
Loading Image...
Jaime F
2008-08-14 19:40:06 UTC
Permalink
Hi,

The approach you are taking right now although it may work you are depend on your OS also the DAQ assistant is intended for easy, quick code that are by no means optimal depending on your application. Which card do you have?

If you have and M series you can set a correlated Digital output where you use the counters as the sample clock, this will allow you to send the triggers exactly at .9 ms and pause the generation after the triplet. If you have a static digital input output card then you have no options for setting determinism on your generation and will always be depended on your operating system. I will suggest opening and play around with the shipped example: “Correlated Dig Write with Counter.vi” also start digging into the DAQmx low level VIs (right click the DAQ assistant and select generate code).

I hope it helps
ewong
2008-08-14 19:40:07 UTC
Permalink
I did look at those examples and was able to incoporate a pulse train into my code generating the pulse I required. However I now need to have a signal running simultaneously with the other signal at half the speed. I have a PCI6221 board and a SCC-68 board. Thank you so much for your help Jamie.
Jaime F
2008-08-15 19:40:18 UTC
Permalink
Hi ewong,
I'm sorry I forgot to attach the example I built with your first post. Is not a very clean code but it might help you get started. First task: (easy one)
is to generate two pulses at the same rate. Copy the same code you have for one pulse train in parallel with the first one (no wires dependency). Second with
want those to start at the same time, for that you will use the trigger capability of a counter. After you have accomplish this we will change the rate by making the
second counter output a pulse every time it counts 2 high ticks and to low ticks of the first counter.

I hope it helps


40mhz_pulse_train.vi:
http://forums.ni.com/ni/attachments/ni/170/349705/1/40mhz_pulse_train.vi
Loading...