07-18-2006 10:37 AM
07-18-2006 11:33 AM
If you have the FDS version of CVI then you could use the Critical Section approach in the SDK.
JR
07-18-2006 08:33 PM
Windows Critical Section is only effective for multiple threads in a process, not for multiple processes. It shall be Mutex to synchronise multiple processes. As for VISA resource-based synchronisation, you can use VISA LOCK feature instead of Windows synchronisation objects. The following two programs, which query different items (meas:curr? & meas:volt?) with the same instrument, will work correctly without conflict.
// Program [A]
vs = viLock( vi, VI_EXCLUSIVE_LOCK, 2000, NULL, NULL);
vs = viWrite( vi, ":MEAS:CURR?\n", ...snip...);
vs = viRead( vi, buffer, ...snip...);
vs = viUnlock( vi);
// Program [B]
vs = viLock( vi, VI_EXCLUSIVE_LOCK, 2000, NULL, NULL);
vs = viWrite( vi, ":MEAS:VOLT?\n", ...snip...);
vs = viRead( vi, buffer, ...snip...);
vs = viUnlock( vi);
Hope this helps,
Makoto
07-18-2006 08:51 PM