Sample program
CP 243-1
Operating Instructions, 03/2012, C79000-G8976-C244-02
133
The read/write request is only possible after a positive edge at the "START" parameter,
when the "Done" bit of any preceding read request is set. The "Done" bit is transferred in the
"ch0_done_read" variable. The outputs of the read and write request are linked so that only
one request per channel can be processed at any one time. This means that a new request
is only initiated after the preceding request is completed.
The "Chan_ID" parameter specifies the number of the channel via which the data access will
take place. In the present case, this would be the channel with the number 0. The "Data"
parameter specifies the number of the channel-specific block of data. A request that has
been initiated could be stopped using the "Abort" parameter. To do this, the M7.0 memory bit
must be set. In this example, this memory bit also impacts the read request from Network 5.
After M7.0 is cleared, read/write requests are sent again since the "Done" bit is always set
along with the "Error" bit after a request is aborted.
Applying special memory bit SM0.0 ensures that the ETH0_XFR subroutine is always
enabled.
As soon as the write request is completed, a 1 is returned in the "Done" return parameter.
Any errors that occurred are transferred using by the "Error" parameter. Otherwise, a 0 is
returned in this parameter.
LD Always_On
=L60.0
LD ch0_done_read
EU
Uch0_ready
LD start
EU
OLD
=L63.7
LD L60.0
CALL ETH0_XFR, L63.7, Connection0_0, Write_1,
Connection_abort, ch0_done_write, ch0_error_write
Symbol
Address
Comment
Always_On
SM0.0
Due the system, always 1
ch0_done_read
M5.0
Done bit of the read request
ch0_done_write
M5.1
Done bit of the write request
ch0_error_write
MB14
Error memory bit of channel 0, "write"
request
ch0_ready
M8.0
Bit for channel 0 in the CH_READY
return value of the ETH0_CTRL
subroutine
Connection0_0
VB233
Connection_abort
M7.0
Transfer aborted
Содержание SIMATIC NET CP 243-1
Страница 6: ...Preface CP 243 1 6 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 10: ...Table of contents CP 243 1 10 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 104: ...Programming 4 5 ETHx_FTPC CP 243 1 104 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 118: ...Diagnostics 5 2 Error messages of the CP 243 1 CP 243 1 118 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 124: ...Certification CP 243 1 124 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 138: ...Sample program CP 243 1 138 Operating Instructions 03 2012 C79000 G8976 C244 02 ...
Страница 142: ...Index CP 243 1 142 Operating Instructions 03 2012 C79000 G8976 C244 02 ...