I am trying to export an instrument state to a file, so I can reuse its state later, but it seems like there is an issue
from KeysightDSO import KeysightDSO
import sys, os, dill
def DSO_init(args):
scope = None
try:
scope = KeysightDSO(*args)
# scope.initialization()
except Exception as e:
location="TCPIP0::169.254.75.18::hislip0::INSTR"
scope = KeysightDSO(location)
# scope.initialization()
return scope
# scope = DSO_init(sys.argv[1:])
scope = None
with open('scope_instace.pkl', 'wb') as f:
if __name__ == '__main__':
scope = DSO_init(sys.argv[1:])
else:
scope = DSO_init()
dill.dump(scope, f)
the error is below
raise PicklingError(
PicklingError: Can't pickle <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>: it's not found as ctypes.CDLL.__init__.<locals>._FuncPtr
Can someone help me to understand the issue and how to fix it ? thanks