ISaGRAF. Version 3.4

         

STACK


INT

Àðãóìåíòû:

PUSH                   BOO              êîìàíäà “PUSH” (íà ïåðåäíåì ôðîíòå)

                                                  äîáàâèòü çíà÷åíèå IN â âåðõóøêó ñòåêà

POP                     BOO              êîìàíäà “POP” (íà ïåðåäíåì ôðîíòå)

                                                  óäàëèòü èç âåðõóøêè ñòåêà ïîñëåäíåå ñîõðàíåííîå çíà÷åíèå

R1                        BOO              ñáðîñèòü ñòåê â ïóñòîå ñîñòîÿíèå

IN                         INT                 ñîõðàíÿåìîå çíà÷åíèå

N                          INT                 ðàçìåð ñòåêà îïðåäåëåííûé ïðèëîæåíèåì

EMPTY                BOO              TRUE åñëè ñòåê ïóñòîé

OFLO                   BOO              ïåðåïîëíåíèå: TRUE åñëè ñòåê ïåðåïîëíåí

OUT                     INT                 çíà÷åíèå â âåðõóøêå ñòåêà

Îïèñàíèå:

Óïðàâëÿåò ñòåêîì öåëûõ çíà÷åíèé.

Ôóíêöèîíàëüíûé áëîê “STACKINT” âêëþ÷àåò îïðåäåëåíèå ïåðåäíåãî ôðîíòà äëÿ êîìàíä PUSH è POP. Ìàêñèìàëüíûé ðàçìåð ñòåêà 128. Ðàçìåð ñòåêà îïðåäåëåííûé ïðèëîæåíèåì - N íå ìîæåò áûòü ìåíüøå 1 è áîëüøå 128.

Çàìåòèì, ÷òî çíà÷åíèå OFLO äåéñòâèòåëüíî òîëüêî ïîñëå ñáðîñà (R1 áûëî óñòàíîâëåíî â TRUE, ïî êðàéíåé ìåðå, îäíàæäû è îáðàòíî â FALSE)

(*FBD ïðèìåð áëîêîâ “STACKINT” : óïðàâëåíèå îøèáêàìè*)

(* ST Ýêâèâàëåíò: Ìû ïðåäïîëàãàåì, ÷òî STACKINT1 - ýòî ýêçåìïëÿð áëîêà STACKINT *)

STACKINT1(err_detect, acknoledge, manual_mode, err_code, max_err);

appli_alarm := auto_mode AND NOT(STACKINT1.EMPTY);

err_alarm := STACKINT1.OFLO;

last_error := STACKINT1.OUT;

(* IL Ýêâèâàëåíò: *)

LD                     err_detect

ST                     STACKINT1.push

LD                     acknoledge

ST                     STACKINT1.pop

LD                     manual_mode

ST                     STACKINT1.r1

LD                     err_code

ST                     STACKINT1.IN

LD                     max_err

ST                     STACKINT1.N

CAL                  STACKINT1

LD                     auto_mode

ANDN                STACKINT1.empty

ST                     appli_alarm

LD                     STACKINT1.OFLO

ST                     err_alarm

LD                     STACKINT1.OUT

ST                     last_error



Ñîäåðæàíèå ðàçäåëà