We are developing a software tool for the PCSU1000 oscilloscope. What we don’t find in the control DLL is a command to check if the PCSU1000 is connected to the computer or not, a simple Boolean?
Please advice how to check, via the dll if the PCSU1000 scope is connected or not!
[quote]Please advice how to check, via the dll if the PCSU1000 scope is connected or not![/quote]I’m sorry this is not possible via the DLL.
If the oscilloscope is not connected, the software goes to demo mode.
In the demo mode everything looks like the oscilloscope is still connected.
Now the function ‘Connected’ is added to the PCSU1000D.DLL.
The return value is Boolean.
Example in Visual Basic 2008:
Declaration:Private Declare Function Connected Lib "PCSU1000D.dll" () As Boolean
Usage: Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If Connected() Then
Label6.Text = "Yes"
Else
Label6.Text = "No"
End If
End SubHere you can download the modified PCSU1000D.DLL and modified PCSU1000GU.exe: app.box.com/s/240aamrne0ga8x6xct6o
There is also a demo program PCSU1000Run.exe in the package.
Please extract all the files to an empty folder to test the operation.
A button “Connected?” is added to the demo.
Now the PCSU1000GU.exe does not go to demo mode if the oscilloscope is not connected.
The software simply closes in this case and the return value of the ‘Connected’ will be ‘false’.
You get also ‘false’ if the USB cable is disconnected while the oscilloscope is running.
The USB connection is ready when the software has started and completed the USB enumeration process.
When complete, the return value of the function ‘Connected’ will be ‘true’.
Here you can download a demo written in Visual Basic 2008: app.box.com/s/rd942jxz56ng3q2e6h33
All the updated and other supplement files are in the folder: \PCSU1000_DemoVB2008\bin\x86\Debug