5/12/2024 6:58 AM | |
Joined: 3/30/2020 Last visit: 6/13/2024 Posts: 4596 Rating: (954)
|
The "struck" you refer to is probably "struct" which is short for 'structure'. A structure can also be replaced by a UDT. Copy from one structure to another structure can sometimes give trouble even if the two structures looks identical. Using UDT ensures these are identical. It is possible to use a UDT to inputs / outputs in the tag table. This structures the inputs / outputs to structures of your choosing without needing user code. This is the primary option to consider when working with networked (Profinet / Profibus / ..) devices. -- Back to your actual question. The answer would depend on the PLC you use. The BLKMOV instruction is available to the S7-300 / S7-400 / S7-1500. The PEEK / POKE instruction set is available to the S7-1200 and S7-1500. You will need to use SCL or STL coding to use the instructions. You are able to add SCL / STL networks between LAD / FBD networks so there is no need to change all the coding to SCL / STL. Do note that STL is not available in the S7-1200. The data handled by the PEEK / POKE needs to be unoptimized. I / Q / M are great candidates but DBs needs to be set to unoptimized. PEEK / POKE are bit to bit copying. It is vital to check the memory footprint when a structure / UDT is being used. Structures works with byte / word boundary rules. -- Working with bytes instead of words as source would deliver another option: DESERIALIZE. An array of bytes can be converted to a structure / UDT. There is then the way to copy from one data structure (source) to another data structure (destination) by doing the following:
Watch the video presented here: [LINK: Copy memory areas and structured data in TIA Portal]. Note that there are 3 examples. You wish to focus on example 2 which starts around the 2minute mark. -- The final option is using the AT overlay. This is a topic on its own and is beyond the scope of this response. Best to read about this powerful method in the manual of the processor. |
Activities of this user is voluntary. There is no obligation or liability placed on this user. Though optional, your 'please' and 'thank you' is highly valued. |
|
This contribution was helpful to1 thankful Users |
Follow us on