Witam. Podczas pisania testowego programu (do płytki testowej z kursu Bascoma) do sterowania falownikiem wyskakują mi błędy 7 i 123. Korzystam z wersji demo Bascom 2.0.7.5. Oto mój program
A to kody błędów:
Proszę o szybką odpowiedź. Z góry dziękuję.
Dim Czestotl As Byte , Do_zaokr As Single , Do_timera As Long , Ktorapol As Bit , Odliczanie As Long , Blokada As Bit , Powitanie As Bit
Config Pind.0 = Input , Pind.1 = Input , Pind.2 = Output , Pind.3 = Output
Config Portd.2 = 1 , Portd.3 = 1
Config Timer0 = Timer , Prescale = 64 : Enable Interrupts : Enable Timer0
Ktorapol = 0
Czestotl = 10
Do_timera = 3125
Powitanie = 0
Do
If Powitanie = 0 Then
Cls : Lcd "Ladowanie orogramowania .";
Wait 1
Lcd ".";
Wait 1
Lcd ".";
Wait 1
Lcd ".";
Wait 1
Lcd ".";
Wait 1
Lcd ".";
Wait 1
Lcd "."
Wait 1
Cls : Lcd "Ladowanie zakonczone."
Wait 1
Cls : Lcd "Czestotliwość= " ; Czestotl
powitanie=1
End If
If Pind.0 = 0 Or Pind.1 = 0 Then
If Blokada = 0 Then
If Pind.0 = 0 Then
Waitms 20
If Pind.0 = 0 Then
Incr Czestotl
If Czestotl = 101 Then
Czestotl = 100
Blokada = 1
End If
End If
If Pind.1 = 0 Then
Waitms 20
If Pind.1 = 0 Then
Decr Czestotl
If Czestotl = 0 Then
Czestotl = 1
Blokada = 1
End If
End If
End If
If Pind.0 = 1 And Pind.1 = 1 Then
If Blokada = 1 Then Blokada = 0
Cls : Lcd "Czestotliwosc = " ; Czestotl
Do_zaokr = 31250 / Czestotl
Do_timera = Round(do_zaokr)
End If
Loop
End
Falownik:
Incr Odliczanie
If Odliczanie = Do_timera Then
If Ktorapol = 0 Then
Portd.3 = 1
Portd.2 = 0
Ktorapol = 1
End If
If Ktorapol = 1 Then
Portd.2 = 1
Portd.3 = 0
Ktorapol = 0
End If
Odliczanie = 0
End If
ReturnA to kody błędów:
Error:7 Line:74 IF THEN expected [74]
Error:123 Line:74 END IF expectedProszę o szybką odpowiedź. Z góry dziękuję.