wavefrontshaping / ALP4lib

Python control module for Vialux DMDs based on ALP4.X API.
MIT License
55 stars 40 forks source link

Incorrectly passing C-struct by reference in [def DevControlEx(self, controlType, userStruct):] #18

Closed AustinModoff closed 10 months ago

AustinModoff commented 2 years ago

Hello, Your wrapper code has been very helpful and I want to thank you for creating it! However, I did notice one error in how you passed the tAlpDynSynchOutGate structure to the C ALP

it should be changed from:
self._checkError(self._ALPLib.AlpDevControlEx(self.ALP_ID, controlType, userStruct.byref), 'Error sending request.') to self._checkError(self._ALPLib.AlpDevControlEx(self.ALP_ID, controlType, ct.byref(userStruct)), 'Error sending request.')

this will correctly pass by reference the userStruct to the C ALP

Despereaux-z commented 1 year ago

Thanks for your advice! I solved this problem. But when I use the tAlpDynSynchOutGate structure to define the Gate, the ct.c_ubytes only accepted an int input, such as 0 or 1. How to input a Gate (for example 10, 010, 001) when Period is 2 or 3? Moreover, how to control the PIN 8 to output a frame synch pulse voltage? I did't see any description in ALP-4.3 API description. PDF. I would appreciate it if you could reply!