01-24-2020 07:23 AM
Hello,
I am using the hp33120a driver for my 33220A function generator with USB connection.
When setting the frequency to 9000Hz [ hp33120a_ConfigureStandardWaveform (hp33120a, "1", HP33120A_VAL_WFM_PULSE, 5.00, 2.50, 9000.0, 10.00); ]
The device shows 9.0090090 kHz. Similar with other values.
Any ideas how to get the correct frequency?
thanks & regards,
Jo
01-27-2020 08:42 AM
Generally speaking frequencies are generated with a multiplier and a divider from a base frequency, and those two numbers are integers. So take a 1MHz base freq, you can generate 1000000*2/3 and all kinds of other ratios, but those numbers have limits, hence the possible gaps in the reachable frequencies. and the necessity to always to a GetFreq after doing a SetFreq on a device to ensure you are indeed using the wanted value.
Another more simple explanation is that your device needs a calibration. Either return it to its maker (they have procedures for that), or look into the operating manual (some devices are not meant to be recalibrated by the used, I have no idea about this one).
01-28-2020 04:13 AM
Sorry, when I adjust the device manually to 9000Hz, it's accuracy is ~0.7ppm. But when I set the frequency by CVI, the device shows 9009.00900Hz.
When looking to the communication with NI-Max, I found that the driver converts the frequency to a period and is sending this period value to the device.
Because this period has only a resolution of 1µs the accuracy is very poor for a 20MHz device. So the question is how to send a frequency with higher accuracy/resolution to the device?
01-28-2020 04:58 AM - edited 01-28-2020 05:01 AM
Good debugging ! I'm not familiar with this model... How does the driver send the period ? With a viWrite of an SCPI command ? Did you use NI I/O Trace to figure it out ?
If it is in any way similar to the models I use, you can find the source code to the driver in C:\Program Files\IVI\Drivers\hp3... and modify it there. Look at the list of SCPI commands relative to your model (or similar, it's probably all the same) and change the ini function to use a frequency instead of a period. You may have to rebuild the .fp before you can use it.