show the entry list
STEP 7 (TIA Portal) -- Creating S7 programs -- Executing operations
How is numerical integration for the S7-1200/1500 programmed in STEP 7 (TIA Portal)?
How do you standardize and destandardize analog values with STEP 7 (TIA Portal)?
How do you filter only the places before and after the decimal point from a real value in STEP 7 (TIA Portal) V11?
How do you calculate the linear values for the y-coordinate of point P in STEP 7 (TIA Portal) V11?
How can you add together physical flow measurements (mass flow rate, for example) to a total value in STEP 7 (TIA Portal)?
How do you implement numerical differentiation in STEP 7 (TIA Portal) V11?
How do you convert data types in the TIA Portal for the S7-1200/1500?
How can you convert a hexadecimal number into ASCII characters with STEP 7 (TIA Portal)?
How can you determine the bit position of an active bit in a marker word with STEP 7 (TIA Portal) and monitor a 32-bit field?
How can you delay the output signal in relation to the input signal in STEP 7 (TIA Portal) V11?
In STEP 7 (TIA Portal) V11, how can you scale integer values in real numbers and real values in integer numbers for analog measurements?
How do you copy memory areas in STEP 7 (TIA Portal)?
How in STEP 7 (TIA Portal) can you access the unstructured data types bit-by-bit, byte-by-byte or word-by-word and symbolically?
How do you program the overlapping of tags with the keyword "AT" in the TIA Portal V11?
How do you program a pulse encoder in STEP 7 (TIA Portal)?
How do you program a shift register with the LAD/FBD statements in STEP 7 V5.5 and STEP 7 (TIA-Portal)?
What properties do you have to watch out for in STEP 7 V11 when you are inserting characters into a string with the "INSERT" statement?
S7-1500 CPU 15xx -- Creating S7 programs -- Executing operations
How do you define a setpoint value with ramp function in STEP 7 (TIA Portal)?
How do you create (SCL) a hardware-independent clock in STEP 7 (TIA Portal)?
How do you program the overlapping of tags with the keyword "AT" in the TIA Portal V11?
Why is the negative time value of a variable of the "Time" or "LTime" data type set to 0 after being exported into a CSV file?
How can you use MOVE instructions also in STL?
How do you enable the ENO enable output of an instruction?
In STEP 7 (TIA Portal) V12, how do you initialize temporary variables of the String data type for the S7-1500?
What should you watch out for when using the status word?
S7-1200 CPU 12xx -- Creating S7 programs -- Executing operations
How do you define a setpoint value with ramp function in STEP 7 (TIA Portal)?
How do you program the overlapping of tags with the keyword "AT" in the TIA Portal V11?
How do you program the overlapping of tags with the keyword "AT" in the TIA Portal V11?
Part number:

Description
With the "AT" keyword you can overlap a declared tag with another declaration if, for example, you want to access the separate bits of a tag of the Word data type with an Array of Bool. The processing time of this configuration is significantly shorter than with the data type conversion in earlier versions of STEP 7.

You need the following to overlap tags with the keyword "AT".

  • S7-1200 at least STEP 7 (TIA Portal) V11.0+SP1+Update 2 (or higher) and the firmware version V2.0 (or higher).
  • S7-1500 at least STEP 7 (TIA Portal) V12 (or higher).

Note

  • In STL, LAD, FBD and GRAPH it is possible to overlap in S7-1200 and S7-1500.
  • In SCL it is possible to overlap in all CPU families.
  • It is possible to overlap tags in the following blocks:
    • In code blocks with standard access.

    • In code blocks with optimized access for tags with Retain setting set to "Set in IDB".

  • The data width of the overlapping tag must be equal to or less than the tag that is overlapped.
  • You cannot overlap the VARIANT and INSTANCE data types.
  • You cannot overlap blocks from libraries that are declared as parameters in the interface.
  • You cannot overlap structured PLC tags that are declared as parameters in the interface.

You program overlapping of tags in the block interface of a function or function block. Proceed as described in the table below to declare the tags.
 
No. Procedure
1 Create a function or function block. You have two methods of overlapping tags with the code word "AT" in the block interface:
  • Method 1
    In the block interface of the function block, for the tags to be overlapped you must select the option "Set in IDB" in the "Retain" column. However, this is not possible for the functions and for temporary tags.
  • Method 2
    Before the declaration of the tags you change the block access from "Optimized block access" to "Standard compatible".
  1. For this, in the project navigation you right-click the block and open "Properties..." in the pop-up menu.
  2. Go to the "Attributes" tab and disable the "Optimized block access" attribute (remove check mark).
  3. Save the settings with OK.


Fig. 01

2 Open the block and block interface.

Note
The description below refers to Method 1 for function blocks.

3 In the declaration table you enter first the tag that you wish to overlap with a new data type.
  • For example: Name: "t_word", data type: "Word".
4 Select the option "Set in IDB" from the drop-down menu of the "Retain" column.

Note
As described in Point 1, this option is not possible for functions and temporary tags. For this you must change the block access beforehand as in Method 2.

5 Mark the line with the tag to be overlapped and right-click.
6 In the pop-up menu that opens you select "Add Line". You must declare the overlapping tag in the line directly under the tag to be overlapped.
7 Enter the name of the tag in the added line.
  • For example: "t_bool".
8 In the "Data type" column you enter first just the letter "A" and wait until the window opens with the data types you can select.
9 In the drop-down menu you select the keyword "AT" and then click in the "Name" column. In addition to the name of the tag ("t_bool", for example) the keyword with the tag to be overlapped is also displayed in the same field.
  • In this example: AT "t_word".
10 Click again in the "Data type" field and enter the declaration for the array.
  • For example: "Array[0..15] of Bool".

Now the overlapping of the tags is completely declared and you can enter your program in the editor.


Fig. 02

With some applications, it might be necessary in STEP 7 to group multiple signals in one control word or extract separate signals from a control word. The "STEP7_V11_AT_KeyWord.zip" download attached includes a STEP 7 V11 program with which you can group signals (tags of the "Bool" data type) in a tag of the "Word" data type and extract them again. The following blocks are contained in the STEP 7 program:

Description of the "FC_Bool_to_Word_AT" function
You can use the "FC_Bool_to_Word_AT" function to group up to 16 bits in a word. The separate input tags of the Bool data type are assigned to the temporary "t_bool" array tag and overlapped with the keyword "AT" of the "t_word" tag. Then the content of the temporary "t_word" tag is transferred to the "SaveWord" output tag.


Fig. 03

Description of the "FC_Word_to_Bool_AT" function
Using the "FC_Word_to_Bool_AT" function you can extract up to 16 signals (tags of the "Bool" data type) from a tag of the "Word" data type. The content of the "I_Word" input tag is transferred to the temporary "t_word" tag and overlapped with the keyword "AT" of the declared "t_bool" tag. Then the separate bits of the "t_bool" array tag are assigned to the output tags of the Bool data type.


Fig. 04

These two functions are called and parameterized in OB1 "Main".

Download
Copy the "STEP7_(TIA_Portal)_AT_KeyWord.zip" file into a separate directory and then start the file with a double-click. The STEP 7 (TIA Portal) V12 project is now unpacked automatically with all the associated subdirectories. You can then use STEP 7 (TIA Portal) to open and process the extracted project.

STEP7_TIA_Portal_AT_KeyWord.zip ( 1440 KB )  

Creation environment
The screens and download in this FAQ response were created with STEP 7 (TIA Portal) V12+SP1.

 Entry ID:57132240   Date:2014-02-03 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour