Hi all
Ive been playing around with parallel port relays (you guessed it heard it before)

any way the problem ive got i can get relays on and off But i want say relay 1 off but not to change any of the conditions of any other (i thought of writing port byte to text file then read file and then write to port - 1 eg but dont work)

anyway this is what ive got - just sets all relay on

VB Code:
  1. Private Declare Sub SetPortBit Lib "IO" (ByVal Port As Integer, ByVal Bit As Integer)
  2. Private Declare Sub ClrPortBit Lib "IO" (ByVal Port As Integer, ByVal Bit As Integer)
  3. Private Declare Sub NotPortBit Lib "IO.dll" (ByVal Port As Integer, ByVal Bit As Integer)
  4. Private Declare Function GetPortBit Lib "IO.dll" (ByVal Port As Integer, ByVal Bit As Integer) As Integer
  5. Private Declare Sub RightPortShift Lib "IO.dll" (ByVal Port As Integer, ByVal ShiftIn As Integer)
  6. Private Declare Sub LeftPortShift Lib "IO.dll" (ByVal Port As Integer, ByVal ShiftIn As Integer)
  7.  
  8. 'Private Declare Sub PortOut Lib "IO.dll" (ByVal Port As Integer, ByVal Data As Byte)
  9. 'Private Declare Sub PortIn Lib "IO.dll" (ByVal Port As Integer, ByVal Data As Byte)
  10.  
  11. Private Sub Command1_Click()
  12. PortOut 888, 1                 'relay 1 on
  13. End Sub
  14.  
  15. Private Sub Command2_Click()
  16.  
  17. PortOut 888, -1               ' relay 1 off  
  18. End Sub
  19.  
  20. Private Sub Command3_Click()
  21. PortOut 888, 2                   'relay 2 on
  22. End Sub
  23.  
  24. Private Sub Command4_Click()
  25. PortOut 888, -2                  'relay 2 off
  26. End Sub
  27.  
  28. Private Sub Command5_Click()
  29. PortOut 888, 0                 'relays all off
  30. End Sub

ive got then xp io.dll
if you could help cheers