Object
|
Description
|
|
---|---|---|
%MW0.0
|
Transmission demand of the request
|
|
%M20
|
Request in progress
|
|
%MW100:10
|
Reception buffer
|
|
%MW200:203
|
Report zone:
|
|
%MW200
|
Session and activity bit number (X0)
|
|
%MW201
|
Error code
|
|
%MW202
|
Time-out in units of 100 ms
|
|
%M30
|
Bit set to 1 after a successful exchange
|
|
%MW204
|
Counter of requests sent
|
|
%MW205
|
Counter of good requests
|
|
%MW206
|
Counter of bad requests
|
|
%MW207
|
Error code of the last bad request
|
!(*Read of the bits %M0 to %M8 from the Nano at address 37 *)
IF %MW0.0 AND NOT %M20 THEN
%MW200:4:=0;%MW202:=50;SET %M20;
READ_VAR(ADDR('0.0.0.37'),'%M',0,8,%MW200:4,%MW100:10);
(*8 bits %M0..%M7 are read in the slave 37 and placed in the %MW100 word of the master*)
END_IF;
!(*Analysis of the results*)
IF %M20 AND NOT %MW200.0 THEN
INC %MW204;RESET %M20;RESET %MW0.0;
IF %MW201=0 THEN INC %MW205;SET %M30;
ELSE INC %MW206;%MW207:=%MW201;RESET %M30;
END_IF;