12/10/2014 9:23 AM | |
Posts: 8946 Rating: (999) |
Nice! Perhaps some additionaltextually hints would be also helpful. |
This contribution was helpful to1 thankful Users |
12/10/2014 10:04 PM | |
Posts: 5225 Rating: (1198) |
Sorry for the tardiness. Even though it was not asked.. for the theoretical background there are two official FAQs to mention.. 1. About SLICING.. How in STEP 7 (TIA Portal) do you access the unstructured data types bit-by-bit, byte-by-byte or word-by-word and symbolically? 2. About AT OVERLAY.. How do you program the overlapping of tags with the keyword "AT" Now for some explaination about the attached JPEG.. Yellow block The example shown has been programmed on TIA V13 for the CPU1511. The LAD code shown has been coded in an FB. The code is being simulated - the simulated ONLINE status is shown in green. The same results can be achieved in S7-1200 PLCs with firmware beyond and including V2.0. Red block with arrow The Properties >> Atributes of FB 1 is shown. Non optimised variables block structure is used. The arroe shows towards the variables that is effected. Non-optimised structure was important for older generation PLCs (S7-1x00) to handle the AT OVERLAY. This is not a requirement of newer PLCs under TIA13 (ex. S7-1200 FW4). Double red block in variable decleration area Because a non-optimised structure is used, it is possible to see the byte offset position for each declared variable. Note that the Array declerations and overlay decleration shares the same memory space. THAT is what overlay is - two data type structures that share the same memory area. Blue block and arrows In Network 1 the SLICING method is used to set the least significant bit of the #value variable. The arrows shows (confirms) the bit that is on in the variable. Orange blocks and arrows The #b1 variable receives the value from #value as-is, with no modification. #b1 and #A1 is overlayed so that the bit in #A1 array can be read as indicated. Note that it is index = 24 (red arrow) that has the TRUE bit. This is unexpected - that is what the FAQs mentioned earlier is about and also why this image was added. Purple blocks and arrows For this case the bytes of #value are swapped and stored in #b2. The arrow shows the TRUE bit's position. Before the swap the byte position from left to right was b0, b1, b2, b3; after swap it becomes b3, b2, b1, b0 (see also TIA help for more). The bit that is read in the array format for #A2 is index = 0 as the red arrow indicates.That means the SWAP function is required to have the two methods work the same: #value.%X{index} <-----------------> #b2[ #index ] I hope this text is of value to someone. Greetings. w |
This contribution was helpful to6 thankful Users |
12/11/2014 7:58 AM | |
Posts: 8946 Rating: (999) |
Perhaps you can do a PDF, jpg together with text? Than it will be nice for trainig purposes! |
12/15/2014 2:09 PM | |
Joined: 9/3/2014 Last visit: 3/13/2019 Posts: 4766 Rating: (122) |
|
Follow us on