ST (Structured text) - . , , , . ST SFC.
() . EZS . supl_prj , . supl_prj . supl_prj supl_prj.
ISaGRAF .
ISaGRAF Workbench . ISaGRAF. - ISAWIN. , :
ISaGRAF
APL | ISaGRAF
,
| ||
COM |
| ||
EXE | ISaGRAF | ||
LIB | IsaGRAF:
- - - | ||
LIB\IOC | / | ||
LIB\FNC | , IEC | ||
LIB\FBL | , IEC | ||
LIB\SRC | |||
LIB\DEFS | |||
LIB\RELS | |||
LIB\DEV | є
makefiles, .. | ||
TMP | : TMP ISaGRAF . |
. , WS001
ISA.ini, EXE. WS001:
Isa | ISaGRAF | ||
IsaExe | ISaGRAF | ||
IsaApl | ISaGRAF | ||
IsaTmp | |||
IsaSrc | |||
IsaDefs |
, IsaTmp , OBJS, RELS DATA .
WS001 ISaGRAF:
;file c:\ISAWIN\EXE\ISA.ini
[WS001]
Isa=c:\isawin
IsaExe=c:\isawin\exe
IsaApl=c:\isawin\apl
IsaTmp=c:\isawin\tmp
IsaSrc=c:\isawin\lib\src
IsaDefs=c:\isawin\lib\defs
є ISaGRAF, \ISAWIN\LIB\DEV
: , , .. \ISAWIN\LIB\RELS
, є , ISaGRAF є , LINK.
"" , .
"" "" . ISaGRAF. . . , . "" "" . . , "" , , . , . "" "" . , . :8
,
" " "" .
. .
DEL . / , DEL. , , .
/ , /
. . . .
/ . , , ST IL.
/ , . , .
/ . , ASCII .
ISaGRAF . , , .
:
LD FBD
/
:
( /)
( /)
( )
TRUE FALSE - , . , , , . , , , , , .
SFCSFC , . SFC . :
SFC: SFC .
SFC:........ .
SFC: .
SFC: () , .
ISaGRAF , , CJ International. :
:bcd, scale
:abs, acos, ArCreate, ArRead, ArWrite, ascii, asin, atan, char, cos, delete, expt, find, insert, left, limit, log, max, mid, min, mlen, mod, mux4, mux8, odd, rand, replace, right, rol, ror, sel, shl, shr, sin, sqrt, tan, trunc
:average, blink, cmp, ctd, ctu, ctud, derivate, f_trig, hyster, integral, lim_alrm, r_trig, rs, sema, sr, stackint, tof, ton, tp
, , C ISaGRAF. . , , Windows . ISaGRAF , , , :
, null . , ( ).
C , . .
:
FC"" . . , . "" :
"" () . , "" .
FC"" . . , "" ( ), "" . , . "":
"" () . "" ( ). "" , , .
FC, . . :
.
FC
, . . "" :
. ST, LD IL. , , .
FC. . ST, LD IL, "YES", "NO". :
. - , . ( - ), . . , .
. .
. :
( )
BEGIN
SEQUENTIAL
END
( )
Begin End . . Sequential . . Begin . Sequential SFC SFC. SFC. .
. - , . , . .
/ ISaGRAF ISaGRAF /. / :
/
/
/
ISaGRAF /, / , /, , .
/ / ISaGRAF ( ). / , . / , . / :
<><><_>_<_>
/:
I .
O
/:
X .
D .
M
/:
IX0_7 .. - 0 - 7
QD2 _4 - 2 - 4
/ / , /.
- . . :
'THIS IS A MESSAGE'
THIS IS A MESSAGE
: -. - . 255 , .
- :
'' (* *)
$:
ASCII
(hexa) | |||||||
$$ | '$' | 16#24 | 'I paid $$5 for this' | ||||
$' | 16#27 | 'Enter $'Y$' for YES' | |||||
$L | 16#0a | 'next $L line' | |||||
$R | 16#0d | ' llo $R He' | |||||
$N | 16#0d0a | 'This is a line$N' | |||||
$P | 16#0c | 'lastline $P first line' | |||||
$T | 16#09 | 'name$Tsize$Tdate' | |||||
$hh (*) | 16#hh | 'ABCD = $41$42$43$44' |
(*)hh - ASCII .
. .
:
IN MSG
NbC INT ,
IN
Q MSG IN ( = NbC)
NbC < 0
IN NbC > IN
:
. .
(*FBD LEFT RIGHT*)
(* ST : *)
complete_string := RIGHT ('12345678', 4) + LEFT ('12345678', 4);
(* - '56781234'
RIGHT - '5678'
LEFT - '1234'
*)
(* IL : LEFT *)
LD '12345678'
LEFT 4
ST sub_string (* *)
LD '12345678'
RIGHT 4
ADD sub_string
ST complete_string
:
H REAL
X REAL :
L REAL
EPS REAL ( )
QH BOO : TRUE X
H
Q BOO : TRUE X
QL BOO : TRUE X
L
:
.
. , , , EPS.
:
:
MIN INT
IN INT
MAX INT
Q INT
:
. .
(*FBD LIMIT*)
(* ST : *)
new_value := LIMIT (min_value, value, max_value);
(* [min_value..max_value] *)
(* IL : *)
LD min_value
LIMIT value, max_value
ST new_value
:
IN REAL
Q REAL ( 10)
:
( 10) .
(*FBD LOG*)
(* ST : *)
xpos := ABS (xval);
xlog := LOG (xpos);
(* IL : *)
LD xval
ABS
ST xpos
LOG
ST xlog
:
TRUE 1
FALSE 0
true false , , .
, , . . , BOOLEAN.
(* FBD *)
(* ST : *)
output1 := input1 AND NOT (input2);
- . SFC . SFC . :
, , - .
. . ( ). ( ). .
:
, SFC .
:
(* SFC *)
(* *) (* *)
ISaGRAF , true false, ST. . :
YES is TRUE
PI is 3.14159
OK is (auto_mode AND NOT (alarm))
,
ST . :
If OK Then
angle := PI / 2.0;
isdone := YES;
End_if;
(LOCAL) , (GLOBAL) (COMMON).
.
.
.
, .
:
ST , . :
: ܠ is FALSE
ܠ is TRUE
: ܠ is TRUE
:
- 16
-
- ,
:
, , :
PI is 3.14159
PI2 is PI*2:
PI2 is 6.28318
:
IN1 INT
IN2 INT ( REAL)
Q INT
:
.
(*FBD MIN MAX*)
(* ST : *)
new_value := MAX (MIN (max_value, value), min_value);
(* [min_value..max_value] *)
(* IL : *)
LD max_value
MIN value
MAX min_value
ST new_value
: . , "Goto" .
: <labelname>:
: <labelname>
ISaGRAF: 16 , , , . , ":".
: , . ISaGRAF
: (* *)
loop:
PrintTime
Wait 1s
Goto loop
:
IN MSG
NbC INT ,
IN
Pos INT
Pos
( 1)
Q MSG IN ( = NbC)
:
. .
(*FBD MID*)
(* ST : *)
sub_string := MID ('abcdefgh', 2, 4);
(* - 'de' *)
(* IL : *)
LD 'abcdefgh'
MID 2,4
ST sub_string
:
IN INT
IN2 INT ( REAL)
Q INT
:
.
(*FBD MIN MAX*)
(* ST : *)
new_value := MAX (MIN (max_value, value), min_value);
(* [min_value..max_value] *)
(* IL : *)
LD max_value
MIN value
MAX min_value
ST new_value
:
IN MSG
NbC INT IN
:
.
(*FBD MLEN*)
(* ST : *)
nbchar := MLEN (complete_string);
If (nbchar < 3) Then Return; End_if;
prefix := LEFT (complete_string, 3);
(* 3 prefix 3 *)
(* IL : *)
LD complete_string
MLEN
ST nbchar
LT 3
RETC
LD complete_string
LEFT 3
ST prefix
. . .
, . - (OR) .
(* *)
(* (v1 OR v2 OR v3) *)
,
. .
(* *)
(* ST : *)
output1 := input1;
output2 := input1;
. - (OR) .
(* *)
(* ST : *)
output1 := input1 OR input2;
output2 := input1 OR input2;
output3 := input1 OR input2;
:
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
:
IN BOO-INT-REAL
Q MSG false true IN -
, IN -
:
.
(*FBD MSG*)
(* ST : *)
bres := MSG (true); (* bres 'TRUE' *)
ares := MSG (125); (* ares '125' *)
(* IL : *)
LD true
MSG
ST bres
LD 125
MSG
ST ares
:
SEL INT ( [0..3])
IN1..IN4 INT
Q INT = value1 if SEL = 0
= value2 if SEL = 1
= value3 if SEL = 2
= value4 if SEL = 3
= 0
:
4 : .
(*FBD MUX4*)
(* ST : *)
range := MUX4 (choice, 1, 10, 100, 1000);
(* 4 , , - 1, 10 *)
(* IL : *)
LD choice
MUX4 1,10,100,1000
ST range
㬥:
SEL INT 楫 ᥫ ( [0..7])
IN1..IN8 INT 楫 稭
Q INT = value1 if SEL = 0
= value2 if SEL = 1
...
= value8 if selector = 7
= 0 㣨 祭 ᥫ
ᠭ:
⨯ 8 室: 롨ࠥ 쬨 楫 ᥫ.
(*FBD ਬ "MUX8"*)
(* ST : *)
range := MUX8 (choice, 1, 5, 10, 50, 100, 500, 1000, 5000);
(* 롨ࠥ 8 ।। 祭, ਬ, ࠭ 3, 祭 㤥 50 *)
(* IL : *)
LD choice
MUX8 1,5,10,50,100,500,1000,5000
ST range
. , ( ), ( ) .
, . :
-
- ( )
-
-
-
-
-
-
-
-
- /
-
-
-
-
-
-
-
" / ". , ISaGRAF .
/ /
. , .
/ , , .
/ , . ( ) .
, , . . .
- ST IL, , . :
ACTION (N) :
(* ST *)
END_ACTION ;
:
:
:
IN INT-REAL
Q INT-REAL
:
.
(*FBD *)
(* ST : *)
ao23 := - (ai10);
ro100 := - (ri1 + ri2);
(* IL : *)
LD ai10
MUL -1
ST ao23
LD ri1
ADD ri2
MUL -1.0
ST ro100
ISaGRAF, , . . .
ISaGRAF . , .
. . , , .
- , /. ISaGRAF . %.
. s - . c - .
%IXs.c.............
%IDs.c.............
%ISs.c.............
%QXs.c.............
%QDs.c.............
%QSs.c.............
. s - . b - . c - .
%IXs.b.c.........
%IDs.b.c.........
%ISs.b.c.........
%QXs.b.c.........
%QDs.b.c.........
%QSs.b.c.........
:
%QX1.6 6- 1 ( )
%ID2.1.7 7-1 1 2 ( )
A .
:
IN INT
Q INT 32 IN
:
.
(*FBD NOT_MASK*)
(*ST : *)
result := NOT_MASK (16#1234);
(* result is 16#FFFF_EDCB *)
(* IL : *)
LD 16#1234
NOT_MASK
ST result
" / ", . , , :
, "0", "1".
: , , , .
, . .
. :
ISaGRAF , , .
: , , .
ISaGRAF / , , . . ASCII , Windows . . ASCII, Windows . . , , .
. :
. . .
ASCII Windows. . ASCII . .
. . , .
. . . - MS-DOS 0d-0a. .
.
ISaGRAF DDE ( ) . (an advise loop) ISaGRAF , ISaGRAF .
advise poke DDE ISaGRAF. request , . DDE , execute . , , . . :
Service name: ISaGRAF
Topic name:.. ISaGRAF
Item name:
, , , :
variable_name(program_name)
DDE ISaGRAF ISaGRAF, . 256 ISaGRAF. DDE , ISaGRAF , . - , ISaGRAF .
, , / . . / .
, :
. , .
:
, ISaGRAF.INI .
: -s. 1 255, 13 ($0D). . , , . , , .
1 ISaGRAF.INI.
:
WISAKER.EXE -s=2
: ISaGRAF NT Options/Slave
(Up, Down) . ISaGRAF.
: -tISaGRAF Ethernet . -t. , COM1, COM2, COM3 COM4 , 1100, Ethernet.
: 1100 Ethernet COM1 - ISaGRAF.INI.
: Ethernet.
:
WISAKER -t=COM2
WISAKER -t=1101
:
, -t=COMx
:
baud | 600 | ||||
1200 | |||||
2400 | |||||
4800 | |||||
9600 | |||||
19200 | |||||
parity | n | ||||
e | |||||
o | |||||
data | 7 8 | ||||
stop | 1 2 | ||||
flow | h | ||||
n |
ISaGRAF. SFC, FBD, LD, ST IL.
, ISaGRAF . , C , , C . ISaGRAF, .
"C", "C", ISaGRAF . PLC, .
, , - . , , (, ) .
ISaGRAFISaGRAF C . , C , - , .
ISaGRAF , C ST/FBD . ISaGRAF , C , . ISaGRAF .
CISaGRAF "C" . "C", ISaGRAF, "C" ISaGRAF.
:
IN INT
Q BOO TRUE
FALSE
:
: - .
(*FBD ODD*)
(* ST : *)
If Not (ODD (value)) Then Return; End_if;
value := value + 1;
(* *)
(* IL : *)
LD value
ODD
RETNC
LD value
ADD 1
ST value
- . . - . , , SFC, . .
:
, , . , . :
(* SFC *)
, ISaGRAF workbench. , - ( ), ISaGRAF ( , ). - , .
:젠
255 ,
蠠 20
, Workbench,
:: 젠
8 ⠠
ࠠ 8 ⠠
16 ⠠ +60
ࠠ 16 ⠠
255 +60
16 ⠠
16 ⠠
/ . (lib) 8 ⠠ C,
C
IEC
(lib)16 C,
C
ꥪ |
ᨬ |
砭 |
᪨ ६ |
65535 |
|
६ |
65535 |
㯯 楫 ⢥ ६ |
|
65535 |
|
६ ᮮ饭 |
65535 |
|
। |
4095 |
⮬ ᯨ᪥ (⮬ ) |
। |
255 |
ᯮ㥬 ⮩ ணࠬ |
८ࠧ |
127 |
ᯮ㥬 ਫ |
窨 ⠡ |
32 |
। ⮩ ᠬ ⠡ ८ࠧ |
ꥪ |
ᨬ |
砭 |
㭪樨 ( IEC) |
255 |
⠭ ⥪ |
㭪樮 ( IEC) |
255 |
⠭ ⥪ |
㭪樨 |
255 |
⠭ ⥪ |
㭪樮 |
255 |
⠭ ⥪ |
㭪樮 |
4095 |
⮣ ⨯ 㭪樮쭮 ⮬ ਫ |
室 ࠬ 㭪樨 |
31 |
ਬ 㭪 㭪, ᠭ 몥 IEC |
ࠬ 㭪樮쭮 |
32 |
। 室묨 室묨 ࠬࠬ. 襩 ॡ 1 室 ࠬ |
㭪 ८ࠧ |
128 |
⠭ ⥪ |
䨣樨 / |
255 |
⠭ ⥪ |
/ |
255 |
⠭ ⥪ |
㤮 / |
255 |
⠭ ⥪ |
ࠬ |
16 |
. ISaGRAF, . . , .
( ) , . :
:................ .
:..................... . , .
:........ , ISaGRAF . .
:........ . , , Workbench
:.......................... .
:.............................. .
: .......... , .
:......................... - .
:
:.................. .
:....................... .
:........... , .
:........... , , .
. , .
. , .
" " .
" " , . SFC and FC, 2.
" "
, . SFC FC, 2 .
, , auto close ( ) . ISaGRAF.
.
, . , ISaGRAF.
ST IL, / , , .
, :
. . ( , )
.
- , workbench. - , , .
. , .
. , (, , , ). .
, . , . . / , .
/ , , , , .
/ . .
, / bitmap . LCD , , - - /. , / /. . , / . , , .ISaGRAF . "" .
, , , . , . . ISaGRAF ( ), . , .
.
:
" ", , . , , .
"", .
.
SFCSFC SFC 1 ( ), 2 SFC . , 1 2 .
,
: (1 2 , )
: , .
, . :
( ISaGRAF), , .
(1, 2, 3) . , . bitmap (.BMP). . .
FBD .
" / " , , . " " . "Document" .
"" , . Quick LD ." / " , ISaGRAF. ST IL, . , . ISaGRAF .
LD, , .
" / () " , . , . .
, , - . , Quick LD . - , : 16 . :
: :
short text short text
long text with no separator long text with n
short text: long description short text
. , . . " / " . :
Quick LD LD , . " / / ", . " " " / ", ISaGRAF , Quick LD.
: .
, ISaGRAF . - , , ISaGRAF, , .
"" , , . "".
, . >> . ISaGRAF 3 .
. , . ISaGRAF:
SIMULATE:........ ISaGRAF. , .
ISA86M:............. TIC (- ) ISaGRAF , Intel . .
ISA68M:............. TIC (- ) ISaGRAF , Motorola . .
SCC:................... ISaGRAF є, ISaGRAF .
CC86M:.............. ISaGRAF є, ISaGRAF .
ISaGRAF V3.23, "C" .
, ISaGRAF , PLC. ( , ) ISaGRAF (Workbench).
:
IO ANY
Funct INT
Arg INT /
Q INT
:
/.
OPERATE /. . /.
<RETURN > . . <RETURN > : TRUE, .
(* FBD RETURN *)
(* ST : *)
If auto_mode OR alarm Then
Return;
End_if;
bo67 := (bi10 AND bi23) OR x_cmd;
RETURN , . RETURN .
TRUE, , .
:
LD - , , .
(* ST : *)
If Not (manual_mode) Then RETURN; End_if;
result := (input1 OR input3) AND input2;