The Festo_EasyIP.lib library
12
1.5.2 Sending telegrams
In the following example, a flag (operand type 1) is increased by 1 during each cycle and sent to the
remote station with the short address 0 (IP = 192.168.0.2). The flag is located at the address %MW500
and is written to the address %MW520 of the remote station. The communication status is written to flag
word %MW600.
Example: Sending a telegram - EasySend (PRG-ST)
PROGRAM EasySend
VAR
Flag AT %MW500: WORD; (*flag variable *)
CommStatus AT %MW600: WORD; (*communication status *)
FunctionStatus: WORD; (*return value from Easy_SR function*)
END_VAR
Flag:= Flag +1; (*increase flag by 1 *)
FunctionStatus := Easy_S(0,1,1,500,520,600),
(*send 1 flag word from the address %MW500 to the address %MW520 of the remote
station *)
1.5.3 Requesting telegrams
When requesting values that will be written to the input area, a pointer is always required because writing
to inputs from the application is not permitted. In the example, an input value from the address %IW2 of
the remote station is requested and written to the input word %IW10. Make sure that an I/O module does
not occupy the input word %IW10 in the control configuration.
Example: Requesting a telegram - EasyRecv (PRG-ST)
PROGRAM EasyRecv
VAR
pInput: POINTER TO WORD; (*pointer variable*)
CommStatus AT %MW600: WORD; (*communication status*)
FunctionStatus: WORD; (*return value from Easy_SR function *)
END_VAR
pInput := 20; (*add offset of 20 bytes in the input area =
IW10*)
pInput^ := pInput^ +1; (* increase the content of pInput by 1 *)
FunctionStatus := Easy_R(0,2,1,10,2,600);
(*request 1 input word from address %IW2 of the remote station and write it to
the local address %IW10 *)
Sending and requesting in a single telegram
This function allows you to send data to a remote station and request data from a remote station at the
same time. When requesting values that will be written to the input area, a pointer is always required
because the IEC does not allow writing to inputs from the application. In the example, an input value from
the address %IW2 of the remote station is requested and written to the input word %IW10. Make sure that
an I/O module does not occupy the input word %IW10 in the control configuration. At the same time, the
output word %QW3 is written to the output word %QW10 of the remote station. The communication status
is written to the flag word %MW600.
Example: Sending and requesting a telegram - EasySendRecv (PRG-ST)
PROGRAM EasySendRecv
VAR
pInput: POINTER TO WORD; (*pointer variable*)
Output AT %QW3: WORD; (* analogue output defined in control
configuration *)
CommStatus AT %MW600: WORD; (*communication status*)
FunctionStatus: WORD; (*return value from Easy_SR function *)
END_VAR
pInput := 20; (*add offset of 20 bytes in the input area =
IW10*)
pInput^ := pInput^ +1; (* increase the content of pInput by 1 *)
FunctionStatus := Easy_SR(0,3,1,3,10,2,1,10,2,600);
Содержание CECX-X-C1 Series
Страница 1: ...Manual Controller Modular CECX CECX X C1 CECX X M1 761886 1112c en ...
Страница 2: ...1112c en ...
Страница 4: ......
Страница 6: ...1112c en ...
Страница 7: ...CECX modular control system CECX modular control system ...
Страница 46: ...CECX modular control system CECX I 38 ...
Страница 47: ...System manual CECX ...
Страница 48: ...CECX II ...
Страница 56: ...Content System Manual CECX VIII ...
Страница 58: ...System manual CECX Product design CECX II 0 2 ...
Страница 68: ...System manual CECX Safety notes CECX II 2 6 ...
Страница 76: ...System manual CECX System overview CECX II 3 8 ...
Страница 84: ...System manual CECX General assembly and installation instructions CECX II 4 8 ...
Страница 118: ...System manual CECX Operating behavior CECX II 8 6 ...
Страница 122: ...System manual CECX Disposal CECX II 10 2 ...
Страница 124: ...System manual CECX Technical data CECX II 11 2 ...
Страница 166: ......
Страница 180: ......
Страница 212: ......
Страница 219: ...System manual CECX Digital input output module CECX D 6E8A PN 2 CECX II 18 7 18 4 2 3 Connection diagram Input diagram ...
Страница 232: ......
Страница 248: ......
Страница 260: ......
Страница 278: ......
Страница 294: ......
Страница 308: ......
Страница 412: ......
Страница 426: ......
Страница 500: ...System manual CECX Bus link module CECX B CO CECX II 34 64 ...
Страница 501: ...The library Ethernet lib The library Ethernet lib ...
Страница 505: ...The library EventData lib The library EventData lib ...
Страница 511: ...The library IncEnc lib The library IncEnc lib ...
Страница 517: ...The Festo_EasyIP lib library ...
Страница 532: ......
Страница 535: ...The library PLCService lib The library PLCService lib ...
Страница 542: ...The library PLCService lib CECX VII 6 ...
Страница 543: ...The library SysLibComEx lib The library SysLibComEx lib ...
Страница 547: ...The Festo_Motion lib library ...
Страница 584: ......
Страница 585: ...The Festo_PartDetector lib library ...
Страница 601: ...FED VipWin interface ...
Страница 630: ......