 |
plc.myforum.ro PLCs users www.plc.myforum.ro!
|
| View previous topic :: View next topic |
| Author |
Message |
valz Member 3


Joined: 26 Jul 2015 Posts: 771
|
Posted: 07/11/2023 18:32 Post subject: S7-1200/S7-1500 address specific areas in declared tags |
|
|
With the S7-1200/S7-1500 you can address specific areas in declared tags and access areas of the following widths: 1 bit, 8 bits, 16 bits and 32 bits.
https://support.industry.siemens.com/cs/document/57374718/
Description
In order to access tags of the data type Byte, Word or DWord you need
STEP 7 (TIA Portal) V11+SP1+Upd 2 (or higher) for S7-1200 (firmware V2.0 and higher).
STEP 7 (TIA Portal) V12 (or higher) for S7-1500.
The partitioning of a memory area (Byte or Word, for example) into a smaller memory area (Bool, for example) is also called memory slicing. Fig. 01 shows the symbolic bit, byte and word access to operands.
The following three networks contain the MOVE "Move value" instruction to transfer the contents of the operands of the inputs to the operands of the temporary variables.
Network 1 contains the instructions for bit-by-bit symbolic slice access.
The "X" stands for bit-by-bit access in the Word or Byte concerned and the number that follows specifies the offset of the Bit concerned.
When entering the variables, STEP 7 (TIA Portal) changes the syntax automatically. You do not need to enter the percent sign.
Network 2 shows an example of byte-by-byte slice access.
Here, the "b" stands for byte-by-byte access and the number that follows specifies the offset of the byte concerned.
Network 3 shows word-by-word slice access.
The "W" stands for word-by-word slice access and the number that follows specifies the offset of the word concerned.
You can address areas of a variable using slice access. Structures, constants and variables that overlap with AT cannot be addressed using slice accesses.
We will show you another example with bit-by-bit slice access for a data type conversion in the SCL programming language.
In the case of some technical applications you only need the first 4 or 6 bits (Bit 0 to Bit 3 or to Bit 5 respectively) of the byte tags for converting a value of the Byte data type to a value of the Real data type.
Here a binary number is converted into a decimal number (real number). The lowest bit of the byte has a value of 2-5. This is not about the decimal places, but rather the decimal value itself that is being calculated.
The first two instructions (slice accesses) set the bits not needed to the signal "False". Then, with the data type conversion, the change is made according to the value 2-5.
https://ulozto.net/file/qaSLLNW7RLzW/57374718-step7-v11-sliceaccess-en-mp4 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|