LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing the while loop precisely

Hi,
I am working on communicating with a few devicenet devices using the I/O communication. In am using the Multiple I/O commuication vi for this purpose with a NI DNET PCI card. In this vi, there is a while loop running that gets and puts information into my various DNET devices. But, I have a problem. I need to time my while loops precisely, so that I know how often I am writing or reading from the devices. For example, I would like my while loop to execute every 1 ms. How can I achieve this?
Can it be done with the normal Labview or do I need Labview Real Time to do this.
Waiting for a reply.
Thanks.
0 Kudos
Message 1 of 4
(2,853 Views)
The only way to get that kind of determinism is with LabVIEW Real Time. You'll never get 1 ms with a Windows OS application.
Message 2 of 4
(2,853 Views)
With the release of labview 7.1 you have a new structure in LV called timed loop which will let you sychronize up to 128 loops precisely in one application. On windows platform you can get rates up to 1kHz. If you need more precise measurements like 1MHz then you need to move your application to LV RT

http://sine.ni.com/apps/we/nievn.ni?action=display_offerings_by_event&site=NIC&node=64000&event_id=14215&event_subtype=GENERAL
0 Kudos
Message 3 of 4
(2,853 Views)
Hi,

This vi is your best bet. That is, timing isn't possible (e.g. do a "wait
ms" or "wait for multiple"). But querying the vi until exactly 1 ms has
arrived is possible (but you'll use 100% processor time). Getting the exact
time is possible.

Because window isn't a real time os, you have no guaranty that timing will
behave consistently.

If you only need to *know* (in stead of control) how often the loop
executes, this vi can be used without any problem. If you need to control
the execution, perhaps you can get a number of loops, and if the timing
difference gets more then 1 ms, wait 1 ms.

Regards,

Wiebe.


"Shreesha" wrote in message
news:50650000000800000003C60000-1078497998000@exchange.ni.com...
> Hi,
> I am working on communicat
ing with a few devicenet devices using
> the I/O communication. In am using the Multiple I/O commuication vi
> for this purpose with a NI DNET PCI card. In this vi, there is a
while
> loop running that gets and puts information into my various DNET
> devices. But, I have a problem. I need to time my while loops
> precisely, so that I know how often I am writing or reading from the
> devices. For example, I would like my while loop to execute every 1
> ms. How can I achieve this?
> Can it be done with the normal Labview or do I need Labview
> Real Time to do this.
> Waiting for a reply.
> Thanks.



[Attachment High Precision Timer.vi, see below]
0 Kudos
Message 4 of 4
(2,853 Views)