Controle Paneel |
|
|
Site info |
»
»
»
»
» Upload Archief
|
|
Stats |
Totaal online: 1 1 gasten 0 leden: |
|
|
Forum > Digitaal > If..Then..EndIf perikelen |
|
Gepost op woensdag 17 December 2014 17:54:14 |
 |
Dat If Then EndIf wel eens fout gaat maakt een ieder wel eens mee.
Deze keer ben ik weer aan de beurt.
In topic Armelui's Voorversterker stuitte ik op dit probleem;
Code |
' ********* Check opname Parallel I(/O)' Poort B4-B7 <<-- Tascam Output Status
Controle1: ' Pin 11 (Rood) + Pin 13 (Blauw)
If PORTB.5 = 0 And PORTB.7 = 0 Then ' Record + Play check
Temp = 1 '
EndIf
If PORTB.4 = 0 Then ' Record-READY Pin 15 (Oranje)
GoSub Tascam_Play ' ToDo Port D.0 ; Play
EndIf '
Return
Controle2: ' Pin 11 (Rood) + Pin 13 (Blauw)
If PORTB.5 = 1 Or PORTB.7 = 1 Then ' Record of Play, niet actief?
If PORTB.7 = 0 Then ' Alleen Afspelen? Play (gewoon afspelen dus).
Temp = 0 ' ipv.
GoSub Tascam_Stop ' ToDo PortD.1 ; Stoppen
EndIf '
EndIf
If PORTB.6 = 0 Then ' Gestopt? Pin 12 (Grijs) Stop = Low, start recording opnieuw.
DelayMS 400 ' Eerst wachten totdat Stop-Relais is afgevallen, 350mSec!
GoSub Tascam_Record ' ToDo Record PortD.2
DelayMS 2500 ' Second3 = Seconden + 3, en dan; If Second3 = Seconden Then ......
GoSub Tascam_Play ' ToDo Play PortD.0
EndIf
Return
' ***************Eind Tascam Record-Control
|
Het probleem wordt veroorzaakt door DelayMS 400.
Het laatste stukje van dit Subroutine wordt niet uitgevooerd.
Plaats ik de DelayMS 400 1 positie hoger, maakt ook niet uit.
Nog verder omhoog juist boven de beide EndIf dan wordt de rest van de subroutine WEL uit gevoerd.
Dus;
Code |
' ********* Check opname Parallel I(/O)' Poort B4-B7 <<-- Tascam Output Status
Controle1: ' Pin 11 (Rood) + Pin 13 (Blauw)
If PORTB.5 = 0 And PORTB.7 = 0 Then ' Record + Play check
Temp = 1 '
EndIf
If PORTB.4 = 0 Then ' Record-READY Pin 15 (Oranje)
GoSub Tascam_Play ' ToDo Port D.0 ; Play
EndIf '
Return
Controle2: ' Pin 11 (Rood) + Pin 13 (Blauw)
If PORTB.5 = 1 Or PORTB.7 = 1 Then ' Record of Play, niet actief?
If PORTB.7 = 0 Then ' Alleen Afspelen? Play (gewoon afspelen dus).
Temp = 0 ' ipv.
GoSub Tascam_Stop ' ToDo PortD.1 ; Stoppen
DelayMS 400 ' Eerst wachten totdat Stop-Relais is afgevallen, 350mSec!
EndIf '
EndIf
If PORTB.6 = 0 Then ' Gestopt? Pin 12 (Grijs) Stop = Low, start recording opnieuw.
GoSub Tascam_Record ' ToDo Record PortD.2
DelayMS 2500 ' Second3 = Seconden + 3, en dan; If Second3 = Seconden Then ......
GoSub Tascam_Play ' ToDo Play PortD.0
EndIf
Return
' ***************Eind Tascam Record-Control
|
Dit werkt dus goed.
Wie heeft hier een verklaring voor, ik zie dit zo een twee drie niet. |
|
|
|
|
|