Instructions - Network Communication
Send Data
Description: Sends string messages or variable values to network devices
Instruction Name: SENDMSG
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number | int | [1-9] |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| sendChar | Character message to send | string | - |
| type | Send data is 94 in the enumeration sequence type | int | 94 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"ID": 7,
"logout": false,
"sendChar": "UUUUUU",
"type": 94,
"userParamInt": 0,
"userParamString": ""
}Parse Data
Description: This instruction is used to parse a set of data from an external device and store the data into multiple variables
Instruction Name: PARSEMSG
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number | int | [1-9] |
| clearCache | Whether to clear the buffer after parsing, 0: no, 1: yes | int | [0,1] |
| dataStorage | Records the count of extracted data; manual int type value 0 or int type variable, global or local; manual value 0 means not recording the count of extracted data | object | - |
| dataVariable | First storage position for queried data; int type or double type or string type variable, global or local | object | - |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| type | Parse data is 96 in the enumeration sequence type | int | 96 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"ID": 3,
"clearCache": 1,
"dataStorage": {
"data": 0.0,
"secondvalue": 0,
"value": 4,
"varname": "GI009"
},
"dataVariable": {
"data": 0.0,
"secondvalue": 1,
"value": 5,
"varname": "GD[GI001]"
},
"logout": false,
"type": 96,
"userParamInt": 0,
"userParamString": ""
}Read
Description: Reads points sent via Ethernet or Modbus communication and stores the points into variables
Instruction Name: READCOMM
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number | int | [1-9] |
| commType | Communication method, 0: ETHERNET communication, 1: MODBUS communication | int | [0,1] |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| m_varname | Point storage count; int type variable, global or local | string | - |
| positionId | First point storage variable; P: point local variable, GP: point global variable | string | - |
| type | Read is 110 in the enumeration sequence type | int | 110 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"ID": 6,
"commType": 1,
"logout": false,
"m_varname": "I001",
"positionId": "GP0001",
"type": 110,
"userParamInt": 0,
"userParamString": ""
}Open Data
Description: Opens network communication
Instruction Name: OPENMSG
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number connected during TCP communication | int | [1-9] |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| type | Read is 115 in the enumeration sequence type | int | 115 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"ID": 5,
"logout": false,
"type": 115,
"userParamInt": 0,
"userParamString": ""
}Close Data
Description: Closes network communication
Instruction Name: CLOSEMSG
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number connected during TCP communication | int | [1-9] |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| type | Close data is 116 in the enumeration sequence type | int | 116 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"ID": 7,
"logout": false,
"type": 116,
"userParamInt": 0,
"userParamString": ""
}Print Message
Description: Outputs defined message content by printing a prompt bar
Instruction Name: PRINTMSG
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| printChar | Output characters | string | - |
| printType | Output message type, 0: message, 1: warning, 2: error | int | [0,2] |
| type | Print message is 120 in the enumeration sequence type | int | 120 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
JSON Example:
{
"logout": false,
"printChar": "test message",
"printType": 2,
"type": 120,
"userParamInt": 0,
"userParamString": ""
}Get Message Connection Status
Description: Gets the connection status of a process number in the network settings
Instruction Name: MSG_CONNECTION_STATUS
| Parameter | Description | Type | Value Range |
|---|---|---|---|
| ID | Process number connected during TCP communication | int | [1-9] |
| logout | Whether commented out, true: this instruction will not be executed in the job file; false: not commented, executable | bool | - |
| type | Get message connection status is 95 in the enumeration sequence type | int | 95 |
| userParamInt | Customer custom in secondary development, currently no meaning | int | - |
| userParamString | Customer custom in secondary development, currently no meaning | string | - |
| variable | Status storage variable name; bool type variable, global or local | object | - |
JSON Example:
{
"ID": 5,
"logout": false,
"type": 95,
"userParamInt": 0,
"userParamString": "",
"variable": {
"data": 0.0,
"secondvalue": 1,
"value": 6,
"varname": "GB[GI001]"
}
}