PCSU200.DLL problem with SetGen "fast setting" function

I’m writing an app to control the PCSU200 oscilloscope and I’ve run into a slight problem with the PCSU200.DLL library.

When I try to set the signal generator using;

SetGen(0, 1000, 5)

The generator does not run.

I have a loop which passes the frequency to the generator, and if I use;

SetGen(1, 1000, 5)

That works fine, however I can see the “Sine” button on the Oscilloscope app being turned on and off for every change in frequency and this is causing issues with generator stability.

I have also tried setting the generator on generating a sine wave, and then trying the fast set method, however this still fails.

So is this a bug in PCSU200.DLL ?

Thanks.

I’m sorry for the inconvenience.
It seems that there in the SDK package is old version of the PcLab200.exe program.
You can fix the problem by using the PcLab200.exe program from this installation package:
https://www.velleman.eu/downloads/files/downloads/pclab200_v1_06_setup.zip

Please see also this thread for more info and for a download link to get updated demo package:

Thanks, but even with the new DLL I still seem to be having some issues.
I have four buttons on a form - two of the buttons set the generator with “1” and two with “0” (fast set).
When I flick between them - the buttons setting the SINE function explicitly work as anticipated, however the fast set buttons…
When I click to 100Hz it selects 100Hz but when I click 1000Hz it selects 500Hz… ?
Am I doing something wrong?

’ fast set 100Hz

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
SetGen(0, 100, 5)
Time(7)
End Sub

’ fast set 1000Hz (this selects 500Hz each time?)

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
    SetGen(0, 1000, 5)
    Time(9)
End Sub

’ “normal” 100Hz

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
    SetGen(1, 100, 5)
    Time(7)
End Sub

’ “normal” 1000Hz

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
    SetGen(1, 1000, 5)
    Time(9)
End Sub

In the manual “Make your own software for the PCSU200.pdf” there is written:

Parameters
func: Selects the function:
1 - sine
2 - square
3 - triangle
0 - Uses the previously selected function (sine, square or triangle). This is fast option to
change frequency or amplitude. All function generator settings are not updated. The
frequency can be set within the previously selected “band” e.g. 500Hz to 5kHz.

I’m sorry, the frequency change 100Hz to 1000Hz is not possible in the “fast” mode.

I did note this in the manual.

However, I’m trying to step through frequencies in fast mode - so does this mean I won’t be able to perform steps like:

10, 20, 30, 40, 50…

Fast setting mode is strictly limited to steps only within 500Hz to 5kHz?

I understood it to mean that one could fast step in short increments, so long as you kept within a certain span.

Thanks.

This is possible if you first select 10Hz in the “normal” mode: SetGen(1, 10, 5)
This puts the generator to the frequency “band” 5Hz-50Hz.
You can see the “band” on the PCSU200 control panel.
Now you can use in the “fast” mode all frequencies from 5Hz to 50Hz.

It became obvious when I looked at 6 frequency buttons on the PCLAB200 interface!

For some reason I just didn’t associate those frequency bands with what was mentioned int he manual. :expressionless:

All working now, although it took a while to work out the logic. (debug output below)

Thanks again for you help.

5 to 50 - hardset to 12.60
5 to 50 fast set to 15.87
5 to 50 fast set to 20
5 to 50 fast set to 25.20
5 to 50 fast set to 31.75
5 to 50 fast set to 40
50 to 500 - hardset to 50.40
50 to 500 - fast set 63.50
50 to 500 - fast set 80
50 to 500 - fast set 100.79
50 to 500 - fast set 126.99
50 to 500 - fast set 160
50 to 500 - fast set 201.59
50 to 500 - fast set 253.98
50 to 500 - fast set 320
50 to 500 - fast set 403.17
500 to 5k - hardset to 507.97
500 to 5k fast set to 640
500 to 5k fast set to 806.35
500 to 5k fast set to 1015.94
500 to 5k fast set to 1280
500 to 5k fast set to 1612.70
500 to 5k fast set to 2031.87
500 to 5k fast set to 2560
500 to 5k fast set to 3225.40
500 to 5k fast set to 4063.75
5k to 50k - hardset to 5120
5k to 50k - fast set to 6450.80
5k to 50k - fast set to 8127.49
5k to 50k - fast set to 10240
5k to 50k - fast set to 12901.59
5k to 50k - fast set to 16254.99
5k to 50k - fast set to 20480
5k to 50k - fast set to 25803.18
5k to 50k - fast set to 32509.97
5k to 50k - fast set to 40960
50k to 1M - hardset to 51606.37
50k to 1M - fast set to 65019.95
50k to 1M - fast set to 81920
50k to 1M - fast set to 103212.73
50k to 1M - fast set to 130039.89
50k to 1M - fast set to 163840
50k to 1M - fast set to 206425.46
50k to 1M - fast set to 260079.79
50k to 1M - fast set to 327680
50k to 1M - fast set to 412850.93
50k to 1M - fast set to 520159.58
50k to 1M - fast set to 655360
50k to 1M - fast set to 825701.86

Glad to see all is working well now :slightly_smiling_face: