LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

reading data is delayed

In the CVI6.0, the application have to receive data via RS232 port (19.2k,10 bits). There is a 4mS "silent time" as an indication of the end of a message. For detecting the 4mS "idle", I used the
"GetInQLen (port)" in a timer with 4mS interval time . The problem is : the length of input queue sometimes doesn't change between two timer event while data is still transmitting and result in ending the receiving. That means there are at least 7 bytes data received but no data put into the input queue during this 4mS. Do I have to use API or low level function to monitor the "silent time" ?
Thank you for help.
0 Kudos
Message 1 of 5
(3,561 Views)
Hello-

The timer of CVI is a soft timer and can vary greatly from 4ms to many milliseconds. This sounds like an application better suited for a digital DAQ card. There may be a setting for a DAQ card to monitor for the 4ms of "silent time".

Randy Solomonson
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,557 Views)
Randy,  can you elaborate more on your comment, "The timer of CVI is a soft timer and can vary greatly from 4ms to many milliseconds"?  What do you mean by "many milliseconds"?  Are we talking 10s of milliseconds?  20s of milliseconds?  seconds?

Is there any documented information on the minimum resolution of the CVI timer?
0 Kudos
Message 3 of 5
(3,448 Views)

There is no definite answer to this question. CVI timer resolution on modern machines is 1 ms but software timer precision depends on the ability of the system to react in the time specified: if some task is consuming processor time, your 4ms interval may be enlarged in an unpredictable way, and presumably the following interval will be shortened in an effort to regain regular timer pacing.

Particularly in Windows environment, the system may be occupied servicing one of several tasks that are concurrently running in the system (use Task Manager to see how much processes are consuming your system resources Smiley Surprised ).

Normally other tasks may not interfere with your process, but in some case they may stuck the system in a process that does not permit servicing other tasks; time out while accessing a resource (e.g. network errors while connecting to a remore folder) may last from some seconds to several dozens of seconds with the system freezed, the same if trying to read a faulty diskette or preparing a huge printing,,, consider that to service a 4ms timer even your application must be developed with a particular enphasis for efficience!



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 4 of 5
(3,436 Views)
The standard CVI timer is not something I would use for really time sensitive events.  An async timer is much more predictable and has the added advantage of running the callback in a separate thread, so that main thread blocking is not really an issue.  How accurate you can get in timer resolution and jitter is very hardware dependant.  With a powerfull enough PC and the right coding you can get well below 100mS on a PC, but it gets exponentially harder as the time interval decreases and need for an accurate trigger point increases.  For really high speed serial communication etc there are alternatives, but they mostly involve adding additional hardware to the system to get more deterministic performance.  The type of hardware used is dependant on the specific application requirements.  If you have a specific application in mind, you can describe it here and we can provide some guidance on the design.

Message Edited by mvr on 05-26-2006 04:03 PM

0 Kudos
Message 5 of 5
(3,433 Views)