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?
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?
Part number:

Description
You use the "INSERT" statement to insert characters or character strings at input parameter "IN2" into the character string at input parameter "IN1". The results character string is displayed at the "OUT" output parameter in string format. You have to specify a value at parameter "P" to indicate the position of the character in the string from which you wish to insert the characters.


Fig. 01

You must watch out for the following conditions during the parameterization of the "INSERT" statement.

  • If the value at parameter "P" is greater than the character string at input parameter "IN1", the characters of input parameter "IN2" are appended after the last character of the character string of input parameter "IN1".


Fig. 02

  • If the value at parameter "P" is zero, the characters of the input parameter "IN2" are placed before the first character of the input parameter "IN1".


Fig. 03

  • If there is a negative value at parameter "P", a blank character string is also displayed at the "OUT" output parameter.


Fig. 04

  • If the results string is longer than the length of the string variable defined at the "OUT" output parameter, the string is limited to the available length.


Fig. 05

Example
You can also use the "INSERT" statement to copy string variables. Fig. 06 illustrates an example for transferring a five-character string in which one of the characters changes ("abcde" => "abxde").

  • Adapt the length of the string variable precisely to the length of the character string which you wish to transfer (for example, String[5]).
  • The character string at parameter "IN2" must be identical to the character string at parameter "IN1".
    • Delete the first character in the string at parameter "IN2" and
    • Change the character that you wish to exchange for the character string to be transferred (for example, "x").


Fig. 06

With the definition "P=1", the character string at parameter "IN2" is inserted behind the first character of the string at parameter "IN1", which would give the string the pattern "abxdebcde". However, as the string at the "OUT" parameter is defined as five characters in length, the string is limited to "abxde".


Fig. 07

Note
You can enter the character strings in the SIMATIC S7-1200 directly at the inputs "IN1" and "IN2" of the "INSERT" function. In the SIMATIC S7-300, you must parameterize the inputs with DB variables of the String data type.

 Entry ID:51783575   Date:2011-08-29 
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