Cache block write
- Last UpdatedJul 29, 2024
- 1 minute read
BWC is a special item that caches the data before sending it to the PLC. The item syntax for the BWC item is:
BWC<R_ID>-<length>,<start_address>
The R_ID is the ID that is configured for the Block Write in the PLC. A caching buffer is created, based on R_ID and length as an index, inside the server whenever you advise the BWC item. The buffer is not created if one already exists for the same R_ID and length.
For example, you advise the following items: BWC10-60,50, BWC10-60,20, BWC10-60,0, BWC10-20,10 and BWC10-20,0. Only two buffers are created inside the server for these items:

Consider following scenarios:
-
You poke 20 bytes of data in item BWC10-60,0. Buffer-1 is filled from byte 0 to 19.
-
You poke 15 bytes of data in item BWC10-60,50. Buffer-1 is filled from byte 50 to 59. The last 5 bytes are truncated because only 10 bytes are available in that offset.
-
You poke 30 bytes of data in item BWC10-60,20. Buffer-1 is filled from byte 20 to 49.
-
You poke 20 bytes of data in item BWS10-20,0. Buffer-2 is filled from byte 0 to 19.
-
You poke 1 to item BWC10-20.Send. Buffer-2 is flushed to the PLC with byte 20.
-
You poke 1 to item BWC10-60.Send. Buffer-1 is flushed to the PLC with byte 60.