S7TCP Driver

Observe these guidelines when importing the CODESYS controller tags into
FactoryTalk Optix Studio
.

Controller tags

You can load tags in the offline mode into
FactoryTalk Optix Studio
from these file types:
  • s7p
  • SDF
  • AWL

STEP7 data

The driver can import variables from the symbols file of the project (Merker, Input, Output) or variables defined in the Data Blocks (DB).
The importer creates variables in the Supervisor with the same name defined in the STEP7 project and assigns the physical address to the
I/O physical address
property of the variable.
NOTE: To import an
s7p
file successfully, the Communication driver requires the
AGLink40.DLL
file to be present in the Movicon installation directory.
The Communication driver does not support these STEP7 data types that you can find in the data exported to
s7p
files:
  • TIME
  • DATE
  • TIME_OF_DAY
  • DATE_AND_TIME
  • POINTER
  • ANY
The communication driver ignores the unsupported data.
Only one-dimensional arrays are managed. Multidimensional arrays are split in one-dimensional arrays. In this case, the name of each one-dimensional array is formed by the name of the multidimensional array and a progressive index.

Structures and User Data Types

If the structures used in a DB contain only members of basic data types (not strings, arrays, User Data Types (UDTs), or other structures), they are imported into the RealTimeDB of the Supervisor as structure type variables by creating their prototype structures.
If the structures and UDTs contain complex data types (such as arrays, strings, UDTs, or other structures), a variable structure is created (along with its template) and formed only by the contiguous simple data type elements. The rest of the structure or UDT is split into individual variables.
For example, assuming we have such a UDT:
TYPE UDT 1 STRUCT Var1 : BOOL; Var2 : WORD; Var3 : INT; Var4 : ARRAY [0 .. 6 ] OF BYTE; Var5 : INT; Var6 : BYTE; END_STRUCT ; END_TYPE
The importer creates a variable of the structure type (and its prototype) composed by members
Var1
,
Var2
,
Var3
and then it creates three additional variables: the array
UDT_1_Var4
, the Sign Word
UDT_1_Var5
, and
UDT_1_Var6
of a Byte type.
TIP: If you need to decrease the number of imported variables, you can try to create structures and UDTs with composed data types (array variable) in the final positions, after the simple data type (byte, word, and so on).

SDF and AWL data

The Communication driver does not support these data types that are present in the
SDF
and
AWL
files:
  • TIME
  • DATE
  • TIME_OF_DAY
  • DATE_AND_TIME
The Communication driver skips unsupported data. The bytes occupation of unsupported data types is taken into account to set the proper address for the following tags.
Take the following into consideration:
  • You can import UDT structures and arrays as Supervisor structures and arrays starting from version 10.1.0.9. This kind of data is represented in the tree with the
    +/-
    icons on their left. The icons enable you to expand or collapse them.
  • To import a structure or array as a Supervisor structure or array, select the collapsed structure and select
    Import
    . The corresponding prototype structure will be added to the Supervisor tags database.
  • To import the structure members as single tags, select the expanded structure and select
    Import
    .
  • If an UDT structure includes a string, it can only be imported as split in its members because the Supervisor does not manage fixed length strings.
  • Structures that are not UDT are imported as split in their members.
  • Arrays of basic types (Byte, signed/unsigned Word, signed/unsigned DWord, Float) are imported in the Supervisor as arrays of the corresponding basic type.
  • Arrays of Bits or Strings are not supported in the Supervisor. A tag is created in the Supervisor tags database for any array member.
  • Arrays of UDT are split in the corresponding UDT members.
  • Arrays of non-UDT structures can only be imported as split in their members.
  • The elements of arrays that are imported in the Supervisor always start from index 0.
  • S5TIME variables are imported as a Dword data type in the Supervisor but they are addressed as a word data type. These variables are managed as words on the controller, where value and time format are stored. When they are converted to be shown in the Supervisor (including milliseconds), they require a Dword data type.
  • STRING variables are imported keeping two bytes free before the starting address. For example, if 0 is the first free address, the string variable is addressed starting from byte 2 (DB1.DBB2:5 is a five characters string; bytes 2 to 7 are used for chars while two more bytes, byte 0 and 1, should be reserved for string management on the controller).
Tags from the Peripherals area are imported as:
  • Input
    type if the address is
    PE
  • Output
    type if the address is
    PA
  • Input/Output
    type if the address is
    P
SDF
file example:
“PumpON” “M33.4” “PumpStatus” “DB33.DBB46”
AWL
file example:
DATA_BLOCK DB 1 VERSION : 0.1 STRUCT Bit_Var : BOOL ; //bit tag Byte_Var : BYTE ; // byte tag Word_Var : WORD ; // word tag DWord_Var : DWORD ; // double word tag Int_Var : INT ; // integer tag DInt_Var : DINT ; // double int tag Real_Var : REAL ; // float tag S5Time_Var : S5TIME ; // s5 time tag Struct_Var : STRUCT // structure tag Bit_Var : BOOL ; Byte_Var : BYTE ; Word_Var : WORD ; DWord_Var : DWORD ; Int_Var : INT ; DInt_Var : DINT ; Real_Var : REAL ; S5Time_Var : S5TIME ; END_STRUCT ; END_STRUCT ; BEGIN Bit_Var := TRUE; Byte_Var := B#16#0; Word_Var := W#16#0; DWord_Var := DW#16#0; Int_Var := 0; DInt_Var := L#0; Real_Var := 0.000000e+000; S5Time_Var := S5T#0MS; Struct_Var.Bit_Var := FALSE; Struct_Var.Byte_Var := B#16#0; Struct_Var.Word_Var := W#16#0; Struct_Var.DWord_Var := DW#16#0; Struct_Var.Int_Var := 0; Struct_Var.DInt_Var := L#0; Struct_Var.Real_Var := 0.000000e+000; Struct_Var.S5Time_Var := S5T#0MS; END_DATA_BLOCK
The start address of each variable of the Data Block is automatically calculated by the import tool on the basis of the variable placement in the list, the data type, and the Step 7 addresses assignment method.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.