II Nhiiit do th\lc
B" diiu khiln PDf:
3.3.2. XuIi dau xuatinh:ip:
PLC thl!c hi¢n tn(lt chuang lrlnh thea thCr It! tom tat sau :
1. Quct de du li¢u nh~p kit hQP l~i voi mQl mic cua thang chLIcmg trinh.
2. Giili quyet hOi,1t dQng logic lien quan den cae dO' li¢u nMr cl6. 3. Thiet l~lr/ thiet l~p l<:J.i cae dD' li¢u xual cho nac thang d6.
4. Chuycn sang llik tiep thea va l~p l~i buoc 1.2.3.
5. Chuyen sang nac tiep thea va I~p l~i buac 1,2,3. 6. Chuyen sang nac tiep thea va l~p ll;l-i blIac 1.2.3.
eCr nhu v~y cho den nac cuoi cua thang. kit thue chuang trlnh.
Co hai phuang phap M: xu If dau xu<rt/nh~p: c~p nh~t lien t~c va sao chep
luqng Ian tin hi¢u xuat nh~p.
C¢p n!ujf lien rye:
CPU quet cac kenh nh~p khi chung XUlll hi¢n trong chi J¢nh chlwng trinh.
M6i diem vaa dlfQ'C phan 1fch rieng va lac dQng eua chung thuQc chuang ldnh
duqc xic u!nh. MQI lei hoffo (thuang khoang 3 ms) siS dlfqc cai khi thlfc hi¢n phan tich moi dau vao d6 dam baa rang chi cac tin hi¢u vao hQP I¢ dlfqc b¢ vi XLI If dQc. Slf tn~ nay cho phep b¢ vi xu Ii tdnh dem m¢t tin hi~u hai Ian. M(>t Iwmg dc tin hi¢u vao phili dLIqc quet, mdi tin hi¢u vao voi 3 ms tr~, twoc khi chlfCtng trlnh co chi I¢nh cho thlfc hi¢n m¢t hOl;lt d¢ng logic va xuat m(>t tfn hi¢u ra. Oic dau ra bj chat nhlf v~y, gill tn:mg thai ella chung cho den Ian c~p nh~t tiep theo.
Sao cliep hwng tin hi~lI xluJtlnh¢p:
Vi XLI Ii c~p nh~t lien tl,lc c6 3 ms tr~ doi voi moi dau vao nen thai gian de
phan tich cho hang nghin di~m nh~p/xuat co the trb nen kha dili. De thlfC hi¢n m¢t chuang tdnh nhanh hon, m¢t vling d1C bi¢t ella RAM duqc SLI dl,lng lilm vung IlIU d~m (buffer store) giua dieu khien logic va thie't b~ xuat/nh~p. Moi mQt
dau vao Ira, c6 m(>t dja chi trong b¢ nho nay. T<;ll bat dau moi chu ki chuang tdnh , CPU quel toan b¢ tin hi¢u vao va ehep tr<;lng thai cua chung vao cac dja chi nMp/xuat trong RAM. Khi thlfc hi¢n chuang trinh, du li¢u nh~p dJ ilIU duqc dQc tli RAM thea yeu diu va cac thao tic logic duqc thlfc hi¢n. Ket qua, cae tin hi¢u xuat duqc luu IQ.i vung nh~p/xuat cua RAM. Tl;Ii cuoi moi chu kl chuang
Cac dau xuat bi chot nhu v~y, chung giii tr~ng thai cua mlnh cho Wi Ian c~p nh~t tiep theo.