Sadlercomfort
Ash
I was thinking that we may be able to avoid the above if we change the following.
'TIMEOUT FUNCTION
TIMEOUT1:
Let GPS1_TIMEOUT=1
goto GPS2_read
TIMEOUT2:
Let GPS2_TIMEOUT=1
if GPS1_TIMEOUT=1 AND GPS2_TIMEOUT=1 then
HIGH BUZZER 'HIGH BUZZER if both serin commands timeout
endif
if GPS1_TIMEOUT=0 AND GPS2_TIMEOUT=1 then
LOW Relay
endif
goto main
this way if GPS1 is ok and GPS2 is timeout then relay goes High (GPS1 is connected)
if GPS2 is ok and GPS1 is timeout then when gps2 scan occures we instruct it to check if PGS1_timeout = 1 and then to set relay High.
Yes I like your thinking, this should solve the problem
However.. In the program we have an error variable to filter out anomalies by incrementing to 3 when there is bad data and decrementing back to 0 to indicate good data. The TIMEOUT function does not include this.. and if a gPS is giving good NMEA sentences and throws an anomaly with the TIMEOUT period.. the output will switch too quickly. So I think we should increase the timeout period in milliseconds accordingly.. or put it an error variable to filter anomalies.
Also i dont understand how Active_GPS tag works...
isnt it suppesed to chech the "bold" number in the sentence ?
$GPGSA,A,3,02,24,25,32,,,,,,,,,2.79,1.62,2.27*0E,3.01,1.99,2.25*015*00
where 1 = nofix (bad data)
2 = 3dfix (bad or missing data)
3 = 3dfix (and complete data)
i have simulated with 1 and 2 and doesnt look to affect the output of the faut leds.
What am i missing here ?
While simulating you need to take into account the error variable which I've just described.. if a GPS recieves a 1 or a 2 after three consecutive cycles.. the error variable will increment to 3 and then the output relay will switch accordingly.
Last edited: