PSCU200 dynamic link library functions

Dear all,

we are tyring to implement a measurement with the PCSU200 in python.
So, we’ve been trying to use the functions from the .dll of the scope but apparently not all of them work as indent.
So far, we were able to close the .exe via the terminal using the according .dll function. But any other function (like starting the .exe or running the measurement) didn’t work.
Can you please help us?

EDIT: It seems that a few function work without the parameter.
Like, RunOn does work but RunOn(true) or RunOn(false) don’t. RunOn stops the measurement only in this case.

I did a quick test.
In this code the RunOn(True) and RunOn(False) seems to work.
Indeed, RunOn() stops the measurement too.

import ctypes
import time
import os
import sys

os.add_dll_directory(r'C:\Users\VEL255\Documents\Programming\Python\PCSU200')

PCSU200dll = ctypes.WinDLL("PCSU200.dll")

print ("Start PCSU200")

PCSU200dll.Start_PCSU200()
time.sleep(10)

print ("Run ON")
PCSU200dll.RunOn(True)

time.sleep(5)

print ("Run OFF")
PCSU200dll.RunOn(False)

time.sleep(5)

print ("Stop PCSU200")

PCSU200dll.Stop_PCSU200()

sys.exit(0)
2 Likes

Thank you for your help!
It works now

No problem. Glad to be of assistance.

1 Like