LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

polling data

Hi,

 I am using Lab Windows CVI to interface with COTS module. I am trying write data to the disk from the memory stacks of the module using polling method. I was using a timer to poll data in the user interface but timer polls data 1ms resolution. Is there a faster way to do this polling in my application?

 

Thanks.

 

0 Kudos
Message 1 of 4
(3,075 Views)

The only way I can think of is to use a separate thread set with sleep policy = VAL_SLEEP_NONE and running without pauses. This is definitely a more complex scenario than a UI timer, but in my opinion is the only possible solution.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,073 Views)

If you need timing precision of 1ms I would recommend using a real-time system.  The CVI Real-Time Module can provide microsecond precision. In Windows, even with a sleep none policy, your application will still yield to other processes and is thus unreliable for 1ms precision. Additionally, the resolution of the timer is 1ms, but this does not necessarily mean that it is accurate to 1ms. The timer function must retrieve the time from the system clock and then return it to you application. There are several lines of code that are ran in between when it polls the system for the time and when it returns the information to the calling function. Windows could also have switched processes during that time. The inaccuracy is also very dependent on the system. This is why I would not recommend relying on timing functions for accuracy less than 10ms on a Windows system. However, the time should be very accurate on a real-time system.

National Instruments
0 Kudos
Message 3 of 4
(3,053 Views)

Hi,

Thanks for the reply.

For the time being i dont have access to a real time system. I am running WINDOWS XP. What would be the best method for polling data in Lab windows? I dont have windows console. I am using the user interface to start and stop record of the data from the stacks of the COTS module.

 

Additionaly is there a way buffer data from these stacks before i  write them to the disk .I am having to calculate data length of the messages on the stacks for 100ms and write that information on a header for the data packet.

Thanks.

 

0 Kudos
Message 4 of 4
(3,032 Views)