I have recently purchased a 4227 picoscope -- I bought the 4227 instead of the 4226 because of its higher sampling rate of 250 M/s
I have been experimenting with the C# demo in the PS4000 SDK. I noticed that in running the demo, that the code would not let you specify a 0 value for the timebase in the GetTimeBase function call. I figured that they wanted the demo to work with either the 4226 or 4227 as the SDK documentation notes that the 0 value is only for 4227 scopes.
However, when I changed the example code to pass in a '0' value for timebase, I get a returned status of PICO_INVALID_TIMEBASE from the GetTimeBase function call. I have the latest SDK and the PDF documentation indicates that a timebase of 0 is valid for 4227 scopes (the demo correctly identifies that I have a 4227 scope attached).
This essentially means that the extra money that I spent for the 4227 is wasted as I can't access the fastest timebase under program control.
Are there any plans to update the ps4000.dll to allow a value of '0' for the GetTimeBase call for 4227 scopes?
Thanks for the reply. I was using two channels because I really need to use an external trigger, but the API does not seem to allow use of the external trigger signal. So, I was using one of the channels as a trigger channel.
So, is there a way in the API to trigger using the external trigger input where there is only one channel enabled? It does not look like it from the API documentation.
I have had no success in getting the external trigger to actually work with the SDK. I have tried modifying both the C example (PS4000con.c) and the C# example and both give the same results, in that trying to use the external trigger results in the scope automatically triggering (ie. the block trigger code returns immediately indicating a trigger regardless of what is actually happening on the external input).
I modified the C code in the CollectBlockTriggered example to be:
The trigger signal is a 3.3 V pulse that is about 2 us wide. The only way that I can get the code to NOT trigger immediately is to provide a negative value for the trigger voltage (but then, the code never triggers). It would be nice to know how to use the external trigger with the SDK. I have no problem using the external trigger with the PicoScope front end.
FYI:
a. Your value for PS4000_MAX_VALUE (used by mv_to_adc function) is inconsistent between the C code example and the C# example. In the C code (ps4000api.h), the value is 32764, in the C# example (ps4000imports.cs) it is 32512 --- I assume the C example is correct and the C# example is wrong (unless it is a case of the lower 8 bits being a don't care which I would not understand in that case).
b. Your C code function 'BlockDataHandler' never initializes 'fp' to NULL, so if the Block collection is aborted by the user by a key press, the code crashes when a fclose attempt is made on a garbage 'fp' value.
If it works ok using Picoscope6, check that the C# application is using the same ps4000.dll.
If it is, and it still doesn't work, please email support@picotech.com to arrange checking of the device.
MaxValue = 32764 for the 4000 series scopes.
The C# code has been modified, and ps4000.c has fp is initialised to NULL in the next release of the sdk ( > 10.1.0.17)