B&R PVI Interface (Bernecker & Rainer Process Visualisation Interface)
Protocol description
Communication line configuration
Station configuration
I/O tag configuration
Literature
Changes and modifications
Document revisions
Protocol description
The B&R PVI Interface protocol is used to communicate with the B&R PLC using the PVI interface from Bernecker & Rainer. The following features are supported:
- reading and writing (input and output I/O tags),
- reading and writing simple types (i8, i16, i32, i64, u8, u16, u32, u64, boolean, string, wstring, time, dt, date, tod),
- working with individual items (which are of simple types) of structured variables,
- reading arrays into structured I/O tags with a configured Destination column of the structure.
Working with the "data" data type is not yet supported.
Communication was tested with both virtual and physical B&R PLC with PVI versions:
- Automation Net PVI V4.0
- Automation Net PVI V4.2
- Automation Net PVI V4.3
- Automation Net PVI V4.7
Hierarchy of PVI objects
B&R PVI defines the following object hierarchy for the INA2000 line, which is used to communicate with the B&R SG3, SGC, and SG4 control units via the INA2000 (Industrial Network Architecture) protocol.
Line and Device objects are configured in the protocol parameters of the D2000 communication line.
Station, CPU, Module, and Task objects are configured in the protocol parameters of the D2000 communication station.
Variable objects are configured as D2000 I/O tags.
Communication line configuration
- Communication line category: API.
Line protocol parameters
The following global line protocol parameters can be configured for the "B&R PVI Interface" protocol:
Parameter | Meaning | Unit | Default value | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
--- PVI Parameters --- | |||||||||||||||||||
Communication timeout | Parameter for the PviXInitialize function (PVI interface initialization). | sec | 0 | ||||||||||||||||
Retry time | Parameter for the PviXInitialize function (PVI interface initialization). Retry time for PVICOM user messages in seconds. The value specified with this parameter serves as the default setting of the initialization parameter RETR. If no particular presetting is desired, the default value 0 should be entered. | sec | 0 | ||||||||||||||||
Initialization parameter string | Parameter for the PviXInitialize function (PVI interface initialization).
| - | - | ||||||||||||||||
Line object definition | ObjectDescriptor parameter for the PviXCreate function when creating a Line object. | - | CD=LnIna2 | ||||||||||||||||
Device object definition | ObjectDescriptor parameter for the PviXCreate function when creating a Device object. The parameter gives a description of the device. The default value CD="/IF=tcpip /SA=1" creates a connection using TCP/ IP (UDP), the source address (the D2000 KOM address) will be 1. The PVI documentation describes the parameters for individual device types (Serial, Ethernet UDP, Modem, CAN device, Profibus FDL device). | sec | 30 | ||||||||||||||||
--- Other Parameters --- | |||||||||||||||||||
Browse tasks | The parameter affects the scope of browsing used to configure the I/O tags. | YES/NO | NO | ||||||||||||||||
Inactivity timeout | If the value of the parameter is non-zero, then within the periodic reading of values within the station, it is checked whether any value was received by any station on the line during the last "Inactivity timeout" seconds. If not, the connection to the PVI Manager will be disconnected and re-established. | sec | 0 | ||||||||||||||||
Cleanup command | This parameter allows the batch file to be started at the (re)start of communication. This batch file can e.g. restart the PVI Manager process (PviMan.exe) - e.g. using the pskill.exe utility or using the Windows utility "sc" if PVI Manager is running as a service. Restarting helps if, for example, the PVI Manager stays in the "Locked" state. | - | - | ||||||||||||||||
Cleanup timeout | The time limit in seconds for the batch file specified by the Cleanup command parameter to finish execution. After this time elapses, the command will be terminated. | sec | 10 | ||||||||||||||||
Post create delay | Delay after creating each object. This parameter is used to slow down the start of communication for debugging and diagnostics. | sec | 0,0 | ||||||||||||||||
Asynchronous write/create | The parameter determines the method of communication with the PVI Manager when creating objects and writing values. The asynchronous method is recommended, the synchronous method is implemented only for debugging and diagnostics. In addition, the synchronous mode of operation is not supported by the PVI Manager from several threads, so it can only be used with a single B&R line. | YES/NO | YES | ||||||||||||||||
Value Debug | Logging of values being read and written, together with names of /O tags. | YES/NO | NO | ||||||||||||||||
Full Debug | Logging of additional debug information about communication. | YES/NO | NO |
Station configuration
- The communication station corresponds to the device with which the KOM process communicates. At the station protocol parameter level, objects of Station, CPU, Module, and Task types are specified.
- Communication protocol "B&R PVI Interface".
Station protocol parameters
Configuration dialog box - tab Parameter.
They influence some optional parameters of the protocol. The following station protocol parameters can be set:
Table 1
Parameter | Meaning | Unit | Default value | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Station object definition | Definition of an object of Station type. It is not necessary to configure for the INA2000 line (the parameter is used on NET2000, DCAN, MODBUS, and SNMP lines). | - | - | |||||||||||||||||||||||||||||||||||||||||||||||
CPU object definition | Definition of an object of CPU type. The default value CD="/DAIP=127.0.0.1 /REPO=11160 /RT=1000" creates a connection to the locally running (/DAIP=127.0.0.1) virtual PLC on port 11160 (/REPO=11160), with a response timeout of 1000 ms (/RT=1000). According to the PVI documentation, there are the following usable parameters for UDP communication:
| - | CD="/DAIP=127.0.0.1 /REPO=11160 /RT=1000" | |||||||||||||||||||||||||||||||||||||||||||||||
Module object definition | Definition of object of Module type. The parameter allows the creation of a connection to the module within the PLC. /RO=[<Name of application module>::]<Module name> Examples:
| - | - | |||||||||||||||||||||||||||||||||||||||||||||||
Task object definition | Definition of an object of Task type. The parameter allows the creation of a connection to a task (program) within the PLC. The I/O tags that are children of the station represent global variables of the PLC and local variables of the task specified by this parameter. It is, therefore, necessary to configure a separate station for each task within the PLC. If no parameter is specified, only global PLC variables are available. | - | - |
I/O tag configuration
Possible types of I/O tag values: Ai, Ao, Di, Do, Ci, Co, TiR, ToR, TiA, ToA, TxtI, TxtO.
I/O tag address:
The I/O tag corresponds to an object of Variable type.
The address of the /O tag is in the form Parameter1=value1 [Parameter2=value2] ...
Mandatory parameters are CD=variable_name VT=value_type.
Parameter VL=element_length is mandatory for strings and wide strings (VT=string and VT=wstring).
Parameter VN=number_of_elements is mandatory for array values.
Note: the I/O tag is ignored if its address starts with %IGNORE
According to the PVI documentation, the following parameters are supported:
Parameter | Description |
---|---|
CD | Connection description |
EV | Definition of the enable mask for events. Default: "EV=ed".
If no events should be enabled, then specify "EV=". |
AT | Object attributes. Default: "AT=rw"
|
RF | Refresh rate in ms. Default: "RF=1000".
|
VT | Variable type (Data format description). Default in the process object: "VT=i32"
|
VL | Variable length in bytes (data format description). This parameter can only be specified together with the VT parameter. For single variables, the variable length corresponds to the process data length. For array variables, the variable length is defined as the element length. This parameter does not need to be specified when used in conjunction with variable types which have a fixed variable length (e.g. VT=i32 always has a variable length of 4 bytes). |
VN | The number of elements in array variables (data format description). Default: VN=1. This parameter can only be specified together with the VT parameter. |
VS | Optional additional specification of the variable type (Data format description). This parameter can only be specified together with the VT parameter. The VS parameter provides additional information about the variable type (VT parameter), and does not affect how data is handled (data functions, type changes, etc.) in PVI. Each additional specification consists of one or more specification IDs ('a' - 'z'). The individual specification IDs are separated by semicolons (';'). The following additional specifications are currently defined: 'a' ... array variable, 'b' ... bit string, 'e' ... enumeration, 'v' ... derived data type. |
AL | Structure alignment. Default: "AL=1". This parameter only takes effect in connection with variable type "VT=struct". Alignment values 1, 2, 4, 8, or 16 can be defined. |
CM | Mode for type casting (cast mode). Default: "CM=0". The mode is defined as a bit list and controls type casting between link and process objects.
|
VA | Variable addressing. Default: No variable addressing Using variable addressing, link objects can address subsets from the process data of a variable object. |
DV | The default value for single variables (process data). This parameter can be used to assign a default data value to process variable objects of type Integer, Floating Point, Boolean, or String. If this parameter is specified, then a data format also has to be defined in the object description. This default value is only written to the process image but is not transferred to the PLC. Examples: DV=123, DV=2.561e10, DV="string format" |
HY | Assigned event hysteresis. Default: No hysteresis Definition of event hysteresis for single variables or array variables of type Integer or Floating Point. Event hysteresis is specified as a hysteresis value. Examples: HY=10, HY=2.5 |
FS | Assigned data function. Default: No function Definition of a data function for single variables or array variables of type Integer or Floating Point. The data function is specified as a function description. |
UT | A user tag. With user tags, PVI applications can assign a private user code or specific user data to a process object (module, task, or variable object) in the form of a string. User tags are only managed by PVI, not evaluated. |
Examples of configuration:
- CD=gByte VT=u8 RF=10 - 1-byte unsigned variable gByte, 10 ms refresh rate
- CD=gMyInt VT=i16 HY=5 - 2-byte signed variable gMyInt, with hysteresis 5 (a change less than 5 will not be reported)
- CD=gDate RF=250 AT=rw VT=date - variable gDate of date type, access for reading and writing, 250 ms refresh rate
- CD=gmArrInt VT=i16 VN=6 - variable gmArrInt is array of 16-bit signed integers, first 6 array items will be read
Note: For reading of more than one array item to make sense, the Destination column must be configured for the I-O tag.
Note: Variable with "VN=number_of_items" parameter is for reading only. If writing is required, each array item must be configured as a separate I-O tag (see next example).
CD=gmArrInt[0] VT=i16 - the item zero of an array of 16-bit signed integers gmArrInt (arrays in B&R PLC by default start with a zero entry similar to C) - CD=string_arr RF=250 AT=rw VT=string VL=6 VN=5 - variable string_arr is an array of 6-byte strings, first 5 array items will be read, 250 ms refresh rate
Note: If a string has 6 bytes, it will only fit 5 characters (the last byte is a trailing zero). - CD=wstring_arr VT=wstring VL=42 VN=4 - variable wstring_arr is an array of 6-byte wide strings (2-bytes per character) reťazcov, first 4 array items will be read
Note: If a wstring has 42 bytes, it will only fit 20 2-byte characters (the last 2 bytes is a trailing zero). - CD=Controll.cmd.SetPoint VT=f32 VL=4 VN=1 - item SetPoint of substructure cmd of structured variable Controll is a 32-bit floating-point number
Browse
For the I/O tags, it is possible to find a list of objects of Variable type and their data types and other details, as long as the KOM process is running and communication with the station is established.
Clicking the Browse button opens the B&R PVI Item Browser window and displays a list of objects.
Figure - B&R PVI Item Browser window
The window displays the following information:
Task: the name of the task (if it is a local variable), or an empty string (if it is a global variable). By default, only local variables belonging to the task specified as the Task object definition parameter are read. If the Browse task parameter is enabled, the local variables of all tasks are read.
Variable: variable name in B&R PLC (value of the CD parameter )
Parameters: other parameters of the variable (see the configuration of the I/O tag)
Point: the name of the I/O tag that is configured for this object
Filtering in the list of objects: the browse window allows you to filter by the values displayed in each column. The values don't have to be entered completely. The notation *FILTERED EXPRESSION* is sufficient, where the asterisks represent any text before the start and end of the expression (e.g., *put* covers both input or output).
The total number of objects: the total number of objects in all object groups is displayed at the bottom left of the window.
Meaning of individual options and buttons:
Copy all to clipboard
Copies all displayed objects and details to the Windows Clipboard.
Refresh
The Refresh button can be used to force the object list to be re-read from the device. By default, the KOM process reads the list of objects and their data types only for the first request and stores it in memory. Depending on the number of objects and the speed of the device, this reading may take a longer time. It then sends this stored list to the CNF process(es), so that the next reading of the list in the DNP3 Item Browser window is fast.
Cancel
D2000 Cnf has the recycling of browser windows implemented. If the window is closed by the Cancel button or after selecting an object, it is actually only hidden and is available for browsing for another I/O tag within the same station, so that the list of objects being viewed is preserved. Clicking on the cross at the top right corner will cause the window to actually close.
In the case of structured variables, the window displays individual items that are of basic types. If the local variables of all tasks are browsed ( the Browse task parameter), the local variables not belonging to the task specified as the Task object definition parameter will be displayed in gray and cannot be selected. The following figure shows the items of structured variables as well as local variables of other tasks:
Literature
PVI Base system - B&R documentation
Blog
You can read blogs about the B&R PVI protocol
Changes and modifications
-
Document revisions
- Ver. 1.0 - April 1st, 2021 - a document created.
Related pages:
0 komentárov