show the entry list
STEP 7 (TIA Portal) -- Creating S7 programs -- Executing operations
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) V11?
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) V11?
How can you determine the bit position of an active bit in a marker word with STEP 7 V11 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) V11?
How in STEP 7 V11 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 in V11?
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?
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. Note also the following restrictions in this case:

  • The tags can be overlapped in S7-1200 if the modules of the S7-1200 have firmware version V2.0 (or higher).
  • With the modules of S7-300/400 it is only possible to overlap tags in S7-SCL.
  • You need at least STEP 7 V11.0+SP1+Update 2 (or higher).
  • It is only possible to overlap tags in the interface of code blocks with standard access.
  • It is no longer possible to change the "Optimized block access" attribute after creating a new block.
  • It is possible to overlap tags from all types of code block and all declaration segments (Input, Output, InOut, Static, Temp).
  • Overlapping tags must be equal or less than the overlapped tag and may be used in the block like any other tag.
  • You cannot overlap tags of the VARIANT data type.


Fig. 01

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 In the Temp area of 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".
2 Mark the line with the tag to be overlapped and right-click.
3 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.
4 Enter the name of the tag in the added line.
  • For example: "t_bool".
5 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.
6 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".
7 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_V11_AT_KeyWord.zip" file into a separate directory and then start the file with a double-click. The STEP 7 TIA Portal V11 project is now unpacked automatically with all the associated subdirectories. You can then use STEP 7 TIA Portal V11 to open and process the extracted project.

STEP7_V11_AT_KeyWord.zip ( 2962 KB )  

Creation environment
The download in FAQ entry was created with the Totally Integrated Automation Portal V11 SP1.

 Entry ID:57132240   Date:2011-12-13 
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