Console example for 4000 series: "Unable to open device"

Post your C and C++ discussions here
Post Reply
kneuhaus
Newbie
Posts: 0
Joined: Thu Dec 10, 2015 9:06 pm

Console example for 4000 series: "Unable to open device"

Post by kneuhaus »

Hi,
I hope it is not a duplicated.
The steps I have performed to compile the ps4000con example are listed below.
The result is "Unable to open device".

Any suggestions are welcome.

Kai

1) Install MinGW-w64 - for 32 and 64 bit Windows
http://sourceforge.net/projects/mingw-w ... p_redirect
2) Open command prompt by calling ming-w64.bat

3) Copy example files for Picoscope 4000 into a separate folder such tha
08/06/2015 11:07 19,197,200 picoipp.dll
08/06/2015 11:07 15,583 PicoStatus.h
08/06/2015 11:07 1,570,576 ps4000.dll
08/06/2015 11:07 19,208 ps4000.lib
08/06/2015 11:07 22,561 ps4000Api.h
08/06/2015 11:07 53,415 ps4000con.c
7 File(s) 20,962,832 bytes

4) Compile with
gcc ps4000con.c -o ps4000con.exe -L. -lps4000
ps4000con.c: In function 'set_voltages':
ps4000con.c:1399:5: warning: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
scanf_s("%hd", &unit->channelSettings[ch].range);
^
ps4000con.c: In function 'SetSignalGenerator':
ps4000con.c:1528:18: warning: implicit declaration of function 'fscanf_s' [-Wimplicit-function-declaration]
while (EOF != fscanf_s(fp, "%hi", (arbitraryWaveform + waveformSize))&& waveformSize++ < AWGFileSize - 1);
^
5) Run executable
ps4000con.exe

PS4000 driver example program


Opening the device...
Handle: 0
Unable to open device
Error code : 3

Hitesh

Re: Console example for 4000 series: "Unable to open device"

Post by Hitesh »

Hi Kai,

The status code of 3 indicates that the device was not found.

Are you using the PicoScope 6 software at the same time? If so, please close it down.

If you are using the PicoScope 4824 you will need to use the ps4000a driver and corresponding example.

Regards,

kneuhaus
Newbie
Posts: 0
Joined: Thu Dec 10, 2015 9:06 pm

Re: Console example for 4000 series: "Unable to open device"

Post by kneuhaus »

Excellent, that works.
I need to use the examples for the ps4000a altogether.

Thanks again.
Regards,
Kai

Post Reply