Hi,
There is no example in C that I can provide you but the basic principle is not that difficult.
Basically only one app should access the instrument. But in
some circumstances, two apps may need access at a time.
For instance, one app sets up the measurement mode, and
another app retrieve measurement data.
In this case the app1 posts setting cmd/query and/or retrieves
responses. And the app2 posts measurement cmd/query. Actual
scenario is like below:
app1:
Lock()
viWrite(vi, ":xxx:meas:mode yy")
viWrite(vi, ...)
viRead(vi, ...)
Unlock()
app2:
Lock()
viWrite(vi, ":xxx:meas:voltage?")
viRead(vi, ...)
Unlock()
I've tried this once in LabVIEW with the iblock and ibunlock functions and they applications work fine.
Regards.
JV