P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
975
After a successful FB-5 call the writing can be done via the returned address of the FB 5 parameter ("VarToken")
with the help of FB3.
Call example 2
Read a GUD variable from channel 1 with the name "GUD_STRING" (type definition of the variables: STRING
with length 30 bytes). The user-defined variable should be converted in a 10-byte variable pointer for subsequent
writing with the FB 3.
Call and parameterization of FB 5 with instance DB 111:
U
I 7.7;
//Unassigned machine control panel key
S
M 100.0;
//Activate req.
U
M 100.1;
//Done completed message
R
M 100.0;
//Terminate job
U
I 7.6;
//Manual error acknowledgment
U
M 102.0;
//Error pending
R
M 100.0;
//Terminate job
CALL FB 5, DB 111 (
Req
:= M 100.0,
//Starting edge for reading
Area
:= B#16#2,
//Channel variable
Unit
:= B#16#1,
//Channel 1
Index1
:= 0,
//No field index
Index2
:= 0,
//No field index
CnvtToken
:= TRUE,
//Conversion into 10-byte token
VarToken :=
DB_GUDVAR.GUDVar1Token,
Error
:= M 102.0,
Done
:= M 100.1,
State
:= MW 104
RD
:= P#DB99.DBX0.0 DINT 1
// free memory area
);
CALL FB 3, DB 112 (
Req
:= M 200.0,
NumVar
:= 1,
//Write 1 GUD variable
Addr1 :=
DB_GUDVAR.GUDVar1Token,
Error
:= M 102.0,
Done
:= M 100.1,
State
:= MW 104
SD1
:= P#DB99.DBX0.0 DINT 1);
// Data block for GUD variable
DATA_BLOCK DB_GUDVAR
//Assignment to symbol table
STRUCT
GUDVarS : STRING[32] := 'GUD_STRING';
//Name is defined by user
GUDVarSToken :
Содержание SINUMERIK 828D Turning
Страница 34: ...Basic Functions 34 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 146: ...A3 Axis Monitoring Protection Zones 2 6 Data lists Basic Functions 146 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 328: ...F1 Travel to fixed stop 6 5 Data lists Basic Functions 328 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 816: ...K2 Axis Types Coordinate Systems Frames 10 9 Data lists Basic Functions 816 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1198: ...P4 PLC for SINUMERIK 828D 14 6 Function interface Basic Functions 1198 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1752: ...Appendix 20 2 Overview Basic Functions 1752 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1774: ...Glossary Basic Functions 1774 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...