Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rt timing loop pci 7041/6040 E

1 view
Skip to first unread message

pablomendana

unread,
Oct 18, 2004, 9:52:23 AM10/18/04
to
Hello. I'm working with a RT board, model PCI-7041/6040 E. The
specifications sheet indicates that it can run a single PID loop at up
to 26 kHz, but Labview 7.1 programming only allows cycle times with a
maximum resolution of 1 milisecond (1 kHz). I have tried to create
faster loops using either a normal loop structure with the RT "Wait
until next multiple" (with resolution of microseconds) and "Timed
loop" structure with a fast clock (there is a 1MHz clock, but it is
disabled), but It seems to be impossible to reach this frequency. I've
read that maybe I need to use a hardware clock from the DAQ
daughterboard 6040 but:
a) A general purpose counter is necessary to do this. This board has
only two counters and I need both counters to perform other functions.
b) I think there must be an easier way to reach the required
frequency, without using hardware timing.
How can I build a loop with a cycle time smaller than one milisecond?
Should it be possible to use the board internal clock or something
like that? Is there anybody who could send me an example?
Thank you.

Bob P

unread,
Oct 18, 2004, 10:26:42 AM10/18/04
to
<a
href="http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=50650000000500000094600100&HTHREAD=000090260&UCATEGORY_0=_50_%24_6_&UCATEGORY_S=0">This</a>
question from 2/26/04 appears to be similar.

To answer your questions,
a) A general purpose counter <i>or</i> the analog input (AI) scanclock
can be used to control your loop timing. You must use a counter or
the AI scanclock to achieve 26 kHz.
b) the installed RT Timing and RT Control examples show many
techniques for controlling your loop period, including an example for
each of the above two methods.

Let me know if you have any questions after you check 'em out.

pablomendana

unread,
Oct 19, 2004, 8:25:05 AM10/19/04
to
Thanks for your help. Your comment has been quite useful. I have taken
some ideas but I'm afraid I didn't explain my problem properly (in
fact, I have just read my comment and I'm sure I didn't). Let me try
it again.
I need a fast loop (cycle time smaller than 1 ms), but not for PID
control (using analog input and outputs and their associated VIs). I
need it to count pulses from two encoders (using both general purpose
counters), compare these counts with a number and generate a trigger
signal (one of the digital outputs, I supose) if both counts are
bigger than the mentioned number.
I have been analyzing the provided example ("One Channel PID
Control.vi") and I think this structure is not suitable for my system,
because it's based on counters, not in analog signals, and I don't
know if I can use the AI and AO config VIs to perform loop timing in
this case. Is there any similar structure or VIs for counters? In
addition, this example uses Traditional NI-DAQ VIs and, as I'm using a
PCI-7041 with Labview 7.1, this board is managed with NI-DAQmx, so I
don't exactly know how to use this example.
I can't use general purpose counters to perform hardware timing as I
have seen in a few examples because I need both counters to count
pulses from encoders, so this solution is unavaliable too.
Do you know how can I build the described system?
Thanks!

Bob P

unread,
Oct 19, 2004, 11:01:38 AM10/19/04
to
Even though you don't need to perform analog input, you can still
utilize the AI Scanclock to time your loop (in both Traditional DAQ
and DAQmx) at sub-millisecond periods.

If you weren't using both counters, you could time your loop with a
counter as an alternative to the AI Scanclock. Not really helpful
here, but worth mentioning for other readers.

In Traditional DAQ, the One Channel PID Control example is <i>not</i>
based on general purpose counters. It <i>is</i> based on the AI
Scanclock.

For a DAQmx example of how to control your loop timing with the AI
Scanclock, check out \LabVIEW
7.1\examples\DAQmx\Control\Control.llb\PID Control-Advanced.vi. This
example does basically the same thing as the other example I pointed
you to. Again, this example is <i>not</i> based on general purpose
counters, which means you can incorporate your counter code into this
example.

Also, I reread you first post and noticed you had trouble using the
Timed Loop. In addition to the above options for timing your loop,
you can use DAQmx Create Timing Source in conjunction with a Timed
Loop to control loop timing at sub-millisecond periods. Check out
\LabVIEW 7.1\vi.lib\DAQmx\create\timing.llb\DAQmx Create Timing Source
(Digital Change Detection).vi for an example of how to do this.

Bob P

unread,
Oct 19, 2004, 2:26:41 PM10/19/04
to
Correction:

Last sentence should have read, "Check out \LabVIEW
7.1\examples\DAQmx\Control\Event Response.llb\Event Response.vi for an

0 new messages