HA7Net and HB 4 channel relay


New Member
This is just an observation and I would like to know if anyone else has seen this behavior.

If you attempt to read the status of a relay on a HB 4 channel relay using the readbyte function of an HA7Net, you will toggle the relay output to the opposite state. I originally wanted to read the output state of the relay so as to determine whether to toggle the relay to an on or off state. The solution I am using right now is to connect an X10 powerflash to the relay output and determine the state of the relay by looking to see if the powerflash is on or off using heyu running under Linux 7.1. This works but is not what I wanted.

Has anyone come up with a work around other than X10 powerflash?

I finally got around to playing with my relay board.

I don't have a HA7NET so this may not help you, but this is what I've come up with.

If you access a DS2405 using the "match rom" sequence, it will toggle.

To read a DS2405 you need to do a search.
When you hit the DS2405, send another bit and it will return the status.
See the datasheet for details. Specifically:
"The DS2405 that was discovered by the search process will not toggle the state of its PIO pin at the end of the search, but additional read time slots issued by the bus master after the search is completed will cause the DS2405 to output the logic state of its PIO pin onto the 1-Wire bus."

pidgincode w/o error handling using TMEX

' reset devices
' first device
ret = TMFirst
While ret = 1
' get the romid from the driver
romid(0) = 0
TMRom romid
' check romid
if romid = (id of the ds2405 you want to know the status of) then
' get the state
ret = TMTouchBit 0xff
If ret = 0 Then
state = 1 ' on
state = 0 ' off
End If
End If
' next device

To toggle and read the new status

' reset devices
' send match rom
TMTouchByte 0x55
' send romid
For x = 0 To 7
TMTouchByte romid(x)
Next x
' read new state
TMTouchBit 0xff
If ret = 0 Then
state = 1 ' on
state = 0 ' off
End If
The DS2405 is a pretty dumb device. I mainly use it because of the price. I think for the next production run of Relay boards I will change to the DS2406. The board is already laid out for those, it will just raise the price a few dollars.

I also may design a new I/O board based on the DS2408 but that would be a whole new design and I have no idea what the price would be.