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:
Private Declare Sub SetPortBit Lib "IO" (ByVal Port As Integer, ByVal Bit As Integer) Private Declare Sub ClrPortBit Lib "IO" (ByVal Port As Integer, ByVal Bit As Integer) Private Declare Sub NotPortBit Lib "IO.dll" (ByVal Port As Integer, ByVal Bit As Integer) Private Declare Function GetPortBit Lib "IO.dll" (ByVal Port As Integer, ByVal Bit As Integer) As Integer Private Declare Sub RightPortShift Lib "IO.dll" (ByVal Port As Integer, ByVal ShiftIn As Integer) Private Declare Sub LeftPortShift Lib "IO.dll" (ByVal Port As Integer, ByVal ShiftIn As Integer) 'Private Declare Sub PortOut Lib "IO.dll" (ByVal Port As Integer, ByVal Data As Byte) 'Private Declare Sub PortIn Lib "IO.dll" (ByVal Port As Integer, ByVal Data As Byte) Private Sub Command1_Click() PortOut 888, 1 'relay 1 on End Sub Private Sub Command2_Click() PortOut 888, -1 ' relay 1 off End Sub Private Sub Command3_Click() PortOut 888, 2 'relay 2 on End Sub Private Sub Command4_Click() PortOut 888, -2 'relay 2 off End Sub Private Sub Command5_Click() PortOut 888, 0 'relays all off End Sub
ive got then xp io.dll
if you could help cheers![]()




Reply With Quote