LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to write to the digital port at intervals of less than 1 ms

I have a DAQCard 6024E PCMCIA. I need to write addresses to the digital port at a rate of 3400 addresses per sec at equally spaced intervals. At the moment I cycle through the addresslist to write to Dig Port using a For Loop that contains another For loop set to thousands of iterations to delay iterations of the main loop. However the length of time for these thousands of iterations varies each time the program is run. What can I do?
0 Kudos
Message 1 of 6
(3,709 Views)
Sounds to me like you need an independent arbitrary waveform generator. You
load the waveform buffer and then tell it to start outputting the contents
at the required rate. This is in hardware, not software.

You can get reasonable accuracy using the "Wait until next ms multiple"
function, but obviously only if the machine has CPU power to spare and not
down to single milliseconds or less. You can't guarantee high frequency
operation on a multitasking and non real-time OS like Windows.

Marisa Taylor-Clarke wrote in message
news:506500000008000000D9300000-1004225886000@exchange.ni.com...
> I have a DAQCard 6024E PCMCIA. I need to write addresses to the
> digital port at a rate of 3400 addresses per sec at equally spaced
> intervals. At the m
oment I cycle through the addresslist to write to
> Dig Port using a For Loop that contains another For loop set to
> thousands of iterations to delay iterations of the main loop. However
> the length of time for these thousands of iterations varies each time
> the program is run. What can I do?
0 Kudos
Message 2 of 6
(3,709 Views)
Marisa Taylor-Clarke wrote:

> I have a DAQCard 6024E PCMCIA. I need to write addresses to the
> digital port at a rate of 3400 addresses per sec at equally spaced
> intervals. At the moment I cycle through the addresslist to write to
> Dig Port using a For Loop that contains another For loop set to
> thousands of iterations to delay iterations of the main loop. However
> the length of time for these thousands of iterations varies each time
> the program is run. What can I do?

This may be a clumsy solution (and may only be applicable if you
aren't doing any Analog Input at the same time). Have you tried setting
up a Timed, Non Buffered
Acquisition to control your timing. Take a look at the example 'Cont
Acq&Chart (hw timed).vi' In the loop that reads in the sa
mple, output
your data to the Digital Port. It should be possible to Auto Index
through an Array of output data in this way. Obviously get rid of the
chart as it is just cpu overhead in this case. I have managed rates up to
about 5 kHz doing this kind of thing before on a PCI card although I'm
not sure if I've tried this on Digital Output before nor have I checked
the consistency of the sample rate. There must be a more elegant solution
than this but I haven't found it yet (other than buying a board that
supports Buffered Digital Output).


Dave.
0 Kudos
Message 3 of 6
(3,709 Views)
Hi Marisa,

Craig is correct regarding hardware timing.
I would encourage you to search the NI knowledge base for articles that discuss "determinism" or "Real-time OS".

If you were to create a "For loop" with a simple wait function that tracks the time of each iteraction, you will find that variation in the iteration time varies.
The magnitude of these variations will depend on many things, including the nature of the OS and the hardware.

In a non-RT environment the variation the iteration time can vary wildly when you atempt loop iteration of less than 100ms. (OK, you may be able to get away with 50ms if determinism is not important).

But you indicated that you do need determinism. I have done what you have desired using one of NI's arbitrary waveform ge
nerators at 4Mhz. It worked quite well.

There are other ways of doing what you want, but they all involve either hardware timing. (I do not believe you would be able to get anybody in the LV-RT group to commit to being able to do what you desire.)

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(3,709 Views)
Ben wrote in message
news:5065000000050000007B4D0000-1004225886000@exchange.ni.com...

> There are other ways of doing what you want, but they all involve
> either hardware timing. (I do not believe you would be able to get
> anybody in the LV-RT group to commit to being able to do what you
> desire.)

I thought the whole point of paying a four figure sum for LV-RT was so that
you COULD do things like this?

Not that I can afford one to play with.
0 Kudos
Message 5 of 6
(3,709 Views)
Hi Craig,

She is asking for an update every 295 usec. I don't think you can pull that of with RT. I am only running from memory now. Maybe someone who really nows will correct me. I would love to be wrong in this regard. It is the sub 1msec barrier that I would love to bust through.

Generally speaking, RT gives you determinism, not speed.


Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 6
(3,709 Views)