How-to guide - all about Automation Net PVI

,

ANSL

AR Support
PVI supports ANSL CPUs since Automation Runtime V4.08. Older implementations where used for VC4 terminal applications and to speed up module transfer due the INA limitation of 255 byte payload per frame. In fact connecting with ANSL to older CPUs could cause PF on the target PLCs < V4.08 and is not reccommended.

Read codepaths
Variables > 64kB are read async < 64kB are read sync.

ANSL AR Logging

Automation Studio 2.x

  1. Modify _@cfxxxxx.xml of the hardware used. (Stored in the OS folder of AS)
    e.g. C:\Programme\BrAutomation\As27000de\As\System\P0295\i386)

Sample:

2</>
Vis.Password.PWStatusInput

2. Build All (Sysconf has to be recompiled)
3. Check com
4. piled moduel with SyEdit.exe (C:\Programme\BrAutomation\AS30071\Bin-en\SyEdt.exe)
The VerboseLevel in groupe ANSL must be visible.

Automation Studio 3.x
There is no dialog for editing ANSL parameters in AutomationStudio.
However, it is still possible to change ANSL parameters in sysconf using the following procedure.

  1. Search in the hardware directory (e.g.C:\Programs\BrAutomation\AS30080\As\Hardware) of the AS for the HWC file of the CPU (e.g. X20CP3485.hwc).
  2. In the HWC file look for the key [ArCfg]and below it the entry resinfo:
    Here is an example of such an entry:

[ArCfg]
001name: AR Configuration
033name: AR Configuration
049name: AR Configuration
dll: BR.AS.RuntimeConfigurationEditor.dll
class: RuntimeConfiguration.Class
resinfo: CATEGORY=“ArCfgCpu”, NAME=“SysConf”

Under resinfo CATEGORY you can find the name of the corresponding XML file (e.g. ArCfgCpu.xml).
3. The XML file can be found in the same hardware folder.
The XML file is edited and extended by the desired ANSL entries.
These entries overwrite the default values.
The default values are the values given here:

Automation Studio 4.x

  1. Goto Path C:\BrAutomation\AS40\AS\Hardware
  2. Search for the Target CPU .xml File e.g. PP065 → ArCfgCpuPP065.xml
  3. Edit with Notepad++ and Insert following entry:


  4. Now you have a new Entry: ANSL in your CPU Configuration(in AS) where you can Set the Verboselevel.

ANSL UIF Library
The AnslUIF library is a C/C++ library available for Linux x86/x64 as part of the PVI package.
The library, documentation and samples can be found in C:\BrAutomation\PVI\V4.12\AN folder.
It allows a programmer to communicate with B&R PLCs supporting the ANSL protocol (V4.08+) from Linux.

Known issues

  • No TLS support

The AnslUIF library currently has no support for encrypted ANSL communication.

Type information for struct.

AnslUIF can only provide basic data type information but will not provide format information for structs.
The structure of the data including the alignment must already be known to the client so that it can directly access the members.

INA
INA is the legacy online protocol for B&R PLCs. It is transport agnostic and support serial, modem, CAN and Ethernet UDP links.

For historic reasons INA has a max UDP frame length of 297 byte. (255 byte payload + 42 byte IP + UDP header).
This and the implementation as request response protocol cause high latency links to have a bad performance with INA, which makes it unsuitable for remote 300ms + links.

OPC DA

Servers

GUID / CLSID

DCOM

  • Ports

Connection is established through port 135, either UDP or TCP but most likely TCP.
Afterwards 2 additional ports are negotiated dynamically (Server → Client connection + Client → Server connection).

Windows Firewall settings (firewall.cpl):
Per default, all ports < 2000 are blocked this means:

  • open port 135 for UDP and TCP
  • free open ports (> 2000) are negotiated and allocated dynamically
    The firewall must allow the local process to open these ports.

OPC DA over Internet Connection Sharing (ICS) / Network Address Translation (NAT)
DCOM and by this extension also OPC DA does not work over ICS / NAT because the protocol encodes the IP inside the data too.
NAT can only replace the source and destination IP fields inside the IP headers but not inside the data itself.

Windows KB5004442 breaks OPC DA 2.0 (AR) / OPC DA 3.0 (PVI remote)
The Windows KB5004442 breaks OPC DA 2.0 (AR) and OPC DA 3.0 (PVI remote).
This is because since then Windows DCOM requires higher authentication level which we cannot provide in the AR implementation.
Since the AR OPC DA 2.0 feature is discontinued with AR I4.33 there is no fix planned.
As workaround we suggest to use OPC UA or PVI OPC DA 3.0 in local mode.

PVI Change registered PVI manager
To change the registered PVI Manager (PVI Manager which is opened if PviInitialize is called) proceed as follows.

  1. Open the PVI Monitor with administrator rights.
  2. Click Options > PVI Registry Changer
  3. Select the PviMan.exe of the PVI version of your desire
  4. Click OK

PVI DDE Server

DDE Server "unknown clipboard format
The “unknown clipboard format” message is generated by the DDE server and client during the negotiation phase. When the DDE server starts the communication they have to negotiate which clipboard format (data format of the protocol) both can use. The server generates a “unknown clipboard format” message until the client and the server negotiated a working connection with a clipboard format both support.

This is no error and can therefore be ignored.

PVI ETH RS232 Adapters
For ETH RS232 adapters there is an undocumented parameter in the device object.

/REOP=1 will tell the PVI manager to reopen the device if it tries to reconnect.

PVI Exception handling
The PVI Manager has an exception handler for non-structured exceptions. When an exception occurs in a PVI component running in the process context of the PVI Manager, the exception handler of the manager is called. The exception handler displays the exception information in a message box or writes the information to the PVI logger files (standard and system loggers) of the PVI Manager.


The manager is then terminated.
image

Settings

Generating memory dumps
Sometimes it might be helpful for the developers to receive memory dumps so that they can inspect the exception stack backtrack in windows debuggers such as [Windbg ](available as part of the [Windows SDK].
To generate such dumps the PVI exception handling has to be deactivated so that the OS can handle the exception on its own and create memory dumps for us.
To do so deactivate the exception handling with NoExpFlt=1 and instruct Windows to catch the exception and dump the program memory into a file.

This is done on Windows with the WER (Windows Error Reporting) functionality by configuring a recording entry in the Windows registry.

PVI License
A PVI license is needed on none B&R IPC’s to run server (e.g. BR OPC DA 3.0) or applications except PVI Transfer or Automation Studio for more than 2 hours.

PVI License

  • 0TG1000.01 or 0TG1000.02 + 1TG0500.02 (USB Dongle) PVI Technology Guard license
  • 1TG0500.01 (Software container) PVI Technology Guard license

Software license 5S0500.99 (legacy)
The software license 5S0500.99 is intended for mass licensing without a physical hardware dongle.
It is implemented as a DLL which is copied to the PVI bin folder.
Price negotiations are possible with sales Mr. Peter Gucher (see SN 54/1999).
Once bought the customer never needs to buy a PVI license again regardless how many devices are sold with this license.

The name of the file is BrLcmode.dll.

The license information of the license holder will be displayed in the PviMonitor window.

The 32bit version of the DLL is not compatible with a 64bit PVI manager.
If the customer has a 32bit version of the DLL but needs a 64bit version for PVI on 64bit OS then a new order for a 5S0500.99 has to be placed with sales.
If there are cost has to be discussed with sales.

ADI Driver
B&R devices do not need a PVI license and will run PVI for longer than 2 hours.
To identify a B&R IPC to PVI as B&R IPC the ADI driver has to be installed.

The universal ADI driver (APC910 Skylake W10 / APC/PPC3100/…) is supported beginning with PVI 4.4.4.

Dongle holder (legacy)

  • 9A0003.02U (USB Dongle Holder) USB Port Button Holder DS9490B
  • 9A0003.02 (LPT Dongle Holder) Parallel Port Button Holder DS1410E

The last version of the maxim driver which supports the parallel port dongle holder is V4.02 included for the last time in PVI 3.00.02.3017.

PVI Dongle won’t work on PCI LPT ports (legacy)
The PVI Runtime LPT dongle only works on on-board parallel interfaces (Legacy Ports 278h / 378h) and therefore the dongle can not be used on an additional PCI interface card since the legacy port addresses cannot be mapped to these ports.

ARWin Dongle as PVI dongle
A physical ArWin dongle can be also used to enable PVI communication. The dongle is accepted as PVI dongle by the PVI manager.
image

Windows CE
On B&R Windows CE devices the PVI Manager does not check the license.

Technology guard
Beginning with PVI 4.1.06 / PVI 4.2.02 PVI also supports the Technology Guard PVI license 1TG0500.02.
You need to have the license on a tech guard dongle 0TG1000.01 or 0TG1000.02.
This license will not work with the Software container.

Beginning with PVI 4.9 also the software container license 1TG0500.01 is supported.

In the PVI Setup for this version you have to enable Technology Guarding under Drivers in the components

If the PVI software still runs in trial or locked then open C:\BrAutomation\PVI\V4.x\Bin\BrSecChk.exe (where x is the installed version) with administrator rights and under “Configuration” make sure “Search Technology Guarding License” is enabled.

PVI Logging
Logging can be enabled in the PVI monitor under Options > PVI Diagnostics.
image

In the group “Data Logger” following settings should be made.

  • Global Mode: “Log Details”
  • Global Verbose: “True”
  • Global Time Stamp: “Date + Time”

Under “Details” the components found below should be set up according to their configuration.
Components, which are not yet part of the configuration, can be added by “Right Click” and “New” to the component list box.

PVI Symbols
Debug Modules enable enhanced logging (Stack-trace) in case of an Exception of the PviManager (PviMan.exe). For this to be possible the *.pdb files have to be copied to the %PVI Folder%\Bin directory. (.\x64*.pdb on ARCH x64 and the .*.pdb files on ARCH x86)
image

Components for PVI problems
Component: PviMan.exe
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\PviMan.log
Time Stamp: Date + Time

Component: PviMan.exe/LnIna2.dll
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\LnIna2.log
Time Stamp: Date + Time

Component: PviMan.exe/Icomm.dll
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\Icomm.log
Time Stamp: Date + Time

Component: PviMan.exe/LnAnsl.dll
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\LnAnsl.log
Time Stamp: Date + Time

Component: PviMan.exe/LnAnsl.dll/Ansl
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\LnAnslA.log
Time Stamp: Date + Time

Component: PviMan.exe/LnAnsl.dll/Communication
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\LnAnslC.log
Time Stamp: Date + Time

Additional components for PVI Client problems


Component: pg.exe/PviCom.dll/Client
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\PviClient.log
Time Stamp: Date + Time

Additional components for INA TCPIP problems
Component: PviMan.exe/InaFrms.dll/TCPIP
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\InFrms.log
Time Stamp: Date + Time

Additional components for SNMP problems
Component: PviMan.exe/BrSnmp.dll
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\BrSnmp.log
Time Stamp: Date + Time

Additional components for PVI OPC DA 2.0 (<PVI 3.0.2) problems
Component: PviOPCLs.exe
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 200000
File Name: C:\Temp\Log\PviOPCLS.log
Time Stamp: Date + Time

Component: PviOpcLs.exe/Callbacks
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\PviOPCLS_Callback.log
Time Stamp: Date + Time

Component: PviOpcLs.exe/Config
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\PviOPCLS_Config.log
Time Stamp: Date + Time

Component: PviOpcLs.exe/Events
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\PviOPCLS_Events.log
Time Stamp: Date + Time

Component: PviOpcLs.exe/PviCom.dll/Client
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 200000
File Name: C:\Temp\Log\PviOPCLS_Client.log
Time Stamp: Date + Time

Component: PviOpcLs.exe/OpcClient
Logging mode: “Log Mains”
Verbose: “True”
File Size (KB): 200000
File Name: C:\Temp\Log\PviOPCLS_OPCClient.log
Time Stamp: Date + Time

Additional components for PVI OPC DA 3.0 (>= PVI 3.0.2) problems
Component: BR.OPC.Server.exe/PviCom.dll/Client
Logging mode: “Log Details”
Verbose: “True”
File Size (KB): 50000
File Name: C:\Temp\Log\BrOpcServerClient.log
Time Stamp: Date + Time

Break function
Should you know what error code occurs together with the problem, then you can automatically stop the logging and therefore prevent cyclic buffer overrun by setting a break condition. In this sample we break logging if the error E=4806 is encountered once.

Use Break Function: “True”
Break Time (ms): 10000
Expression: E=4806
Turn-off global logging mode: “True”

Logging and stopping
After finishing the configuration, the “Apply” button must be pressed in order to confirm the settings. The settings will take effect after the PVI manager has been restarted.

In case, an error occurs and no break condition is specified, please stop the PviManager with the PVI Monitor File > Stop Manager. The PVI manager and the application must not be restarted before all logfiles in C:\Temp\Log\ have been saved to a different location.

In case an error occurs and a break condition is specified the logging stops automatically. Before enabling the logging for another run please save all logfiles under C:\Temp\Log to a different location. The log can be re enabled by setting “Data Logger Global Mode: Log Details”.

Snapshot
A PVI Snapshot can be created in the PVI monitor under Options > PVI Diagnostics
In the group “Snapshot” specify a file with the “…” button and then create a snapshot with the “Snapshot” button.
The created file can be viewed with the PVI Snapshot viewer which can be opened from the PVI monitor via Options > PVI Snapshot Viewer.

PVI Pbus
The Pbus.sys is a driver for recognizing B&R PC on devices where ADI is not available. (e.g. Provit5000)

Uninstall
If you wish to uninstall it then please follow this instruction.

  1. Start > Run > devmgmt.msc
  2. View > Show hidden devices
  3. Select “Non-Plug and Play Drivers\Pbus”
  4. Right click and select uninstall

PVI Services

Versions

Thread safety
BR.AN.PviServices is a GUI variable interface and as such makes use of the Window Message Loop to trigger events (New versions support a message function).

While this updates are going on it is not allowed that modifications to the members of the PviServices classes are made.

Since this is not locked, BR.AN.PviServices are not thread safe.

We generally recommend if multi threading is desired to run the modifications on the main UI thread so that they are locked against each other and the running of event handlers.

PVI System error 1056
The error “PviMan.exe system error 1056 can’t start pvi manager service” is a Windows system error which in detail means that the PVI Manager service cannot be started because it is already running.
image

Problem cause
The problem is caused by the fact that the PVI is registered as a Windows system service and a PVI client is started automatically on start-up.

Since Windows loads the services parallel to the login this causes problems if the client application tries to start the Pvi service because it thinks it is not yet running.

The problem is timing related and therefore can vary depending on the start cycle delays and load dependencies.

Problem solution
To resolve the issue the customer can register the PviManager as process instead of system service.

To do so the customer has to open the PVI Monitor > Options > PVI Registry Changer and deselect the option “Use PVI Manager as a system service”

Older PVI Versions
Older PviMonitor versions did not have the option.

Here you can run %PVI_INSTALL_FOLDER%\bin\pviman.exe /deinstall

or start the PVI setup and uncheck the “start pvimanager as service” option.

see AsHelp GUID 71e6479b-6bb5-4771-a6c0-7bcb4d2645f3

PVI Transfer Tool

Recognition schemes of data carrier PVI Transfer Tool
PVI Transfer Tool detects data media according to the following principle:

  • all storage devices on the USB
  • all removable devices

However, for security reasons, the list is additionally filtered:

  • Data carriers larger than 8 / 16 GB (version-dependent)
  • System data medium

Reinstalling BrDiskImage service
To reinstall the BrDiskImage service the following command must be executed with admin rights:

  • BrDiskImageSvc/install
3 Likes

Thanks @abid.bhatti , you can add more topics :slight_smile: