1

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 matter 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

Community
  • 1
  • 1
Richard
  • 15,152
  • 31
  • 85
  • 111

1 Answers1

0

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.

  • I had a quick look through device manager and none of the cards use that address. I have also tried different base addresses. – Richard Apr 26 '11 at 11:13
  • @Richard apparently, if you use multiple cards that address is also invalid. [source](http://www.kxcad.net/cae_MATLAB/toolbox/rtwin/ug/f11768.html#f14798) – vagrantpostman Apr 26 '11 at 18:02
  • I am just using the one board. As I mentioned before, I have also tried different base addresses.. Thanks for the suggestion though. – Richard Apr 28 '11 at 16:45