09-24-2009 08:36 AM
09-25-2009 08:33 AM
Hi SnamProgetti,
how's the Datasocket API chain configured? Are you opening a Read or a BufferedRead connection? Remember also that you must check the scan rate for the NI-Scan Engine (see the controller properties) and adapt code to such rate (by using a Timed Loop or a "Synchronize to Scan Engine" function into a while loop.
Also, there's an advanced API for controlling Scan Engine I/O nodes:
NI Scan Engine Advanced I/O Access
Hope this helps,
Fabio
09-25-2009 09:02 AM
There's a "Datasocket open" with "mode" set to "Read", then a "Datasocket read" with "type" set to DBL and "wait for updated value" set to false. The scan rate for the NI-Scan Engine is set to much faster than the timed loop with the Datasocket read.
Is the "Advanced I/O access" recommended over Datasocket, even for single variable readings?
10-12-2009 02:05 AM
Hi Snamprogetti,
sorry for the late reply. The behavior you're describing is really odd. What you could do in order to speed up things is to use Direct I/O access for your I/O node instead of Scanned I/O, as described into this document:
Using I/O Variables (NI Scan Engine)
Anyhow, Scan Engine process is normally set as a priority higher than other processes running on your cRIO, as you can see from Scan Engine configuration page. Another thing you can try is to use new API's described here
Programmatic Discovery, Configuration, and Access of CompactRIO Scan Mode I/O with LabVIEW
for programmatic access to Scan nodes.
Hope this helps,
Best regards,
Fabio
10-12-2009 09:33 AM - edited 10-12-2009 09:34 AM
Hi Snamprogetti,
The datasocket VIs go through the network stack to read the I/O values. Pushing the scanned I/O values out to the network is lower priority than the local I/O scan, so I would not be surprised if you see old value when your CPU load is high.
The correct way to programmatically access I/O at runtime is to use the new API introduce in LabVIEW 2009 for Programmatic Discovery, Configuration, and Access of CompactRIO Scan Mode I/O with LabVIEW
Refer to the "Reading and Writing I/O" section.
Kurt
10-12-2009 10:13 AM