Equipment Connection Properties
When setting up an equipment connection through either ethernet or serial, there are various properties that can be configured.
|Equipment Name||The name to give this equipment connection.|
|Equipment Description||A description of this equipment connection.|
|Enabled||Whether the equipment connection is enabled or disabled. A disabled equipment connection will prevent communication between the Gateway and the equipment.||true|
|Device ID||A unique identifier of the equipment, which is defined by the equipment. Must be an integer.||0|
|Database Connection||The Database Connection that will be used to store messages in for audit purposes as well as some configuration data.|
|Database Table Prefix||The prefix that will be added to each of the database table names that get automatically setup when the connection is made. Used to help differentiate one equipment's tables from another equipment's tables. If no prefix is specified, then no prefix will be used.|
|SECS Definition Language (SDL) File||The file that validates SECS messages sent and received between the Gateway and the equipment. If none is specified, a default messages.sdl file is used. See SECS Definition Language (SDL) File for the default file.||messages.sdl|
|T3 Reply Timeout||The number of seconds to wait for an expected SECS message reply.||45|
Properties for equipment connections using the Ethernet/HSMS connection type, which connects to equipment using HSMS over TCP.
|Active IP Address||IP Address of the equipment to connect to when in Active mode.||localhost|
|Active Port||The Port number of the equipment to connect to when in Active mode, which must match the port number used to create the Simulator.||5000|
|Passive IP Address||The IP Address of Ignition that an Equipment will connect to if the SECS/GEM module is in passive mode.||localhost|
|Passive Port||The Port number that an Equipment will connect to if the SECS/GEM module is in passive mode.||5000|
The Method used to connect to Equipment.
|T5 Connect Separation Timeout||The number of seconds which must elapse between successive attempts to connect to the equipment after disconnection.||10|
|T6 Control Transaction Timeout|
The number of seconds which a control transaction (such as LinkTest or Select) may remain open before it is considered a communications failure.
|T7 Not Selected Timeout||The number of seconds which a TCP/IP connection can remain in NOT SELECTED state (i.e. no HSMS activity) before it is considered a communications failure. This timeout is only used for Passive Connection Mode.||10|
|T8 Network Intercharacter Timeout||The maximum number of seconds between successive bytes of a single HSMS message before it is considered a communications failure. This applies to HSMS messages received from the equipment.||5|
|Keep Alive Timeout||The number of seconds interval for sending LinkTest control messages for testing a connection. Automatically reconnects if the test fails. A value of 0 will disable it.||300|
Properties for equipment connections using the Serial/SECS-I connection type, which connects to equipment serially using SECS-I.
|Serial Port Name||The name of the serial port, e.g. "COM1" or "/dev/ttyS0".||COM1|
|Data Bit Rate|
The bit rate of data that is being sent and received. Possible values are:
|T1 Inter-Character Timeout||The maximum number of seconds allowed for interruptions between characters being sent.||0.5|
|T2 Protocol Timeout||The maximum number of seconds for a lack of protocol response.||10|
|T4 Inter-Block Timeout||The maximum number of seconds allowed for interruptions in multi-block messages.||45|
|Retry Limit||The maximum number of send retries allowed.||3|
Regardless of the type of equipment connection, database tables are created for each connection based on the prefix specified in the connection if they do not already exist.
No automatic maintenance (such as pruning or partitioning) is performed on these tables. Some of the tables can grow quite large, so it is up to the user to properly manage each set of tables from each equipment connection.
The SECSGEM_EquipmentInfo table is unique in that only one will get created for all databases that use the same database connection and will not use a prefix in its name. Each row of the SECSGEM_EquipmentInfo table contains information about a specific Equipment Connection.
|String||The name of the equipment|
|The prefix that the equipment connection uses for its unique tables.|
|The status of the equipment connection.|
|The SDL File that was uploaded for this equipment connection. If no file was uploaded, it will use the default messages.sdl.|
The Messages table is where SECS messages are stored after they are sent or received. It will include a prefix in the name if one was specified in the equipment connection. Multiple equipment connections can use the same prefix which will have them write to the same messages table. Because this table records every message between the Gateway and equipment, it can grow quite large.
Auto incrementing PrimaryID, Integer
|The ID of the row.|
|The name of the equipment.|
|The Stream and Function such as "S1F1".|
|Whether the message was received or sent.|
|Whether the message was a request or a response.|
|A special identifier that will link together multiple related messages.|
The transaction ID of the message.
|Whether the message expects a reply or not.|
|The JSON string message.|
|A datetime value of when the message was sent or received.|
Any errors that occur are logged to the Errors table. It will include a prefix in the name if one was specified in the equipment connection. Multiple equipment connections can use the same prefix which will have them write to the same errors table.
Auto incrementing PrimaryID, Integer
|The ID of the row.|
|The name of the equipment.|
|The Stream and Function such as "S1F1". Only used if the error is related to a SECS Message|
|The type of error that occurred, such as Connection Error, Timeout, or JSON Syntax Error.|
|The error message.|
|The date and time when the error occurred.|
Creating an Equipment Connection
In order to communicate with an equipment or the built-in simulator, an Equipment Connection must be configured in the Gateway. This example walks you through configuring an equipment connection for a piece of equipment.
- Go to the Configure section of the Gateway webpage and select SECS/GEM > Equipment.
- On the Equipment Connections page, click on Create new Equipment Connection...
- On the Add Equipment Connection Step 1: Choose Type page, select Ethernet/HSMS Connection, and click Next.
- On the Equipment Connection page:
- Equipment Name - enter equipment name, (i.e., EquipOne).
- Enabled - set to 'true'. Enables communication to the target equipment.
- Active IP Address - use the default of localhost, or enter the IP address of equipment to connect to when in Active mode.
- Active Port - set the port number (i.e., 5007). The Active and Passive port numbers must be unique for each piece of equipment. Note, the Active Port must match the port number used in the equipment or simulator configuration setup.
- Passive IP Address - use the default of localhost, or enter the IP address of the equipment to connect to when in Passive mode.
- Passive Port - set the port number (i.e., 5007). The Active and Passive port numbers must be unique for each piece of equipment. Note, the Passive Port must match the port number used in the equipment or simulator configuration setup.
- Connection Mode - the default is set to Active. The Connection Mode is a property that is configured in both the Simulator and Equipment Connection settings, and cannot be set to the same method. Alternating mode can be used, in which case, it will switch between Active and Passive modes until a connection is made.
- Device ID - enter an equipment ID (i.e.1). Each piece of equipment must have a unique ID.
- Database Connection - enter the database that will be used to send and receive data (i.e, SecsGem).
- Database Table Prefix - enter a prefix to prepend to the database table names. (i.e.,EquipOne_). A prefix will be prepended to each of the database table names that are automatically setup when the connection is made. This is an optional setting, so if no prefix is specified, the table will still get created. The advantage of using a prefix is it helps keep database tables organized, and used to differentiate one equipment's tables from another equipment's tables. It also allows you to filter a project based on the prefix.
- SECS Definition Language (SDL) File - the default file is messages.sdl. Validates sent and recieved messages.
- Once all the configuration settings are entered, click on the Create new Equipment Connection. The window will refresh showing a status of "Connecting" until the equipment connection is created. When the status changes to "Communicating", the Equipment Connection is successfully created.