5, which is not explained in the programmer’s guide. We have no idea how to use it. So if we us for testing an external frequency within the range of 20MHz ± 5% and choose the correct struct-variable 'PS6000_FREQUENCY_20MHZ' we don’t get an error message but we also don’t see any effect, i.e. the correct sampling rate. We can change what we want and nothing happens – except that we get wrong sampling rates (which might be extreme high).
Are there other API-function which have to be combined with the external clock API to make it working? Must the external clock API be enabled by another command? Is a matlab programmer's guide available?
Best regards
-->
Hi,
we are currently using the PS6404D in a MATLAB environment. In our current application we are using the streaming mode and we need a certain frequency in the range of 20,5MHz delivered by a very accurate external clock device. So we want to use the existing external clock interface at the rear of the PS6404D.
In the programmer’s guide of the PS6000-series we found the API function “ps6000SetExternalClock” and implemented it in our Matlab-script after connecting the PS6404D and setting up the channels. First we found a mismatch between the programmer’s guide (unfortunately there is no Matlab programmer’s guide available, isn’t it?) and the software environment. In the list of arguments for the frequencies in the enuminfo struct-variable:
enuminfo.enPS6000ExternalFrequency=struct('PS6000_FREQUENCY_OFF',0,'PS6000_FREQUENCY_5MHZ',1,'PS6000_FREQUENCY_10MHZ',2,'PS6000_FREQUENCY_20MHZ',3,'PS6000_FREQUENCY_25MHZ',4,'PS6000_MAX_FREQUENCIES',5);
we can see an additional frequency parameter “MAX-FREQUENCIES” -->5, which is not explained in the programmer’s guide. We have no idea how to use it. So if we us for testing an external frequency within the range of 20MHz ± 5% and choose the correct struct-variable 'PS6000_FREQUENCY_20MHZ' we don’t get an error message but we also don’t see any effect, i.e. the correct sampling rate. We can change what we want and nothing happens – except that we get wrong sampling rates (which might be extreme high).
Are there other API-function which have to be combined with the external clock API to make it working? Must the external clock API be enabled by another command? Is a matlab programmer's guide available?
When you call the ps6000SetExternalClock function, what is the threshold value being set? Note that the threshold value should be between -1 and +1 (this function uses Volts as opposed to counts).
There is no other command to call - you will need to ensure that the clock signal passes through the threshold value that is set.
Which version of the ps6000.dll are you using?
There is set of help files planned for the Instrument Driver but most of the functions are based on those defined in the Programmer's Guide. Once you have created a device object by using the icdevice function, you should be able to call the following to view help information about the function call using the object name:
thank you for your quick reply. The SDK we are using is the PS6000sdk_r10_5_2_1 loaded from your website. It's the same version we have on DVD deliverded with the scope.
Currently I am using a USB2.0 interface. With respect to that I have only channelA activated. The external clock frequency is set up to 5MHz with the appropriate amplitude of 2Vpp. The threshold level has been set to 0Volts. The PS6404D gets a 1MHz signal on channel A. So the USB2.0 capacity should be ok for that.
After sampling I do a FFT to calculate the sampling rate with the known 1MHz-frequency. The results show different sampling rates which have nothing to do with the external clock frequency.
There is no change when I change the threshold levels or when I change the frequency setting in the invoke-commandline. I can see changes in the sampling rate when I slightly change the clock frequency. But the results differ over a wide range and have nothing to do with the 5MHz input signal.
What is the value of status.setExternalClock when the function is executed?
Please e-mail support@picotech.com indicating if you are using a 32-bit or 64-bit version of MATLAB and we will provide you with an SDK installer with a later version of the ps6000.dll.