Lector drd.ing. TRAIAN TURC –”PETRU MAIOR “UNIVERSITY OF TG.MURES
Prof.dr.ing. GAVRIL TODEREAN –TECHNICAL UNIVERSITY OF CLUJ NAPOCA
Universitatea “Petru Maior” Tg.Mures
INTERNATIONAL CONFERENCE ON ECONOMICS, LAW and MANAGEMENT
ICELM-1 2004
5.1.3 TRANSMISIA ŞI AFIŞAREA DINAMICA A DATELOR ÎN PAGINI WEB
TRAIAN TURC– UNIVERSITATEA ”PETRU MAIOR“ - TG.MURES
Universitatea “Babeş Bolyai”
Facultatea de Ştiinţe Economice
Catedra de Informatica Economica
LUCRARILE SIMPOZIONULUI INTERNATIONAL
“SPECIALIZARE, DEZVOLTARE ŞI INTEGRARE” -2003
5.1.4 DATA ACQUISITION SYSTEM USING PARALLEL PORT OF THE COMPUTER
TRAIAN TURC –”PETRU MAIOR “ UNIVERSITY OF TG.MURES
GAVRIL TODEREAN –TECHNICAL UNIVERSITY OF CLUJ NAPOCA
Universitatea “Petru Maior” Tg.Mures
Facultatea de Inginerie
Catedra de Inginerie Tehnologică şi Managerială
Catedra de Inginerie Electrică
AGIR – Filiala Mureş
CONFERINŢA ŞTIINŢIFICĂ CU PARTICIPARE INTERNAŢIONALĂ
Inter-Ing 2003
Abstract:
A data acquisition system connected through parallel port of the personal computer can be easy attached to any personal computer.
With this system it is possible to develop several applications using different language programming(C, PASCAL and LABVIEW).
This work presents a data acquisition system connected to local CENTRONICS- parallel port of the personal computer. This system has digital inputs, analogical inputs and digital outputs.
The system can be programmed using different programming language like LABVIEW, C and Pascal.
DATA ACQUISITION THROUGH PARALLEL PORT
The data acquisition system that transfers data through serial port sends information to computer with a speed equal to serial port communication speed even if the speed of acquisition is faster.
In case we want to transfer a large quantity of data at high speed, serial transfer of data is inadequate. A better solution is using data acquisition through parallel port.
Figure 1
The parallel port has 8 bits data bus and a 9 bits commands bus is possible to make a faster data transfer.
This kind of data acquisition system connected through parallel port is showed in figure 1.
The data acquisition system can be an intelligent micro programmed system that works independently of computer or can be a simple interface using computer to make acquisition and data transfer.
If data acquisition system is a simple interface controlled by computer, the acquisition programs are only in computer, acquisition system is only an execution system. This kind of system is very simple, is cheaper and flexible.
Entire package of programs is on computer. The upgrade of programs, the improvement and maintenance of programs may be made only in computer.
The data acquisition system can’t work independently and this could be a main disadvantage.
This system is inadequate for data acquisition and control but it is suitable for data monitoring.
Figure 2
As we can see in figure 2, data acquisition system is controlled by the computer using 9 bits control bus of parallel port. Data are read through the 4 bits inputs ports. Outputs data uses the 8 bits data bus of parallel port. The acquisition speed depends on computer speed and the number of the connected analogical inputs.
To extend the number of the analogical inputs one must connect an analogical multiplexer controlled by AD1-AD4.
The system is used when a higher acquisition seed is necessary, faster than serial data acquisition speed.
Figure 3
The speed is slower than data acquisition systems connected to internal bus computer.
For the industrial systems the speed of parallel data acquisition system is acceptable. The major advantage is lower price and simplicity of connection to the computer. This system is proper for control and monitors a large range of industrial process.
T he screen of debit measurement application is showed in figure 4. The application is made using Pascal programming language.
Figure 4 Figure 5
A similar application (debit compute end measurement), but realized using LABVIEW is shown in figure 5. To run this application is necessary to have a computer with Windows operating system.
Reference:
[1.] Gh.Toderean - Microprocesoare Univ Tehnica Cluj 1994
[2.] Serban Lungu - Microcontrolere –Ed Comprex Cluj 1993
[3.] National Semiconductors National Data Acquisition Databook -1995
[4.] Traian Turc - Referat 2 doctorat - Sisteme de achiziţie şi prelucrare a datelor din procese industriale –îndrumător prof.dr.ing.Gavril Toderean
5.1.5 APLICAŢIA SPECIFICĂ REALIZATĂ PENTRU AUTOMATIZAREA ŞI MONITORIZAREA ELECTROCOMPRESOARELOR C260
;***************** P R O G R A M U L P R I N C I P A L *************
on_reset:
; SETARI
setb p3.3 ; invalidare tensiune relee
mov sp, #90H ; Iniţializare stack pointer
mov 08h,#24 ; Contor canal afişat
mov 18h,#0 ; Nr. porniri
mov 14h,#0 ; Timer T0
mov 09h,#0 ; Timer T1
mov 0ah,#0 ; Timer T2
mov 0bh,#0 ; Timer T3
mov 0ch,#0 ; Minute
mov 0dh,#0 ; Secunde
mov 0eh,#0 ; Zecimi
mov 0fh,#0 ; Cod maşina (pt PC)
mov 24h,#0 ; Stare 1
mov 25h,#0 ; Stare 2
mov 10h,#'E' ; Cod1 func "E"
mov 11h,#'L' ; Cod2 func "L"
mov 12h,#'C' ; Cod3 func "C"
mov 13h,#'*' ; Cod3 func "*"
mov 20h,#0h ; Resetez toate ieşirile
mov 21h,#0ffH
mov 22h,#0H
mov 23h,#0ffH
mov 26h,#0H
mov 27h,#0H
mov 28h,#0H
mov 29h,#0H
mov 2AH,#0H
mov 2BH,#0H
mov 2CH,#0H
mov 2DH,#0H
clr ri
call achiz
clr p3.3 ; validare tensiune relee
mov IP,#00000010B ; T0 high priority
mov IE,#10010010B ; validare TI or TD (Tr seriala)
; validare intr T0
; Oscillator frequency = 12 MHz
MOV TMOD,#00100001B ; Timer 0 C/T = 0, Mode = 1
; Timer 1 C/T = 0, Mode = 2
MOV TH1,#0F3H ; 2400 baud
SETB TR1 ; start baud rate
MOV SCON,#01110111B ; configurare port serial
ORL PCON,#80H ; Double rate (4800)
; Initializare parametrii
SETB TR0 ; start ceas
; ******************** E L C O *********************
start:
mov 26h,#0h ;Resetez toate ledurile
mov 27h,#0H
mov 28h,#0H
mov 29h,#0H
mov 2Ah,#0H
mov 2Bh,#0H
mov 2Ch,#0H
mov 2Dh,#0H
mov 0bh,#0H ;Reset Timer T3
mov 0ah,#0H ;Reset Timer T2
mov 20h,#0H ;Resetez toatre comenzile D_out1
mov 21h,#0FFH
mov 22h,#0H ;Resetez toatre comenzile D_out2
mov 23h,#0FFH
sjmp strt
alfa:
mov 25h,#0 ;Stare 2
;******************** E L C ********************************
strt:
mov a,0fh ;Verific blocare de la PC
cjne a,#20h,n_bl_pc
setb 26h.0 ;L1 flip
sjmp strt
n_bl_pc:
clr 26h.0 ;L1 nu flip
clr 27h.0
jnb 2Eh.0,ELC ;Astept B1=0 -Pregatire pornire
mov a,0fh ;Verific comanda Pornire de la PC
cjne a,#30h,nst_pc ;Reia daca nu s-a primit "PORNIRE"
mov 0fh,#00h ;Comanda primita si efectuata
sjmp ELC
nst_pc:
jb 25h.2,ELS_stt
jb 25h.3,ELS_stt
jnb 25h.4,ELS_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp ELS_tst
ELS_btst:
jnb 25h.6,ELS_tst_ies
ELS_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
ELS_tst_ies:
ljmp strt
ELS_stt:
setb 21h.3 ;Pompa inactiva
clr 20h.4 ;Lampa nu flip
setb 21h.4 ;Sting lampa
clr 20h.5 ;Hupa nu flip
setb 21h.5 ;Sting hupa C6 inactiv
mov 25h,#0 ;Stare 2
ljmp strt
ELC:
jnb 2Eh.0,$ ;Aştept relaxare buton start
mov 26h,#0h ;Resetez toate ledurile
mov 27h,#0H
mov 28h,#0H
mov 29h,#0H
mov 2Ah,#0H
mov 2Bh,#0H
mov 2Ch,#0H
mov 2Dh,#0H
clr 24h.0 ;Afişez T2 minute
mov 0ah,#0H ;Reset Timer T2 minute
mov 0bh,#0H ;Reset Timer T3 secunde
mov 20h,#0H ;Resetez toate comenzile D_out1
mov 21h,#0FFH
mov 22h,#0H ;Resetez toate comenzile D_out2
mov 23h,#0FFH
;******************** E L 0 ********************************
EL0_S:
clr 2ah.5 ;L22 nu flip
setb 2bh.5 ;L22 aprins
clr 2ah.6 ;L23 nu flip
setb 2bh.6 ;L23 aprins
mov 10h,#'E' ;Faza de verif 0
mov 11h,#'L'
mov 12h,#'0'
EL0:
clr 25h.5 ;Şterg semnalizare
jnb 2fh.5,C14
setb 23h.5 ;C14 inactiv
sjmp nu_C14
C14:
clr 23h.5 ;C14 activ
nu_C14:
mov a,18h
cjne a,#3,EL0_cmp
EL0_cmp:
jc EL0_con
setb 26h.4 ;L5 flip
mov 0ah,#240 ;T2 240 minute
clr 24h.0 ;Afişez T2
;mov 0bh,#55 ;T3 55 sec
;setb 24h.0 ;Afişez T3
mov 12h,#'W' ;Mesaj 'ELW'
call stp_ies
EL0_b:
mov a,0ah ;Timer T2 a ajuns la 240 min
;mov a,0ah ;Timer T3 a ajuns la 55 sec
cjne a,#00,EL0_b
mov 18h,#0 ;Iniţializez nr de porniri
clr 26h.4 ;L5 nu flip
clr 27h.4 ;L5 stins
ljmp alfa
EL0_con:
mov 12h,#'0' ;Mesaj 'ELW'
call L2_s
call L3_s
call L4_s
call L10_s
call sting_l
jb 25h.2,EL0_sbt
jb 25h.3,EL0_spc
jnb 25h.4,EL0_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp EL0_tst
EL0_btst:
jnb 25h.6,EL0_tst_ies
EL0_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL0_tst_ies:
jb 2eh.0,EL0_nub1
call delay5
cpl 2bh.6 ;Schimba starea lui L23
call delay5
call delay5
EL0_nub1:
jb 2eh.3,EL0_nub4
cpl 2bh.5 ;Schimba starea lui L22
call delay5
call delay5
EL0_nub4:
jb 25h.5,EL0_reb
ljmp EL1_S
EL0_sbt:
call stop_but
ljmp alfa
EL0_spc:
call stop_pc
ljmp alfa
EL0_reb:
ljmp EL0 ;Reia daca a fost cel putin o semnalizare
;******************** E L 1 ********************************
EL1_S:
clr 21h.3 ;C4 activ
setb 2dh.4 ;L29 aprins
clr 23h.0 ;C9 activ ****
setb 2dh.2 ;L27 aprins
clr 23h.1 ;C10 activ ***
setb 2dh.3 ;L28 aprins
setb 2dh.5 ;L30 aprins
;mov 0ah,#5 ;T2 5 minute
;clr 24h.0 ;Afişez T2
mov 0bh,#200 ;T3 200 sec
setb 24h.0 ;Afişez T3
mov 10h,#'E' ;Faza de verif 1
mov 11h,#'L'
mov 12h,#'1'
EL1:
clr 25h.5 ;Şterg semnalizare
call L2_s
call L3_s
call L4_s
call L6_sp
call L7_s
call L8_s
call L9_s
call L11_s
call L12_s
call L13_sp
call L14_sp
call L15_sp
call L16_sp
call L19_s
call sting_l
jb 25h.2,EL1_sbt
jb 25h.3,EL1_spc
jnb 25h.4,EL1_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp EL1_tst
EL1_btst:
jnb 25h.6,EL1_tst_ies
EL1_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL1_tst_ies:
jb 2eh.0,EL1_nub1
cpl 2bh.6 ;Schimba starea lui L23
call delay5
call delay5
EL1_nub1:
jb 2eh.3,EL1_nub4
cpl 2bh.5 ;Schimba starea lui L22
call delay5
call delay5
EL1_nub4:
jb 25h.5,EL1_reb
;mov a,0ah ;Timer T2 a ajuns la 5 min
mov a,0bh ;Timer T3 a ajuns la 240 sec
cjne a,#00,EL1_reb
ljmp EL2_S
EL1_sbt:
call stop_but
ljmp alfa
EL1_spc:
call stop_pc
ljmp alfa
EL1_reb:
ljmp EL1 ;Reia daca a fost cel putin
;o semnalizare sau T2<5min
;******************** E L 2 ********************************
EL2_S:
setb 23h.5 ;C14 inactiv
setb 23h.0 ;C9 inactiv ****
clr 2dh.3 ;L28 stins
mov 0bh,#100 ;T3 100 sec
setb 24h.0 ;Afişez T3
mov 10h,#'E' ;Faza de excitaţie 63.5v
mov 11h,#'L'
mov 12h,#'2'
EL2:
clr 25h.5 ;Şterg semnalizare
call L2_s
call L3_s
call L4_s
call L6_sp
call L7_s
call L8_s
call L9_s
call L11_s
call L12_s
call L13_sp
call L14_sp
call L15_sp
call L16_sp
call L19_s
call sting_l
jb 25h.2,EL2_fsbt
jb 25h.3,EL2_fspc
jnb 25h.4,EL2_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
jmp EL2_tst
EL2_fsbt:
jmp EL2_sbt
EL2_fspc:
jmp EL2_spc
EL2_btst:
jnb 25h.6,EL2_tst_ies
EL2_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL2_tst_ies:
jb 2eh.0,EL2_nub1
cpl 2bh.6 ;Schimba starea lui L23
call delay5
call delay5
EL2_nub1:
jb 2eh.3,EL2_nub4
cpl 2bh.5 ;Schimba starea lui L22
call delay5
call delay5
EL2_nub4:
jb 25h.5,EL2_S
; ***** Reglare excitatie la 30-80 v
clr 21h.0 ;C1 activ -EXCITATIE
setb 2dh.6 ;L31 aprins
mov a,#75 ;30 V
cjne a,47h,EX_cmp ;Compara cu val I24 de la 47h
EX_cmp:
jnc EX_up
mov a,#117 ;80 V
cjne a,47h,EX_cmp2 ;Compara cu val I24 de la 47h
EX_cmp2:
jnc EX_ok
setb 2Ah.3 ;L20 flip
clr 21h.1 ;C2 activ EX_DWN STROBE
call delay5
call delay5
setb 21h.1 ;C2 inactiv EX_DWN
call delay5
call delay5
sjmp EL2_T3
EX_up:
setb 2Ah.3 ;L20 flip
clr 21h.2 ;C3 activ EX_UP STROBE
call delay5
call delay5
setb 21h.2 ;C3 inactiv EX_DW
call delay5
call delay5
ljmp EL2_T3
Ex_ok:
clr 2Ah.3 ;L20 nu flip
clr 2Bh.3 ;L20 nu arde
setb 21h.1 ;C2 inactiv EX_DWN
setb 21h.2 ;C3 inactiv EX_DWN
setb 21h.0 ;C1 inactiv -EXCITATIE
ljmp EL3_S
EL2_T3:
mov a,0bh ;Timer T3 a ajuns la 100 sec
cjne a,#00,EL2_reb
EL2_ava:
clr 2ah.3 ;L20 nu flip
setb 2bh.3 ;L20 aprins
call stop_ava
ljmp alfa
EL2_sbt:
call stop_but
ljmp alfa
EL2_spc:
call stop_pc
ljmp alfa
EL2_reb:
ljmp EL2 ;Reia daca a fost cel puţin o semnalizare
jb 25h.5,el2_reb
EL3_S:
setb 21h.0 ;C1 inactiv
clr 2dh.6 ;L31 nu flip
clr 2ch.6 ;L31 stins
setb 21h.1 ;C2 inactiv
setb 21h.2 ;C3 inactiv
setb 2ch.0 ;L25 flip
setb 20h.4 ;Lampa nu flip
setb 20h.5 ;Hupa nu flip
mov 0bh,#15 ;T3 15 sec
setb 24h.0 ;Afisez T3
mov 10h,#'E'
mov 11h,#'L'
mov 12h,#'3'
EL3:
clr 25h.5 ;Şterg semnalizare
call L2_s
call L3_s
call L4_s
call L6_sp
call L7_s
call L8_s
call L9_s
call L11_s
call L12_s
call L13_sp
call L14_sp
call L15_sp
call L16_sp
call L19_s
call L20_sp
call sting_l
jb 25h.2,EL3_sbt
jb 25h.3,EL3_spc
jnb 25h.4,EL3_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp EL3_tst
EL3_btst:
jnb 25h.6,EL3_tst_ies
EL3_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL3_tst_ies:
jb 2eh.0,EL3_nub1
cpl 2bh.6 ;Schimba starea lui L23
call delay5
call delay5
EL3_nub1:
jb 2eh.3,EL3_nub4
cpl 2bh.5 ;Schimba starea lui L22
call delay5
call delay5
EL3_nub4:
jb 25h.5,EL3_sem
mov a,0bh ;Timer T3 a ajuns la 15 sec
cjne a,#00,EL3_reb
jnb 2bh.5,EL3_reb ;Demaraj automat
ljmp EL4_S
EL3_sbt:
call stop_but
ljmp alfa
EL3_spc:
call stop_pc
ljmp alfa
EL3_reb:
ljmp EL3 ;Reia daca a fost cel putin
;o semnalizare sau T3<15sec
EL3_sem:
clr 2ch.0 ;L25 nu flip
clr 2dh.0 ;L25 stins
clr 20h.4 ;Lampa nu flip
setb 21h.4 ;Lampa inactiva
clr 20h.5 ;Hupa nu flip
setb 21h.5 ;Hupa inactiva
ljmp EL2_S
EL4_S:
setb 21h.0 ;C1 inactiv
clr 2dh.6 ;L31 stins
call delay2s5
clr 21h.6 ;C7 activ ****
setb 2dh.7 ;L32 aprins
mov 14h,#41 ;Init T0 cu 41 zecimi=3s
mov 10h,#'E' ;Faza de excitaţie 63.5v
mov 11h,#'L'
mov 12h,#'4'
EL4:
jb 25h.2,EL4_sbt
jb 25h.3,EL4_spc
clr 21h.6 ;C7 activ ****
setb 2dh.7 ;L32 aprins
mov a,14h ;Timer T0 a ajuns la 3 sec
cjne a,#00,EL4
clr 21h.0 ;C1 activ EXCIT
setb 21h.6 ;C7 inactiv ****
ljmp EL5_S
EL4_sbt:
setb 21h.6 ;C7 inactiv ****
clr 2dh.7 ;L32 stins
call stop_but
ljmp alfa
EL4_spc:
setb 21h.6 ;C7 inactiv ****
clr 2dh.7 ;L32 stins
call stop_pc
ljmp alfa
EL5_S:
inc 18h ;incr nr de porniri
clr 21h.0 ;C1 activ
setb 2dh.6 ;L31 aprins
clr 2ch.0 ;L25 nu flip
clr 2dh.0 ;L25 stins
clr 2bh.5 ;L22 stins
clr 20h.4 ;Lampa nu flip
setb 21h.4 ;Lampa inactiva
clr 20h.5 ;Hupa nu flip
setb 21h.5 ;Hupa inactiva
mov 0bh,#60 ;T3 60 sec
setb 24h.0 ;Afişez T3
clr 24h.1 ;Semafor A
clr 24h.2 ;Semafor B
mov 25h,#0 ;Stare 1
call delay5
call delay5
call delay5
call delay5
beta:
mov 10h,#'E'
mov 11h,#'L'
mov 12h,#'5'
EL5:
clr 25h.5 ;Şterg semnalizare
call L2_s
call L2_p
call L3_s
call L4_s
call L6_s
call L6_p
call L7_s
call L7_p
call L8_s
call L8_p
call L9_s
call L9_p
call L11_s
call L11_p
call L12_s
call L12_p
call L13_s
call L13_p
call L14_s
call L14_p
call L15_s
call L15_p
call L16_s
call L16_p
call L17_s
call L18_s
call L19_s
call L19_p
call L20_sp
call L20_p
call L21_s
call L21_p
call sting_l
jb 25h.1,EL5_ava
jb 25h.2,EL5_sbt
jb 25h.3,EL5_spc
jnb 25h.4,EL5_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp EL5_tst
EL5_btst:
jnb 25h.6,EL5_tst_ies
EL5_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL5_tst_ies:
jb 2eh.0,EL5_nub4
cpl 2bh.6 ;Schimba starea lui L23
call delay5
call delay5
EL5_nub4:
Jb 24h.1,EL5_tmp ;Semafor A
jb 25h.5,EL5_sem
;***** Verific P ulei rampa > 2.0 bar
mov a,#65 ;2.0 bar
cjne a,34h,EL5_cmp ;Compara cu val I5 de la 34h
EL5_cmp:
jc EL5_mare
setb 2ch.4 ;L29 flip
sjmp EL5_reb
EL5_mare:
setb 21h.3 ;C4 inactiv
clr 2ch.4 ;L29 nu flip
clr 2dh.4 ;L29 stins
setb 24h.1 ;Semafor A
EL5_tmp:
mov a,0bh ;Timer T3 a ajuns la 30 sec
cjne a,#00,EL5_reb
setb 2ch.1 ;L26 flip
;setb 2dh.1 ;L26 arde
ljmp EL6_S
EL5_ava:
call stop_ava
ljmp alfa
EL5_sem:
mov 0bh,#60 ;T3 60 sec
ljmp EL5
EL5_sbt:
call stop_but
ljmp alfa
EL5_spc:
call stop_pc
ljmp alfa
EL5_reb:
ljmp EL5 ;Reia daca a fost cel puţin
;o semnalizare sau T3<30sec
j_beta: ;Invalidare Hupa C6
clr 2ch.1 ;L26 nu flip
setb 2dh.1 ;L26 arde
setb 23h.4 ;C13 inactiv
clr 20h.4 ;Lampa nu flip
setb 21h.4 ;Lampa avarie inactiva
clr 20h.5 ;Hupa nu flip
setb 21h.5 ;Hupa inactiva
ljmp beta
EL6_S:
mov 10h,#'E'
mov 11h,#'L'
mov 12h,#'6'
EL6:
jnb 2bh.6,j_beta ;L23?
setb 2ch.1 ;L26 flip
setb 20h.4 ;Lampa flip
setb 20h.5 ;Hupa flip
clr 23h.4 ;C13 activ
;***** Verific I2-I1 > 1 bar (anulat)
sjmp EL6_mare ;anulare I2-I1
mov a,31h ;I2
subb a,30h ;I2-I1
jnc p_EL6
cpl a
p_EL6:
;1 bar diferenţa=3biti
cjne a,#3,EL6_cmp ;Compara cu 1 bar
EL6_cmp:
jnc EL6_mare
ljmp beta
EL6_mare:
clr 23h.4 ;Strobe C13
call delay5
setb 23h.4
call delay5
call delay5
jb 2fh.4,Func_s ;b13 ?
setb 2bh.6 ;L23 stins
ljmp beta
FUNC_s:
mov 10h,#'F' ;Faza de trecere in functionare
mov 11h,#'U'
mov 12h,#'N'
clr 2bh.6 ;L23 stins
clr 2ch.1 ;L26 nu flip
clr 2dh.1 ;L26 stins
clr 20h.4 ;Lampa nu flip
setb 21h.4 ;Lampa inactiva
clr 20h.5 ;Hupa nu flip
setb 21h.5 ;Hupa inactiva
setb 23h.4 ;C13 inactiv
mov 25h,#0 ;Stare 1
clr 24h.2 ;Semafor B
mov 0bh,#100 ;T3 100 sec pt excitaţie
EL7:
clr 25h.5 ;Şterg semnalizare
call sting_l
call L2_p
call L3_s
call L4_s
call L4_p
call L6_s
call L6_p
call L7_s
call L7_p
call L8_s
call L8_p
call L9_s
call L9_p
call L11_s
call L11_p
call L12_s
call L12_p
call L13_s
call L13_p
call L14_s
call L14_p
call L15_s
call L15_p
call L16_s
call L16_p
call L17_s
call L18_s
call L19_s
call L19_p
call L20_sp
call L20_p
call L21_s
call L21_p
gama:
jb 25h.2,EL7_sbt
jb 25h.3,EL7_spc
jb 25h.1,EL7_ava ;Avarie
jnb 25h.4,EL7_btst
mov 0fh,#00h ;Comanda primita si efectuata
clr 25h.4
sjmp EL7_tst
EL7_btst:
jnb 25h.6,EL7_tst_ies
EL7_tst:
call test_l
clr 25h.4
clr 25h.6
call delay5
EL7_tst_ies:
jb 25h.5,EL7_reb ;Semnalizare
Jb 24h.2,EL7_reb ;Semafor B
;**************** Reglare excitaţie la 30-80 v**********************
setb 24h.0 ;Afişez T3
mov a,#75 ;30 V
cjne a,47h,EXF_cmp ;Compara cu val I24 de la 47h
EXF_cmp:
jnc EXF_up
mov a,#117 ;80 V
cjne a,47h,EXF_cmp2 ;Compara cu val I24 de la 47h
EXF_cmp2:
jnc EXF_ok
clr 21h.1 ;C2 activ EX_DWN STROBE
call delay5
call delay5
setb 21h.1 ;C2 inactiv EX_DWN
call delay5
call delay5
sjmp EL7_T3
EXF_up:
clr 21h.2 ;C3 activ EX_UP
call delay5
setb 21h.2 ;C3 inactiv EX_DWN
call delay5
ljmp EL7_T3
EXF_ok:
setb 21h.1 ;C2 inactiv EX_DWN
setb 21h.2 ;C3 inactiv EX_DWN
setb 24h.2 ;Semafor B
mov 0bh,#0 ;S-a reglat deja excitatia
sjmp EL7_reb
EL7_T3:
mov a,0bh ;Timer T3 a ajuns la 100 sec
cjne a,#00,EL7_reb
clr 2ah.3 ;L20 nu flip
setb 2bh.3 ;L20 aprins
sjmp EL7_ava
EL7_ava:
call stop_ava
ljmp alfa
EL7_sbt:
call stop_but
ljmp alfa
EL7_spc:
call stop_pc
ljmp alfa
EL7_reb:
ljmp EL7
END
Dostları ilə paylaş: |