Eg to make a struct from a string >>> a = cast(packet, POINTER(A)).contents >>> a.x 258 >>> Or (this is identical to your method) >>> a = A() >>> a.x 0 >>> memmove(addressof(a), packet, sizeof(a)) 3083811008L >>> a.x 258 I think the second of those methods is promoted by the ctypes documentation. I'm not sure about the lifetimes of the .contents in the first method! And the reverse >>> string_at(addressof(a), sizeof(a)) '\x02\x01\x00\x00' >>>
USB Experimentier-Interface-Board
Das Interface-Board hat 5 digitale Eingangs- und 8 Ausgangskanäle. Zusätzlich stehen noch 2 analoge Ein- und 2 Ausgänge mit einer 8 Bit Auflösung zur Verfügung. Die Anzahl der Ein- und Ausgänge kann noch weiter vergrößert werden, indem bis max. 4 Karten mit den USB-Anschlüssen des PCs verbunden werden. Alle Kommunikationsprogramme sind in einer Dynamic Link-Library (DLL) K8055D.DLL gespeichert. Sie können maßgeschneiderte Windows® (98 SE, 2000, ME, XP) Applikationen in Delphi, Visual Basic, C++ Builder oder jedem anderen 32 Bit Windows®-Hilfsprogramm für Applikationen, die DLL unterstützen, schreiben.