MOUNTAIN747
- 15th March 2011, 16:32
I’m trying to get a OWOUTcommand to jump to a label when there is no sensor present. I have two ports on a 16F873a using 1-Wire to read DS2438 battery monitors. If there is no sensor present I want to jump to a label. I have verified that on an empty port, the master sends the reset pulse but there is no presents pulse. The program does not jump to a label as expected. On a port where there is a sensor the program works as it should. Am I setting up the command correctly to jump to a label if sensor is not present? There is no example of this in the manual. Comments Please! Thanks...
Sensor:
OWOUT OWnet,1, [skiprom,WriteScratchpad,$00,$00],Senout
OWOUT OWnet,1, [skiprom,ConvertT] :pause 10
OWOUT OWnet,1, [skipROM,ConvertV] :pause 5
OWOUT OWnet,1, [skipROM,RecallMemory, $00] ; Skip ROM search, Recall Memory
OWOUT OWnet,1, [skipROM,ReadScratchpad, $00] ; Skip ROM search, Read
OWIN OWnet,2, [STR DSbuffer\9]' Read 9 bytes
Serout2 TX_485, 84,[" 1-Wire is present on main"]
GOSUB GetT_V
Senout:
RETURN
ALT_Sensor:
OWOUT OWalt,1, [skiprom,WriteScratchpad,$00,$00],Altout
OWOUT OWalt,1, [skiprom,ConvertT] :pause 10
OWOUT OWalt,1, [skipROM,ConvertV] :pause 5
OWOUT OWalt,1, [skipROM,RecallMemory, $00]
OWOUT OWalt,1, [skipROM,ReadScratchpad, $00] ' Skip ROM search, Read
OWIN OWalt,2, [STR DSbuffer\9]' Read 9 bytes
Serout2 TX_485, 84,[" 1-Wire is present on Alternet"]
GOSUB GetT_V
Altout:
RETURN
Sensor:
OWOUT OWnet,1, [skiprom,WriteScratchpad,$00,$00],Senout
OWOUT OWnet,1, [skiprom,ConvertT] :pause 10
OWOUT OWnet,1, [skipROM,ConvertV] :pause 5
OWOUT OWnet,1, [skipROM,RecallMemory, $00] ; Skip ROM search, Recall Memory
OWOUT OWnet,1, [skipROM,ReadScratchpad, $00] ; Skip ROM search, Read
OWIN OWnet,2, [STR DSbuffer\9]' Read 9 bytes
Serout2 TX_485, 84,[" 1-Wire is present on main"]
GOSUB GetT_V
Senout:
RETURN
ALT_Sensor:
OWOUT OWalt,1, [skiprom,WriteScratchpad,$00,$00],Altout
OWOUT OWalt,1, [skiprom,ConvertT] :pause 10
OWOUT OWalt,1, [skipROM,ConvertV] :pause 5
OWOUT OWalt,1, [skipROM,RecallMemory, $00]
OWOUT OWalt,1, [skipROM,ReadScratchpad, $00] ' Skip ROM search, Read
OWIN OWalt,2, [STR DSbuffer\9]' Read 9 bytes
Serout2 TX_485, 84,[" 1-Wire is present on Alternet"]
GOSUB GetT_V
Altout:
RETURN