Below is code I am using with python. Note that inpout32.dll which can be found here is present in the same directory.
import ctypes
ctypes.windll.inpout32.Out32(0x300, 40)
print ctypes.windll.inpout32.Inp32(0x300)
The code should input 40 in the address of 300, however when I try to read the value at address 300 I get 255 no matt开发者_高级运维er what I input. The code does however work when I use 378 as an address(LPT1).
Edit Just so everyone is aware, I am trying to do this to use an input/output board on a 104pc
What model are you using? http://www.opal-rt.com/kb-article/pc104-ios-do-not-work a quick google search shows that some cards reserve 0x300, and that this is a common source of such problems. Seems like you might be using the wrong base address.
精彩评论