Hi all,
I'm currently trying to get a passcode working for a BCD input (i.e. DTMF decoder output)
I have the BCD Input as follows
GetDtmf:
dtmf = 0
IF DT0 = 1 Then 'Check Input port 0
dtmf = dtmf + 1
EndIF
IF DT1 = 1 Then 'Check Input port 1
dtmf = dtmf + 2
EndIF
IF DT2 = 1 Then 'Check Input port 2
dtmf = dtmf + 4
EndIF
IF DT3 = 1 Then 'Check Input port 3
dtmf = dtmf + 8
EndIF
So each BCD line is added to the VAR dtmf,
Then further down I have a lookup section of code
C = C + 1 'Add 1 to Tone Count Register
LookDown dtmf,["0,4,8,2,3,9,1,7,5,6"],J 'LookDown Table
IF J = 0 then error
IF C = 1 AND J = 1 Then Key 'Check Codes are sent in correct order
IF C = 2 AND J = 2 Then Key
IF C = 3 AND J = 3 Then Key
IF C = 4 AND J = 4 Then Key
IF C = 5 AND J = 5 Then Key
IF C = 6 AND J = 6 Then Key
IF C = 7 AND J = 7 Then Key
IF C = 8 AND J = 8 Then Key
IF C = 9 AND J = 9 Then Key
So if I send a 4 on DTMF which will activate DT2 and write 4 to the var dtmf, then the loookup table should see the 4 at position 1 and write a 1 to the var J, problem is it's error out here at the line
IF J = 0 then error ..
Any ideas anyone please?
Regards,
Jim
Bookmarks