IO.SetConfigurationParameters

Driver Modicon Modbus

IO.SetConfigurationParameters

Top  Previous  Next

Type of Tag

Block Tag

Type of Access

Read-Only

B1 Parameter

-1

B2 Parameter

0

B3 Parameter

0

B4 Parameter

3

Size Property

2

ParamItem Property

IO.SetConfigurationParameters

 

Use this Tag to change any property of Driver's configuration dialog box at run time (the complete list of properties can be found on the specific topic of each Interface).

This Tag works only while a Driver is in Offline mode. To start a Driver in Offline mode, select the Start driver OFFLINE option on Driver's configuration dialog box. Users can write to a PLC Tag or to a Block Tag containing the parameters to change (writings of individual Block Elements are not supported, the whole Block must be written at once).

In Elipse SCADA, users must use a Block Tag. Every parameter to configure uses two Block Elements. For example, if users want to configure three parameters, then the size of the Block must be 6 (3 * 2). The first Element is the property's name (as a String) and the second Element is the property's value. Check this script in Elipse SCADA:

// 'Block' must be a Block Tag with automatic reading, // scan reading, and automatic writing disabled.
// Configure all parameters
Block.element001 = "IO.Type" // Parameter 1
Block.element002 = "Serial"
Block.element003 = "IO.Serial.Port" // Parameter 2
Block.element004 = 1
Block.element005 = "IO.serial.BaudRate" // Parameter 3
Block.element006 = 19200
// Writes the whole Block
Block.Write()

 

When using E3, the ability to create arrays at run time allows using an I/O Tag as well as a Block Tag. Users can use Driver's Write method to send all parameters to the Driver, without creating a Tag. Check these examples:

Dim arr(6)
' Configure all array elements
arr(1) = "IO.Type"
arr(2) = "Serial"
arr(3) = "IO.Serial.Port"
arr(4) = 1
arr(5) = "IO.serial.BaudRate"
arr(6) = 19200
' There are two methods to send parameters
' Method 1: Using an I/O Tag
tag.WriteEx arr
' Method 2: Without using a Tag
Driver.Write -1, 0, 0, 3, arr

 

A variation of the previous example uses a bidimensional array:

Dim arr(10)
' Configure all array elements. Notice the array was resized
' to 10 elements. Empty elements of the array are ignored by the Driver.
arr(1) = Array("IO.Type", "Serial")
arr(2) = Array("IO.Serial.Port", 1)
arr(3) = Array("IO.serial.BaudRate", 19200)
Driver.Write -1, 0, 0, 3, arr

 

A Driver does not validate parameter names or passed values, therefore be careful when writing parameters and values. The Write method fails if the configuration array is incorrectly created. Users can check Driver's log or use the writeStatus parameter of the WriteEx method to find out the exact cause of the error:

Dim arr(10), strError
arr(1) = Array("IO.Type", "Serial")
arr(2) = Array("IO.Serial.Port", 1)
arr(3) = Array("IO.serial.BaudRate", 19200)
If Not Driver.WriteEx -1, 0, 0, 3, arr, , , strError Then
  MsgBox "Failure when configuring Driver parameters: " + strError
End If

 
Has this section of the documentation helped you configure this Driver?
Yes No
Comments (optional):