ISaGRAF. Version 3.4

         

MOD


Àðãóìåíòû:

IN                         INT                 ëþáàÿ çíàêîâàÿ öåëàÿ âåëè÷èíà

Base                   INT                 äîëæíà áûòü áîëüøå íóëÿ

Q                          INT                 âû÷èñëåíèå ìîäóëÿ (âõîä MOD áàçà)

                                                  âîçâðàùàåò -1 åñëè Base <= 0

Îïèñàíèå:

Âû÷èñëÿåò ìîäóëü öåëîãî çíà÷åíèÿ.

(*FBD ïðèìåð áëîêà “MOD”*)

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

division_result := (value / divider); (* öåëîå äåëåíèå *)

rest_of_division := MOD (value, divider); (* îñòàòîê îò äåëåíèÿ *)

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

LD                     value

DIV                    divider

ST                     division_result

LD                     value

MOD                  divider

ST                     rest_of_division



Ñîäåðæàíèå  Íàçàä  Âïåðåä