-
Notifications
You must be signed in to change notification settings - Fork 0
Code Generator ‐ Configuration File Guide
The configuration file is a JSON file containing two types of data:
- the Sec Node structure (in the same format as the SEC Node would return in reply to a
describemessage) - extra PLC information (also referenced throughout the documentation as PLC-tooling data or
x-plcparameters) required by the code generator to generate PLC code, initialise the SEC Node correctly, and map process data to the SECoP layer correctly in real time
These two types of data live together in the same JSON tree. In other words, under each SECoP object, an extra x-plc object may be added to provide the additional PLC information required for that object.
The x-plc parameters exist at two levels:
-
SEC Node level:
(<node>).x-plc -
Module level:
(<module>).x-plc
This page documents all x-plc parameters currently supported by the SECoP PLC code generator.
Each parameter is described using the following fields:
- Type — data type as defined in the configuration model
- When it applies — conditions under which the parameter is relevant
- Purpose — what the parameter represents and why it is needed
- Example value — taken from the demo configuration file when available
- Where it is used and how — reference to the generated PLC code (PRG / FB) and how the parameter is used
For concrete examples, refer to the configuration file of the demo project
-
Type
string containing an IP address -
When it applies
Always -
Purpose
IP address used by the SEC Node TCP server. -
Example value
"192.168.1.10" -
Where it is used and how
Used in PRG SecopInit:
SECOP.GVL.G_st_SecNode.sTcpServerIp := '192.168.1.10';
-
Type
integer -
When it applies
Always -
Purpose
TCP server port used by the SEC Node. -
Example value
10767 -
Where it is used and how
Used in PRG SecopInit:
SECOP.GVL.G_st_SecNode.uiTcpServerPort := 10767;
-
Type
string containing a boolean expression -
When it applies
Always -
Purpose
PLC expression indicating whether the TCP interface is ready. -
Example value
"G_stStatusPlc.G_xEthReady_If2" -
Where it is used and how
Used in PRG SecopMapFromPlc:
SECOP.GVL.G_st_SecNode.xTcpServerInterfaceReady := G_stStatusPlc.G_xEthReady_If2;
-
Type
string -
When it applies
Always -
Purpose
SECoP protocol version used by the SEC Node, visible on the "describing" message -
Example value
"V2019-09-16" -
Where it is used and how
Used in PRG SecopInit:
SECOP.GVL.G_st_SecNode.sSecopVersion := 'V2019-09-16';
-
Type
Time string in Fractional Unix Time, like “1774003270.228” -
When it applies
Always -
Purpose
PLC timestamp used at SEC Node level. -
Example value
"G_stStatusPlc.sSecSinceJan1970Hr" -
Where it is used and how
Used in PRG SecopMapFromPlc:
SECOP.GVL.G_st_SecNode.sTimestamp := G_stStatusPlc.sSecSinceJan1970Hr;
-
Type
Time string in Fractional Unix Time, like “1774003270.228” -
When it applies
Always -
Purpose
Timestamp used at module level. Provide the best you can e.g. if the module data is retrieved from an OPC UA connection, use the timestamp provided by the OPC UA server. If you can't retrieve an accurate timestamp from the data source, just use the actual PLC time to provide it. -
Example value
"G_stStatusPlc.sSecSinceJan1970Hr" -
Where it is used and how
Used in PRG SecopMapFromPlc:
GVL_SecNode.G_st_mf.sTimestamp := G_stStatusPlc.sSecSinceJan1970Hr;
-
Type
string -
When it applies
Numeric or string modules -
Purpose
PLC expression to read the process value. Use format conversion functions if needed -
Example value
"REAL_TO_LREAL(G_rMf)" -
Where it is used and how
Used in PRG SecopMapFromPlc:
GVL_SecNode.G_st_mf.lrValue := REAL_TO_LREAL(G_rMf);
-
Type
string containing an enum tag -
When it applies
Enum modules -
Purpose
PLC variable containing enum state. -
Example value
"G_iHeatSwitchStatus" -
Where it is used and how
Used in PRG SecopMapFromPlc:CASE G_iHeatSwitchStatus OF0: GVL_SecNode.G_st_heatswitch.etValue := ET_Module_heatswitch_value.Off;1: GVL_SecNode.G_st_heatswitch.etValue := ET_Module_heatswitch_value.On;END_CASE
-
Type
same as parameter "value" -
When it applies
Numeric modules. Optional. Configure it if we need out of range errors to be generated. -
Purpose
Lower out-of-range setpoint. -
Example value
-25 -
Where it is used and how
Used in SecopInit:GVL_SecNode.G_st_mf.lrValueOutOfRangeL := -25;Used in module FB:
// Return "OutOfRange" errorIF (iq_lrValue < iq_lrValueOutOfRangeL OR iq_lrValue > iq_lrValueOutOfRangeH) THEN ...
-
Type
same as parameter "value" -
When it applies
Numeric modules. Optional. Configure if we need out of range errors to be generated. -
Purpose
Upper out-of-range setpoint. -
Example value
25 -
Where it is used and how
Used in SecopInit:GVL_SecNode.G_st_mf.lrValueOutOfRangeL := 25;Used in module FB:
// Return "OutOfRange" errorIF (iq_lrValue < iq_lrValueOutOfRangeL OR iq_lrValue > iq_lrValueOutOfRangeH) THEN ...
-
Type
string containing a boolean expression -
When it applies
When status DISABLED exists -
Purpose
Disabled condition. -
Example value
"G_xMfInMaintenance" -
Where it is used and how
Used in SecopMapFromPlc:IF G_xMfInMaintenance THEN ...
-
Type
string -
When it applies
When status DISABLED exists -
Purpose
Disabled description. -
Example value
"Cryomagnet in maintenance mode" -
Where it is used and how
Used in SecopMapFromPlc:GVL_SecNode.G_st_mf.stErrorReport.sDescription := 'Cryomagnet in maintenance mode';
-
Type
string containing a boolean expression -
When it applies
Optional -
Purpose
Communication error condition. -
Example value
"G_xTc1CommsError" -
Where it is used and how
Used in SecopMapFromPlc:IF G_xTc1CommsError THEN ...
-
Type
string -
When it applies
Optional -
Purpose
Communication error description. -
Example value
"Temperature controller 1 - Communication fault" -
Where it is used and how
Used in SecopMapFromPlc:GVL_SecNode.G_st_tc1.stErrorReport.sDescription := 'Temperature controller 1 - Communication fault';
-
Type
string containing a boolean expression -
When it applies
Optional -
Purpose
Hardware error condition. -
Example value
"G_xMfHwError" -
Where it is used and how
Used in SecopMapFromPlc:IF G_xMfHwError THEN ...
-
Type
string -
When it applies
Optional -
Purpose
Hardware error description. -
Example value
"Cryomagnet fault" -
Where it is used and how
Used in SecopMapFromPlc:GVL_SecNode.G_st_mf.stErrorReport.sDescription := 'Cryomagnet in maintenance mode';
-
Type
string containing an assignment statement -
When it applies
Numeric or String. Writable or Drivable. -
Purpose
Write TargetChangeNewVal to PLC process tag. -
Example value
"G_rMfSetpoint := LREAL_TO_REAL(GVL_SecNode.G_st_mf.lrTargetChangeNewVal)" -
Where it is used and how
Used in SecopMapToPlc:IF fbRtrigApplyTarget_mf.Q THENG_rMfSetpoint := LREAL_TO_REAL(GVL_SecNode.G_st_mf.lrTargetChangeNewVal);
-
Type
string containing an enum tag -
When it applies
Enum. Writable or Drivable. -
Purpose
Write TargetChangeNewVal to PLC process tag. -
Example value
"G_iHeatSwitchCmd" -
Where it is used and how
Used in SecopMapToPlc:IF fbRtrigApplyTarget_heatswitch.Q THENCASE GVL_SecNode.G_st_heatswitch.etTargetChangeNewVal OF` 0: G_iHeatSwitchCmd :=ET_Module_heatswitch_value.Off;` ` 1: G_iHeatSwitchCmd :=ET_Module_heatswitch_value.On;`END_CASE
-
Type
string containing a boolean expression -
When it applies
Writable or Drivable -
Purpose
Interlock condition for applying a new target value -
Example value
"NOT G_xEquipLockedInLocal AND G_xRemoteSecopEnabled" -
Where it is used and how
Used in SecopMapFromPlc:// Target change interlock
GVL_SecNode.G_st_mf.stTargetWrite.xPossible := NOT G_xEquipLockedInLocal AND G_xRemoteSecopEnabled;
-
Type
integer (number of seconds) -
When it applies
Drivable -
Purpose
Timeout for reaching target. -
Example value
300 -
Where it is used and how
Used in SecopInit:GVL_SecNode.G_st_mf.stTargetDrive.timTimeout := T#300S;
-
Type
numeric -
When it applies
Numeric Drivable -
Purpose
Target tolerance. -
Example value
0.1 -
Where it is used and how
Used in SecopInit:GVL_SecNode.G_st_mf.lrTargetDriveTolerance := 0.1;
-
Type
string containing PLC logic -
When it applies
When clear_errors exists. Optional -
Purpose
Extra PLC logic when clearing errors. -
Example value
"IF G_xRemoteSecopEnabled AND NOT G_xEquipLockedInLocal THEN G_xDefaultAck := TRUE; END_IF" -
Where it is used and how
Used in SecopMapToPlc:// Apply "clear_errors" commandIF GVL_SecNode.G_st_mf.xClearErrors THENGVL_SecNode.G_st_mf.stErrorReport.xActive := FALSE;GVL_SecNode.G_st_mf.stErrorReport.sClass := '';GVL_SecNode.G_st_mf.stErrorReport.sDescription := '';IF G_xRemoteSecopEnabled AND NOT G_xEquipLockedInLocal THEN G_xDefaultAck := TRUE; END_IFEND_IF
-
Type
string -
When it applies
Numeric or string customised parameter -
Purpose
Read custom parameter value -
Example value
"G_sTc1ChannelATempSensorId" -
Where it is used and how
Used in SecopMapFromPlc:// _sensorGVL_SecNode.G_st_tc1.s_Sensor := G_sTc1ChannelATempSensorId;
-
Type
string -
When it applies
Enum customised parameter -
Purpose
Enum mapping. -
Example value "plc_tag_for_enum_custom_param"
-
Where it is used and how Used in SecopMapFromPlc:
CASE plc_tag_for_enum_custom_param OFvalue0: GVL_SecNode.G_st_moduleclass.et_customparam := ET_Module_moduleclass_customparam.key0;value1: GVL_SecNode.G_st_moduleclass.et_customparam := ET_Module_moduleclass_customparam.key1;...END_CASE