176
PVI base system

PviBase

Embed Size (px)

DESCRIPTION

B&R PVI tutorial

Citation preview

Page 1: PviBase

PVI base system

Page 2: PviBase
Page 3: PviBase

Contents (4.4.2006)1 PVI base system.................................................................................................................................................1

1.1 Overview..............................................................................................................................................11.2 Terms...................................................................................................................................................21.3 PVI Manager........................................................................................................................................31.4 PVI Monitor...........................................................................................................................................4

1.4.1 Setting PVI Manager properties..................................................................................................61.4.2 Snapshot Function......................................................................................................................71.4.3 Snapshot Viewer.........................................................................................................................71.4.4 Configuring the Data Logger for PVI Components...................................................................10

1.5 PVICOM Interface..............................................................................................................................141.5.1 User Guidelines.......................................................................................................................141.5.2 Client/Server Communication...................................................................................................17

1.5.2.1 Communication Instances...............................................................................................181.5.2.2 Communication Type......................................................................................................18

1.5.3 Global Events...........................................................................................................................191.5.4 Objects......................................................................................................................................20

1.5.4.1 Process Objects..............................................................................................................211.5.4.2 Link Objects.....................................................................................................................231.5.4.3 Service Objects...............................................................................................................23

1.5.5 Object Names and Connection Descriptions............................................................................231.5.5.1 Object Names with Path Specification............................................................................241.5.5.2 Unique Object Names.....................................................................................................25

1.5.6 Object descriptions...................................................................................................................251.5.7 User messages.........................................................................................................................27

1.5.7.1 User message operation.................................................................................................271.5.7.2 User messages as window messages............................................................................281.5.7.3 User messages as callback functions with data..............................................................291.5.7.4 User messages as callback functions without data.........................................................311.5.7.5 User messages as asynchronous callback functions......................................................32

1.5.8 Requests and Responses........................................................................................................331.5.8.1 Sending Requests and Receiving Responses................................................................341.5.8.2 Order of Request Execution............................................................................................35

1.5.9 Access types.............................................................................................................................351.5.9.1 POBJ_ACC_DATA access type......................................................................................421.5.9.2 POBJ_ACC_STATUS access type.................................................................................421.5.9.3 POBJ_ACC_TYPE access type......................................................................................431.5.9.4 POBJ_ACC_TYPE_EXTERN access type.....................................................................431.5.9.5 POBJ_ACC_UPLOAD and POBJ_ACC_UPLOAD_STM access types.........................431.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types.............451.5.9.7 POBJ_ACC_MOD_DATA access type...........................................................................47

1.5.10 Object Events.........................................................................................................................501.5.11 Event types.............................................................................................................................51

1.5.11.1 POBJ_EVENT_ERROR Event Type.............................................................................521.5.11.2 POBJ_EVENT_DATA Event Type................................................................................521.5.11.3 POBJ_EVENT_DATAFORM Event Type......................................................................53

1.5.12 Process Data..........................................................................................................................531.5.12.1 Type casting..................................................................................................................541.5.12.2 Variable Addressing......................................................................................................57

1.5.13 Process Data Properties........................................................................................................581.5.13.1 Object Attributes............................................................................................................581.5.13.2 Refresh Time.................................................................................................................591.5.13.3 Data Format..................................................................................................................59

1.5.14 Process Data Functions..........................................................................................................621.5.14.1 Event Hysteresis...........................................................................................................631.5.14.2 Data Functions..............................................................................................................63

1.5.15 PVICOM functions..................................................................................................................661.5.15.1 Functions with or without an instance handle................................................................671.5.15.2 Asynchronous and synchronous functions....................................................................671.5.15.3 PviInitialize, PviXInitialize Functions.............................................................................681.5.15.4 PviDeinitialize, PviXDeinitialize Functions.....................................................................70

PVI base system

i

Page 4: PviBase

Contents (4.4.2006)1 PVI base system

1.5.15.5 PviSetGlobEventMsg, PviXSetGlobEventMsg functions...............................................711.5.15.6 PviCreateRequest, PviXCreateRequest Functions.......................................................731.5.15.7 PviCreateResponse, PviXCreateResponse Functions.................................................761.5.15.8 PviCreate, PviXCreate Functions..................................................................................761.5.15.9 PviDeleteRequest, PviXDeleteRequest Functions........................................................771.5.15.10 PviDeleteResponse, PviXDeleteResponse Functions................................................781.5.15.11 PviDelete, PviXDelete Functions.................................................................................791.5.15.12 PviLinkRequest, PviXLinkRequest Functions.............................................................791.5.15.13 PviLinkResponse, PviXLinkResponse Functions........................................................811.5.15.14 PviLink, PviXLink Functions........................................................................................821.5.15.15 PviUnlinkRequest, PviXUnlinkRequest Functions.......................................................831.5.15.16 PviUnlinkResponse, PviXUnlinkResponse Functions.................................................841.5.15.17 PviUnlink, PviXUnlink functions...................................................................................841.5.15.18 PviChgLinkRequest, PviXChgLinkRequest Functions................................................851.5.15.19 PviChgLinkResponse, PviXChgLinkResponse Functions...........................................861.5.15.20 PviChgLink, PviXChgLink Functions...........................................................................871.5.15.21 PviUnlinkAll, PviXUnlinkAll Functions.........................................................................871.5.15.22 PviReadRequest, PviXReadRequest Functions.........................................................881.5.15.23 PviReadArgumentRequest, PviXReadArgumentRequest Functions..........................891.5.15.24 PviReadResponse, PviXReadResponse Functions....................................................901.5.15.25 PviRead, PviXRead functions.....................................................................................901.5.15.26 PviWriteRequest, PviXWriteRequest Functions..........................................................911.5.15.27 PviWriteResponse, PviXWriteResponse Functions....................................................921.5.15.28 PviWriteResultResponse, PviXWriteResultResponse functions.................................931.5.15.29 PviWrite, PviXWrite functions......................................................................................931.5.15.30 PviGetResponseInfo, PviXGetResponseInfo Functions.............................................941.5.15.31 PviGetVersion Function...............................................................................................95

1.5.16 PVICOM Structures................................................................................................................951.5.16.1 PROCEEDING_INFO Structure....................................................................................961.5.16.2 RESPONSE_INFO Structure........................................................................................96

1.6 PVI lines.............................................................................................................................................971.6.1 Line object................................................................................................................................981.6.2 INA2000 line.............................................................................................................................98

1.6.2.1 INA2000 process objects................................................................................................981.6.2.2 INA2000 access types.....................................................................................................991.6.2.3 INA2000 events.............................................................................................................1001.6.2.4 INA2000 Communication..............................................................................................1001.6.2.5 INA2000 device objects.................................................................................................1031.6.2.6 INA2000 CPU objects...................................................................................................1081.6.2.7 INA2000 Module Objects..............................................................................................1141.6.2.8 INA2000 Task Objects..................................................................................................1141.6.2.9 INA2000 variable objects..............................................................................................1151.6.2.10 Translating BR Modules..............................................................................................1171.6.2.11 Link node variables.....................................................................................................118

1.6.3 NET2000 line..........................................................................................................................1191.6.3.1 NET2000 process objects.............................................................................................1201.6.3.2 NET2000 access types.................................................................................................1201.6.3.3 NET2000 events............................................................................................................1211.6.3.4 NET2000 Communication.............................................................................................1211.6.3.5 NET2000 device objects...............................................................................................1231.6.3.6 NET2000 Station Objects..............................................................................................1271.6.3.7 NET2000 Task Objects.................................................................................................1271.6.3.8 NET2000 Variable Objects............................................................................................127

1.6.4 MININET line..........................................................................................................................1291.6.4.1 MININET process objects..............................................................................................1291.6.4.2 MININET access types..................................................................................................1301.6.4.3 MININET events............................................................................................................1301.6.4.4 MININET Communication..............................................................................................1301.6.4.5 MININET device objects................................................................................................132

PVI base system

ii

Page 5: PviBase

Contents (4.4.2006)1 PVI base system

1.6.4.6 MININET Station Objects..............................................................................................1331.6.4.7 MININET Variable Objects............................................................................................133

1.6.5 DCAN line...............................................................................................................................1341.6.5.1 DCAN process objects..................................................................................................1341.6.5.2 DCAN access types......................................................................................................1351.6.5.3 DCAN events.................................................................................................................1351.6.5.4 DCAN Communication..................................................................................................1361.6.5.5 DCAN Device Objects...................................................................................................1361.6.5.6 DCAN Station Objects...................................................................................................1371.6.5.7 DCAN Variable Objects.................................................................................................138

1.6.6 MTC line.................................................................................................................................1401.6.6.1 MTC process objects.....................................................................................................1411.6.6.2 MTC access types.........................................................................................................1411.6.6.3 MTC events...................................................................................................................1421.6.6.4 MTC Communication.....................................................................................................1421.6.6.5 MTC Device Objects.....................................................................................................1421.6.6.6 MTC Variable Objects...................................................................................................143

1.6.7 OS9NET line...........................................................................................................................1491.6.7.1 OS9NET process objects..............................................................................................1491.6.7.2 OS9NET access types..................................................................................................1501.6.7.3 OS9NET events............................................................................................................1501.6.7.4 OS9NET Communication..............................................................................................1501.6.7.5 OS9NET Device Objects...............................................................................................1511.6.7.6 OS9NET Station Objects...............................................................................................1511.6.7.7 OS9NET Variable Objects.............................................................................................151

1.7 Diagnostics.......................................................................................................................................1521.7.1 Snapshot Files........................................................................................................................1521.7.2 Data logger.............................................................................................................................156

1.7.2.1 PVI components with logger output...............................................................................1571.7.2.2 Logger output format.....................................................................................................159

1.8 Appendix..........................................................................................................................................1621.8.1 Appendix A − Definitions.........................................................................................................1621.8.2 Appendix B − Base Components............................................................................................1641.8.3 Appendix C − Registration......................................................................................................165

PVI base system

iii

Page 6: PviBase

PVI base system

iv

Page 7: PviBase

1 PVI base systemThe PVI (Process Visualization Interface) base system is the central means to access B&R Automation Net™ inWindows™ 95/98/ME, NT/2000/XP and CE. PVI forms a common interface to the world of the B&R industrialPCs for all Windows−based software packages. Each station communicating on the network can exchange andprocess program objects and data, regardless of the target system, media, and protocol being used.

The PVI base system essentially consists of PVI Manager, PVI Monitor, the PVICOM interface (client interface),and the PVI lines.

PVI Manager is the central component of PVI. It is responsible for managing all types of process data −− fromsimple process variables to lists and program/data objects. PVI Manager organizes process data with regard toboth timing and direction.

PVI Monitor is an auxiliary tool which displays operating states, versions of active PVI components, and PLCoperating systems. In addition, PVI Monitor is used to configure PVI Manager and PVI Data Logger propertiesand to trigger the snapshot function.

The PVICOM interface (client interface) establishes access to the PVI at the lowest level. This represents the"tightest" and, regarding performance, the most optimal PVI interface. The PVICOM interface is also used by allother Windows−based components which have PVI access (PVI OPC, PVI DDE, PVI controls, etc.).

The basic task of a PVI line is to connect PVI objects to objects outside of PVI. The line is also responsible forcommunicating with B&R controllers (PLCs) and determines the communication protocol to be used to do so.

1.1 Overview

A considerable part of the effectiveness of a process visualization project is decided by the means by whichprocess data is collected. Since process data in a control system must often be obtained asynchronously overslow serial data lines or other bus systems before being passed on, it is necessary to store the data in a processimage.

In PVI, the process image consists of a number of variable objects containing data which is updated eithercyclically or at specific time points. Variable objects are special types of process objects. Other process objectsare used to handle services such as module downloading/uploading, reading PLC information, or defining thePLC connection, etc.

Process objects are managed in an object structure within PVI Manager. Connecting process objects withexternal objects (e.g. objects on a PLC) takes place with one or more PVI lines (line servers). They also takeover transporting process data to and from the PLC as well as handling PLC services on the protocol level.

The PVICOM interface acts according to the client/server principle where the PVI Manager is the server andPVICOM applications are the clients. Servers and clients can be on the same machine (local communicationtype) or on different computers (remote communication type).

Using additional servers, it is also possible to link architectures like DDE (Dynamic Data Exchange), OPC (OLEfor process control) or HTML (Web) to PVI. These servers are components of PVI and delivered in the PVIstandard package.

The following image gives an overview of the most important PVI components:

1 PVI base system 1

Page 8: PviBase

1.2 Terms

Term Description

Connectiondescription

A connection description consists of the connection name and optional connectionparameters. This defines the connection between PVI process objects and external objects.External objects can be in a line or outside of PVI.

Connection name The connection name is part of the connection description and is used as the name for theservice object. Depending on the process object type being used, the connection namedefines a line, device, station, PLC, or PLC object.

User message PVI uses user messages to signal the existence of response or event data in the PVICOMcommunication instance to the PVI application.

Response data Response data is received from the application with a PVICOM response. This alsoincludes any error codes and status flags in addition to the actual data.

Request data Request data is sent from the application with a PVICOM request.

Data format The data format of the process data in the process object (variable object) or link object.

Event type The event type determines the type of event data.

Event data Event data is received from the application with a PVICOM event (object event or globalevent). This also includes any error codes and status flags in addition to the actual data.

Communicationtype

The communication type defines the type of the connection between the PVICOMapplication and PVI Manager.

Communicationinstance

The communication between a PVICOM application and PVI Manager is handled via acommunication instance.

Line A PVI line establishes the connection between a subset of process objects and theenvironment outside of PVI. Depending on the line being used, this "outside world" canconsist of PLC objects (INA2000 line) or PC objects (MTC line). A line is also called a lineserver.

Object attributes Object attributes control how process data is acquired and handled for a process object(variable object).

PVI base system

2 1.2 Terms

Page 9: PviBase

Object name The object name is the name of a process object in PVI Manager.

Object path The object path consists of one or more object names and determines the position of aprocess object within the object structure.

Object structure The process object tree created in PVI Manager is called the object structure.

Process image The process image is depicted using process objects and represents all the process datanecessary to regulate a visualization process.

Process object Process objects represent the process image in PVI Manager.

Process objectstate

The process object state describes the actual condition of a process object. The processobject can take on undefined, ready, or error states as well as active or idle states.

PVICOM interface The PVICOM interface represents the access way for the application to PVI Manager.

Refresh time The refresh time determines how frequently the process data of external variable objects isupdated.

Service objects A service object assigns an external object to a process object. External object can be inthe PVI line or outside of PVI (e.g. PLC objects).

Type casting Type casting transforms the process data from the data format of the process object intothe data format of the link object and vice versa.

Link object A link object establishes a connection from the application to a PVI Manager processobject.

Access type The access type determines the type of read or write request. In this way, object data,object states, different object properties, and various services can be selected.

1.3 PVI Manager

PVI Manager (PviMan.exe) is the central component of PVI. It is responsible for managing process data of alltypes − from simple process variables to lists and program/data objects. PVI Manager organizes process datafor both timing and direction. That means PVI Manager uses the specifications from the application to determinewhich data is transferred via which device and medium from or to a certain station. Special attention has beengiven to asynchronous task handling in order to e.g. be able to use network delays for other tasks or to fit incoordinated event processing between different tasks.

PVI Manager must be started to use PVI (PVICOM interface). The manager is automatically started when usingthe local communication type (PVICOM function PviInitialize or PviXInitialize). The manager has to be started bythe user when using the remote communication type.

PVI Manager is always started as a process in Windows 95/98/ME. In Windows NT/2000/XP, PVI Manager caneither be operated as a process or as a service. Functions to install and uninstall the PVI Manager service areintegrated into PVI Manager. To install the PVI Manager service, PVI Manager just needs to be called with theprogram argument "/install". The next time the program is started (without any program arguments), PVIManager will be operated as a service. Uninstalling takes place with the program argument "/deinstall". PVIManager then operates as a process once again.

> c:\BrAutomation\Bin\PviMan /install

> c:\BrAutomation\Bin\PviMan /deinstall

PVI Manager can also be selected as a process or a service in PVI Setup.

There is basically no difference when running PVI Manager as a service or a process. The service can bestarted and ended, just like process. In addition, as a service, the program is shown in the list of local servicesand can be operated using Windows service functions. The substantial advantage of service operation,however, is that PVI Manager is not ended automatically by Windows after the user logs off.

If PVI Manager is started as a process or service, then an icon appears in the system tray in the Start bar. It canbe turned off in the PVI Manager properties.

Icon Description

PVI Manager is being operated as a process

PVI base system

1.3 PVI Manager 3

Page 10: PviBase

PVI Manager is being operated as a service

Double−clicking on the icon starts PVI Monitor. It can also be started using the PVI Manager shortcut menu(right mouse button). The shortcut menu also contains a function for exiting PVI Manager.

1.4 PVI Monitor

The PVI Monitor (PviMon.exe) aids the display of operating information and is used to configure diagnosticsfunctions and global properties for the PVI Manager. PVI Monitor is started by double−clicking on the PVIManager icon in the system tray or using the "PVI Monitor" entry in the Start menu. The PVI Monitor statuswindow is displayed once the program is started.

PVI Monitor status window:

The following information is output in the status window:

Version, date, and language of the installed PVI version• Security mode (operating status) of PVI Manager:"undefined": The operational status has not been captured yet by PVI Manager"Runtime": PVI license enabled for PVI Manager "Trial": No license enabled − PVI Manager only runsfor 2 hours after being started"Locked": No license enabled − the 2 hour "trial" mode has expired

The assigned port number if TCP/IP communication is enabled on PVI Manager• Time elapsed since PVI Manager was started• The number of link objects created in PVI Manager• The number of process objects created in PVI Manager, number of active process objects, and numberof process objects with errors

The number of service objects present in PVI Manager, number of active service objects, and number ofservice objects with errors

The number of currently active data objects (request and response objects)• The number of PVICOM communication instances (clients) registered with PVI Manager• Counter for received request data (requests)• Counter for sent response data (responses)• Counter for sent event data (events)•

PVI Monitor cyclically generates requests for information from PVI Manager. Since this affects the status counterdisplay, PVI Monitor tracks its own calls and subtracts them from the status counters. Closing the PVI Monitorand then restarting it immediately may therefore cause the status counters to increase erratically. The cyclic PVIMonitor information requests can be turned on and off with the "Options −> Stop Cyclic Refresh" menu item.

PVI Monitors operations and functions:

PVI base system

4 1.4 PVI Monitor

Page 11: PviBase

Menu Key Function

File −> Connect Ctrl+O Establishes the communication connection to PVIManager (only in Remote communication mode).

File −> Disconnect Ctrl+S Removes the communication connection to PVIManager (only in Remote communication mode).

File −> Start Manager Ctrl+Alt+O Starts PVI Manager (only in Local communicationmode).

File −> Stop Manager Ctrl+Alt+S Ends PVI Manager (only in Local communicationmode).

Options −> Manager Properties Alt+F7 Configures PVI Manager properties.

Options −> PVI Diagnostics Alt+F8 Configures the PVI Data Logger for generating PVI logfiles.Triggers the Snapshot function for generating a PVIsnapshot file.

Options −> PVI Snapshot Viewer Alt+F9 Snapshot viewer for displaying PVI snapshot files.

Options −> Topmost Determines whether PVI Monitor should also be in theforeground on the screen.

Options −> Show Toolbar Shows/Hides the toolbar.

Options −> Stop Cyclic Refresh Ctrl+F5 Turns the PVI Manager cyclic information requeston/off.

Help −> Documentation F1 Opens the PVI base documentation (only if installed).

Help −> Component Versions Displays the versions of all currently active PVIManager PVI components.

Help −> PCC System Versions Shows the operating system versions of all PLCscurrently connected to PVI Manager.

PVI Monitor communication type:

Communication with PVI Manger can be done either locally (Monitor and Manager running on the samecomputer) or remotely (Monitor and Manager not running on the same computer). The type of communicationused is determined by the "/Remote" program argument when PVI Monitor is started and can no longer bechanged at runtime. The PVI entry in the Start Menu provides both types of communication (menu entries "PVIMonitor" and "PVI Monitor (Remote)"). The remote connection is not supported in the Windows CE version ofPVI Monitors. However, a remote connection can be made to the Windows CE version of PVI Manager underWin32.

> c:\BrAutomation\Bin\PviMon /Remote

When using the remote communication type, PVI Monitor is connected to PVI Manager over TCP/IP. The "File−> Connect" menu item in PVI Monitor opens up the dialog box for configuring TCP/IP connection parameters.

The IP address or host name (e.g. "SystemPC1") of the server needs to be specified in the "IP Address" inputfield. The "Number of Port" input field needs to contain the port number assigned to PVI Manager (Setting PVIManager Properties).

PVI base system

1.4 PVI Monitor 5

Page 12: PviBase

1.4.1 Setting PVI Manager properties

The dialog box for setting PVI Manager properties is done by running "Options −> Manager Properties" in PVIMonitor. For the Windows CE version, click on the "Properties" button in PVI Monitor. Regardless of the PVIMonitor communication type being used (remote or local), the PVI Manager properties are always configured onthe PVI Manager system. This basically means the remote system when using the remote communication type.

Please note:Any properties that are changed only take effect after PVI Manager is restarted. Changes require administratorrights.

Use TCP/IP Communication:

If this field is selected, them PVI Manager is started as a TCP/IP server (remote communication type). A uniqueport number has to be assigned in the "Number of Port" field. Any value between 1024 and 65535 can bedefined as a port number. The default value for PVI is 20000. The port number has to be unique within the localcomputer, i.e. no other TCP/IP server on the computer may use the same port number.

Please note:If TCP/IP communication is not needed, then this field should not be enabled. Otherwise, unnecessaryresources are expended.

Display trial mode messages:

If this field is enabled, then PVI Manager displays warning messages on the screen if a valid security key hasnot been found and the "trial time" (2 hours) has expired.

The current operating status can be viewed in the PVI Monitor status window.

Doesn't apply for the Windows CE version.

Display symbol on system tray:

If this function is enabled, then PVI Manager is displayed as an icon in the system tray on the taskbar. PVIManager can be closed or PVI Monitor can be opened using the icon's shortcut menu (right mouse click).

Stop the PVI manager automatically:

If this field is enabled, then PVI Manager exits automatically as soon as the last PVICOM communicationinstance (client) is deregistered. However, there can be no static process objects which were created earlier stillavailable (except for the PVI base object).

This function cannot be used together with TCP/IP network communication (remote communication type).

This function is basically intended as help when developing or testing PVI applications.

PVI base system

6 1.4.1 Setting PVI Manager properties

Page 13: PviBase

Execution Priority:

This area sets the process priority of PVI Manager.

Doesn't apply for the Windows CE version.

1.4.2 Snapshot Function

The Snapshot function writes a list of PVI objects (link objects, process objects, and service objects) along withtheir status and a list of all registered clients as text (ASCII) in the specified Snapshot file. The contents of thesnapshot file can be viewed and analyzed with a text editor or the Snapshot Viewer integrated into PVI Monitor.

The Snapshot file always shows an instantaneous image of the object situation at the moment the function istriggered. All other functions in PVI Manager are blocked while the Snapshot function is carried out. Thissecures the consistency of the Snapshot data, but can also lead to immense timing variations when there arelarge quantities of data being handled by PVI Manager.

The dialog box for triggering the PVI Snapshot function is opened using the PVI Monitor menu "Options −> PVIDiagnostics".

Clicking on the "Snapshot" button triggers a snapshot function. The Snapshot information is written to the filespecified in the "Path" input field. The path specification for the Snapshot file refers to PVI Manager. If PVIManager and PVI Monitor are not on the same computer (remote communication type), this needs to be takeninto consideration.

The Snapshot function cannot be used with the Windows CE version of PVI Monitor. However, a standardversion of PVI Monitor is able to use the PVI Manager Snapshot function on Windows CE computers over aremote connection.

1.4.3 Snapshot Viewer

The Snapshot Viewer display the object information of a snapshot file in a structured tree view or in two lists.

It can be opened using the "PVI Snapshot Viewer" menu item in PVI Monitor.

The tree view shows the registered communication instances as well as the object structure for process objectsand service objects. Selecting an entry in the tree view shows all of the sub−level objects in the main list view(upper list). The extended list view (lower list) is enabled when an entry in the main list is selected and shows all

PVI base system

1.4.2 Snapshot Function 7

Page 14: PviBase

of the objects assigned.

In addition to the object name, the list view also displays the object ID, object status, and the object descriptionfor the PVI object. The object type is indicated by its icon.

Snapshot Viewer operations and functions:

Menu Key Function

File −> Open Snapshot File Ctrl+O Opens and displays a snapshot file.

File −> Make Topical Snapshot F5 Triggers a temporary snapshot to PVI Manager and displays it isthe Snapshot Viewer (only with the local communication type).

File −> Close Snapshot Closes the snapshot.

View −> Global Informations Ctrl+F10 Displays global snapshot information like the timestamp for thesnapshot function, current PVI settings, and the version of PVIand the operating system platform.

View −> Object Details F10 Displays complete information about an object.

View −> Up One Level Selects the next highest level of the object structure.

Options −> Filter Objects Ctrl+E Opens the dialog box for object filters.

Options −> Search Objects Ctrl+F Opens the dialog box for object searching.

Options −> Search Next Object F3 Finds the next object (according to the search criteria in theSearch Object dialog box).

Options −> Show Toolbar Shows/Hides the toolbar.

Options −> Show Extended List Shows/Hides the extended list.

Options −> Adapt Column Width Turns the automatic configuration of the column width in the listview on/off.

Options −> Display Colored Objects Turns the colored object display for highlighting the object statuson/off.

Help −> Documentation F1 Opens the PVI base documentation (only if installed).

Object status:

The object status is output in the "State" column in the list view and shows the status of the PVI objects at thepoint the snapshot is taken.

Statusdisplay

Description

Act Link, process, or service object is in an active state.

Idl Link, process, or service object is in an inactive state (idle).

NotRdy Link, process, or service object is in an undefined state.

Rdy Link, process, or service object is in a ready state.

Err Link, process, or service object is in an error state.

External External process object.

Internal Internal process object.

Temp Process object set up as a temporary process object.

Static Process object set up as a static process object.

Local Communication instance with a local communication type.

Remote Communication instance with a remote communication type.

Displaying the object status can be highlighted using a colored object display (Options −> Display ColoredObjects):

Color Object status

Green Object is active.

Blue Object is inactive.

Red Object is active and in an error state.

PVI base system

8 1.4.2 Snapshot Function

Page 15: PviBase

Magenta Object is inactive and in an error state.

Object description:

The object description is output in the "Description" column and shows (depending on the object type) thecurrent object description at the point the snapshot was taken. Communication instances show the parametersspecified when calling the PviInitialize or PviXInitialize function (TC − communication timeout in seconds, TR −retry time for PVICOM user messages in seconds).

Object filter:

The object filter is used to suppress the display of individual objects. The dialog box for filtering object is openedusing the "Options −> Filter Objects" menu item. This window allows objects to be displayed or not displayed,depending on the object status.

If every field in the dialog box is selected, then all objects are displayed ("Show All Objects" button). This is alsothe default after the Snapshot Viewer is run. The settings made in the image above would only display activeobjects. Higher−level and inactive objects will be grayed out in the list view.

Search Objects:

The object search can be used to find object names or a certain entry in object descriptions. The dialog box forsearching for objects is opened with the "Options −> Search Objects" menu item.

Pressing the "Search" button starts the search process. Searching always begins at the start of the object list,regardless of which object is selected in the tree or list view. If an object is found, it is displayed and highlighted

PVI base system

1.4.2 Snapshot Function 9

Page 16: PviBase

in the main list view. If you want to continue the search, you can either reopen the search dialog box and clickon the "Search Next" button or open the "Options −> Search Next Object" menu item.

Running the Snapshot Viewer without a PVI connection:

If the program argument "/Snapshot" or the name of snapshot file (must have ".snp" or ".pvisnp" extension) isspecified when PVI Monitor is started, then only the Snapshot Viewer is opened. The snapshot file provided isread and displayed immediately.

> c:\BrAutomation\Bin\PviMon /Snapshot

> c:\BrAutomation\Bin\PviMon "c:\BrAutomation\Log\Facility.pvisnp"

In this mode, a connection to PVI Manager is not established. The Snapshot Viewer can therefore be used as astand−alone tool, independent of PVI Manager, for displaying snapshot files.

1.4.4 Configuring the Data Logger for PVI Components

The Data Logger cannot be used with the Windows CE version of PVI Monitor. However, a Data Loggerincluded with a standard version of PVI Monitor can be set for Windows CE over a remote connection.

The main dialog box for configuring the Data Logger is opened using the PVI Monitor menu "Options −> PVIDiagnostics".

The "Details" button can be used to show or hide the list of components.

To enable the Data Logger for a certain PVI component, the respective entry must first be created in thecomponent list. The names of all components set up are displayed when the dialog box is expanded. To set upa new component, double−click on the first available line or mark any line and press "Insert" on the keyboard.This opens a second dialog for defining the component and setting its logger properties. To modify the loggerproperties of a component which has already been set up, double−click on the respective entry in thecomponent list. To delete a component from the list, first select it and then press the "Delete" key on thekeyboard. All of these functions can also be executed via the component list's shortcut menu (right mouse click).

Please note:Any changes made to logger settings in this dialog box only take effect after "Apply" is clicked. From that pointon, any settings made become effective. Restarting the components is not necessary. Changes requireadministrator rights.

Component dialog box for defining components and setting logger properties:

PVI base system

10 1.4.4 Configuring the Data Logger for PVI Components

Page 17: PviBase

Standard procedure for switching on the Data Logger:

Select the PVI Monitor menu "Options −> PVI Diagnostics" to open the main dialog box1. Set the "Global Mode" to "Log Details"2. Enable the "Global Verbose" checkbox and set the "Global Time Stamp" to "Time+Date"3. Click on "Details" to enlarge the dialog box4. Create and define all necessary components if they are not already in the component list5. Remove any unnecessary components from the component list or change their "Mode" to "Off" in thecomponent dialog box

6.

Make desired logger settings in the component dialog box for all required components7. Click on "Apply"8. Click on "Exit" to exit from the main dialog box9.

Standard procedure for switching off the Data Logger:

Select the PVI Monitor menu "Options −> PVI Diagnostics" to open the main dialog box1. Set the "Global Mode" to "Off"2. Click on "Apply"3. Click on "Exit" to exit from the main dialog box4.

Defining components:

The name of the desired PVI component is defined in the "Component" input field. This name consists of amaximum of three segments. Each of these segments is separated using a forward−slash ('/') character.Component names are not case sensitive.

<Program>[/<Module>][/<Section>]

Section Description

<Program> File name for the program where the component is being used in a process context. Thisprogram name needs to be specified completely.

<Module> If the desired component is a module (e.g. DLL), then the complete module file name needs tobe specified here. If the desired component is a program, then this segment does not need tobe specified.

<Section> Some PVI components divide logger output into several sections. The desired section isselected by specifying a section name.

An overview of the most important PVI components with logger output has been put together in the PVIComponents with Logger Output section.

PVI base system

1.4.4 Configuring the Data Logger for PVI Components 11

Page 18: PviBase

Setting the logging mode and verbose:

Setting the logging mode is crucial for logger output.

Loggingmode

Description

"Off" Logger output is turned off

"Log Errors" Logger output at Level 1 (PVILOG_ERROR): Only errors are logs.

"Log Mains" Logger output at Level 2 (PVILOG_MAIN): Errors as well as sequences at the interfaces (fromexternally controlled program flow) are logged.

"Log Details" Logger output at Level 3 (PVILOG_DETAIL): In addition to "Log Mains", internal functionprocesses are output (internal program flow).

The logging mode can be defined for each component in the "Mode" selection box. This selection is alsodisplayed in the "Mode" column in the main dialog box's component list. In addition, the logging mode can be setin the "Global Mode" field in the main dialog box. This setting works globally and limits the logging mode of allcomponents. If "Global Mode" is switched "Off", then logger output is turned off for all components. If "GlobalMode" is set to "Log Details", then logger information is output according to the logging mode of the individualcomponents.

Additional logger output is enabled by switching on Verbose mode. Some PVI components carry out a hexdumpoutput of data in Verbose mode. Verbose mode can be set in the component's dialog box with the "Verbose"check box. If Verbose mode is selected for a component, then a plus character "+" will appear in the "Mode"column in the component list in the main dialog box. Like the logging mode, Verbose mode can be switched onfor all components with the "Global Verbose" checkbox in the main dialog box.

The maximum amount of log information is output using the "Log Details" setting for the logging mode along withVerbose mode. Note, however, that logger output consumes a relatively large amount of computing time. Inpractice, all logger information is not usually necessary. In addition, changes in timing should be kept to aminimum as much as possible. Setting the logging mode and Verbose mode should therefore always beadapted to the problem at hand.

Setting the logger file:

Logger information is written as text (ASCII) to the logger file. The path name of this logger file is defined in the"File Name" field. Note that all directories specified in the path name have to already exist when logger outputstarts. Path specifications always refer to the component itself. If the component and PVI Monitor are not on thesame computer (remote connection), this needs to be taken into consideration. Each component is assigned aseparate file. Writing to one logger file with several components is not possible.

The Data Logger handles the file like a ring buffer. The size of the ring buffer corresponds to the file size definedin the "File Size" field. The file size is specified in KB. The default value for the file size if 1024 KB (1 MB). If alarger time frame is needed, then this file size needs to be increased accordingly.

Setting the output format:

Each logger entry begins with one or several ">" characters as well as a time stamp. The format of this timestamp can be set.

Format Description

"No" Instead of a time stamp, values in increasing order areoutput.

"Time" Outputs the current time

"Time+Date" Outputs the current data and time

The format of the time stamp can be defined for each component in the "Time Stamp" field. The time stampformat can also be set in the "Global Time Stamp" field in the main dialog box. This setting takes effect globallyand limits the time stamp format for all components. The default setting for the format is "Time". If logging shouldtake place over a period of several days, then the "Time+Date" setting may be more appropriate.

PVI base system

12 1.4.4 Configuring the Data Logger for PVI Components

Page 19: PviBase

The "Line Length" input field defines the maximum length of a text line in characters. Basically, each loggerentry begins on a new line. However, if the maximum line length is reached when writing, then output continueson a new line. The maximum line length is not meant to limit logger information; instead, it serves for betterlogger file readability. The default value for the maximum line length is 512 characters.

Backup logger files:

If a PVI component is started while the Data Logger is enabled (e.g. program) or initialized (e.g. DLL), then alogger file with the defined name is automatically created. If a file already exists with the same name, then itdeleted beforehand. By specifying a value greater than 0 (zero) in the "Backup Level" field in the component'sdialog box, this can be prevented. This value defines the maximum number of levels for backup files (maximum20). To prevent an existing logger file from being overwritten, the old logger file is renamed as a backup file eachtime it is opened. This new file name is also listed with a number. If the maximum number of backup file levels isreached, then the oldest file is erased (date of the last write access).

Break function:

In the logger file, old entries are always overwritten by newer entries (ring buffer). If a certain piece ofinformation (e.g. error situation or a program's initialization phase) should remain in the file, then the loggeroutput needs to stopped in time. This can be done manually by ending the program or setting the logging modeto "Off". This can also be done automatically using the break function.

The break function works on the text level. With the break function, conditions for breaking off the logging can bedefined using one or more text expressions. These text expressions may not contain blank characters. Individualtext expressions are linked together using the logical operators "&" (AND), "|" (OR), and "!" (NOT). At least onespace needs to be entered between the text expression and the operator. If an operator is not defined betweentwo text expressions, then the "&" (AND) operator is used. A maximum of 32 text expressions can be specifiedfor the break function. Hexdump output cannot be monitored with the break function.

Each individual text expression in the break function is compared with the text positions in the logger entry. If atleast one expression matches, then the result becomes 1 (TRUE). Otherwise, the result is 0 (FALSE). Case isnot taken into account when comparing text expressions (not case−sensitive). Then all section results are linkedwith the specified operators. The following is the order in which the operations are carried out: NOT, AND, OR. Ifthe entire result is 1 (TRUE), then the break condition is met.

The "Use Break Function" check box has to be selected to enable the break function in addition to a breakexpression in the "Expression" field. A certain time can optionally be defined between the break detection (breakcondition is met) and carrying out the break (stopping logger output). This break time is specified in the "BreakTime" field in milliseconds.

What happens when the break occurs can be selected in the component's dialog box:

Selection Description

"Break component logging" Logger output is only stopped for this component. If the component is restarted(e.g. program) or reinitialized (e.g. DLL), then logger output is reactivated.

"Turn−off global logging mode" Logger output is stopped for all components. This automatically switches theglobal logging mode to "Off". To turn logger output back on again, the loggingmode has to be set to the desired level in the main dialog box and "Apply"needs to be clicked.

Examples of break expressions:

Comm.WriteRequ & Ty=11 | Comm.ReadRequ & Ty=11

This break condition is met if the "Ty=11" text expression is output in a logger entry with either"Comm.WriteRequ" or "Comm.ReadRequ".

E=4808 & ! Comm.Event

This break condition is met if the "E=4808" text expression is output in a logger entry without the "Comm.Event"text expression.

PVI base system

1.4.4 Configuring the Data Logger for PVI Components 13

Page 20: PviBase

1.5 PVICOM Interface

The PVICOM interface (client interface) establishes access to the PVI at the lowest level. This represents the"tightest" and, regarding performance, the most optimal PVI interface. The PVICOM interface is also used by allother Windows−based components which have PVI access (PVI OPC, PVI DDE, PVI controls, etc.).

Communication via the PVICOM interface is handled with the functions in the PVI communication library,"PviCom.dll". The PVI communication library is a DLL (Dynamic Link Library) based on the Windows standard. Ifapplications use functions of a DLL, then the DLL has to be loaded explicitly with functions being declared, orthe static library "PviCom.lib" has to be bundled to the program (loaded implicitly). The procedure can be foundin the respective programming manual.

The following development environments are supported:

Visual C++ (Version 6.0 and up)• Visual Basic (Version 6.0 and up)• Borland C++ Builder (Version 3 and up)• Borland Delphi (Version 4 and up)• .NET connection (see Pvi.NET example)•

Files in the PVICOM interface:

PviCom.dll PVI communication library

PviCom.lib Static library for Visual C

PviCom.h Definition file (include file) for Visual C

PviCom.bas Definition file (include file) for Visual Basic

PviCom.pas Definition file (include file) for DELPHI

The PVICOM definition file contains definitions and/or declaration for all PVICOM interface functions, types,structures used, and PVI constants.

"Tools" has to be selected in PVI Setup to install the necessary files.

1.5.1 User Guidelines

As the base interface, the PVICOM interface must meet the needs of a visualization application, AutomationStudio, or a PVI server (PVI OPC, PVI DDE, PVI controls, etc.). This requires a certain amount of complexitywhen using functions and their options. This section here is meant to provide PVICOM users with preliminaryhelp and guidelines. The links here refer to the corresponding sections for the PVICOM interface description.

The following topics are covered here:

Establishing a connection to PVI Manager• Monitoring the communication connection to PVI Manager• Setting up object structures for process images• Selecting the PVI line for PLC communication• Setting up a connection to the process image• Using static or temporary process objects• Setting the process object state to active or inactive• Acquiring process data•

Establishing a connection to PVI Manager:

To be able to communicate with PVI Manager, you must first set up a communication instance. Thiscommunication instance establishes a connection between the PVICOM application and PVI Manager. ThePVICOM function PviInitialize or PviXInitialize must be called to set up a communication instance. This also setsup the communication type "local" (application and PVI Manager on the same computer) or "remote" (applicationand PVI Manager on different computers) as well as the timeout for life sign monitoring (communicationtimeout).

PVI base system

14 1.5 PVICOM Interface

Page 21: PviBase

Unlike the function "PviInitialize", "PviXInitialize" can be called more than once. Each call sets up a newcommunication instance. This allows a PVICOM application to be able to communicate with several PVIManagers on different computers. If a communication instance is set up with PviXInitialize, then PVICOMfunctions must subsequently be called with an instance handle (PviX...).

If a communication instance is no longer needed, then it has to be freed up with either the PviDeinitialize orPviXDeinitialize PVICOM function.

Monitoring the communication connection to PVI Manager:

Global events can be set so that the PVICOM application can monitor the communication connection to PVIManager of a communication instance. If PVI Manager is ended or the network connection (communication type"remote") is interrupted for a long time (communication timeout), then all link objects which have been set up, aswell as the communication instance's temporary process objects in PVI Manager, are lost. After the manager isrestarted or the communication connection is reestablished, the application has to set up these objects again.The global event POBJ_EVENT_PVI_ARRANGE notifies the application of when objects need to be recreated.

Using global events is an optional feature. We recommend evaluating global events when using the "remote"communication type in particular. With the global event POBJ_EVENT_PVI_ARRANGE, applications can eitherreestablish the last existing object state in PVI Manager (set up PVI objects and set to active or inactive) orprepare an initial status (e.g. object status of the start image).

Global events are set with the PVICOM function PviSetGlobEventMsg or PviXSetGlobEventMsg.

Setting up object structures for process images:

Accessing the data in a PLC variable or executing special services such as downloading/uploading modules,querying the CPU status, etc., are done via the process image. In PVI Manager, the process image isrepresented using the object structure. Object structures consist of individual process objects arranged in theform of a tree structure. Because of this, it is also called the process object tree. When setting up the processobject, the application also has to assign an object name. The user can select any name for this process objectname. Putting together the process object name with the object path can be done to ascertain an individualprocess object within the object structure (Object Name with Path Specification).

There are different types of process objects: base objects, line objects, device objects, station objects, CPUobjects, module objects, task objects, and variable objects. Each object type has a certain task in the objectstructure. The base object is the highest−level process object in the object structure. This object is alwayspresent and doesn't need to be set up. The line object determines the PVI line being used. Normally, deviceobjects, station objects, and CPU objects are used to establish the communication connection to the PLC andaddress a PLC in the network. Module objects, task objects, and variable objects represent a correspondingPLC object. The section of the object structure underneath the line object is set aside for the line being used.How individual process objects are to be arranged can be found in the section concerning PVI lines.

Process objects are created with the PVICOM function PviCreateRequest or PviXCreateRequest.

Selecting the PVI line for PLC communication:

The line object (process object of type POBJ_LINE) is used to select the desired PVI line. For this, the line namehas to be specified in the connection description.

The INA2000 line and the NET2000 line are provided for communication with B&R SG3 and SG4 (System 2000)controllers. The INA2000 line is the PVI standard line and supports module services (upload/download), onlineservices for Automation Studio, and variables services (reading/writing process data from PLC variables).INA2000 communication can take place using a serial RS232 or RS422 connection, a modem, or a CAN,Ethernet, or Profibus network. The NET2000 line only supports variable services. NET2000 communication cantake place using a modem, LS251, or serial RS232 or RS422 connection, as well as over a serial RS485network.

When using the serial RS232 or RS422 for communication (one or several point−to−point connections), theNET2000 line offers a higher data throughput as the INA2000 line. However, NET2000 protocol parametershave to have the right settings. The INA2000 line is better suited for network connections to more than one PLC.

PVI base system

1.5 PVICOM Interface 15

Page 22: PviBase

The MININET line is intended for B&R SG2 controllers (MULTI / MIDI / MINI and Compact). MININETcommunication can take place over a serial RS232 connection or an RS485 network.

Setting up a connection to the process image:

To establish a connection to a process object in the process image, the PVICOM application has to set up a linkobject. The application then uses this link object to access process data, object properties or object states of theprocess object, or to carry out special services.

Link objects are set up with the PVICOM function PviLinkRequest or PviXLinkRequest and released withPviUnlinkRequest or PviXUnlinkRequest.

Using static or temporary process objects:

A process object can be set up as a temporary or static process object (PVICOM function PviCreateRequest orPviXCreateRequest). A static process object is only set up once and remains throughout the entire runtime ofPVI Manager. A temporary process object is set up together with a link object. When the link object is released(PVICOM function PviUnlinkRequest or PviXUnlinkRequest) or when the PVICOM application is exited, thetemporary process object is also freed up.

A newly set up link object with a line connection triggers a process for either establishing a connection (stationobjects, CPU objects) or for PLC object identification (module objects, task objects, variable objects). Dependingon the line being used, this process can take some time to complete. If the process object is released and thenfreshly set up again, then this process has to be repeated. It is therefore an advantage if PVICOM applicationsonly have to set up process objects once.

Static process objects are advantageous in the following situations:

A PVICOM application which is started and stopped many times and which needs a large number ofprocess objects

The object structure should be managed centrally. At the start (e.g. Windows start−up), a generator orconfigurator (as the PVICOM application) sets up all required process objects. To do so, informationabout the object structure can be read from an ASCII text file or database. Then the application can beended again.

An interface server which remains active during the entire PVI Manager runtime and providesinformation about the necessary object structure right after being started. In principle, interface serverscan also use temporary process objects. However, all link objects then need to remain set up at runtime.

Temporary process objects are advantageous in the following situations:

A PVICOM application which is not started and stopped many times or which needs just a few processobjects

Process objects which are only used briefly in a PVICOM application and which are seldom needed(e.g. for carrying out services)

If the connection description of a process object is modified during runtime (access typePOBJ_ACC_CONNECT), then it and all subordinate objects should be set up as temporary processobjects.

The points mentioned above are only intended as decision guidance. The type of process object used by thePVICOM application needs to be decided according to requirements. However, if in doubt, temporary processobjects are preferred since they are more easily handled.

For more information, see the Static and Temporary Process Objects section.

Setting the process object state to active or inactive:

Each process object can be in either an active or inactive state. This state is controlled by the link object. Inprinciple, PVICOM applications should only keep process objects in an active state if they are needed at thatmoment. All other process objects should be set to inactive. This applies to variable objects in particular.

There are basically 2 methods for a PVICOM application to set a process object to active or inactive duringruntime:

PVI base system

16 1.5 PVICOM Interface

Page 23: PviBase

The existence of at least one link object sets the state to active:Example for visualization: At the start, all necessary process objects are set up as static objects. Thenthe application can set up the link objects for all of the process objects used in the picture by enabling it.If the picture is turned off, then the link objects from the application are released again. If two or morepicture are enabled at the same time, then there are two or more link objects present for each processobject used together. The advantage of this method is that each picture only has to be aware of its ownprocess objects. Event data is automatically distributed to the individual pictures via the link objects. Apicture−comprehensive management of process object states and event data is therefore notnecessary.

1.

The active or inactive state is set using the enable mask, aided by access type POBJ_ACC_EVMASK:Example for visualization: The application sets up all necessary process objects (static or temporary)each with a link object during the initialization phase. If a picture is enabled or turned off, then theapplication sets all of the process objects in the picture to the desired active or inactive state usingaccess type POBJ_ACC_EVMASK. However, this method requires a central management of processobject states and event data. If several pictures use the same process objects, then the active andinactive states have to be coordinated with one another. The event data read has to be distributed to theactive pictures.

2.

For more information, see the Process Object State Active or Inactive section.

Acquiring process data:

Process data is always read using PVI variable objects (process objects of type POBJ_PVAR). Each variableobject holds an image of a PLC variable. To update this image, variable data is read from the PLC.

There are basically 3 ways to acquire data:

Data is gotten through cyclic read instructions (standard method):PVI sends cyclic read instructions to the PLC. The object attribute 'e' cannot be specified. The refreshtime determines the read cycle.Example for the process object description: "CD=var1 AT=rw RF=250".

1.

Data is gotten through event variables:Event variables are set up on the PLC. They only send their process data to PVI when they havechanged. The object attribute 'e' must be specified. The refresh time defines the PLC−internal readcycle here.Example for the process object description: "CD=var1 AT=erw RF=250".

2.

Data acquisition is controlled by the PVICOM application:Either 0 (zero) or −1 is set for the refresh time. The application itself determines when data is gotten bycalling the PviReadRequest or PviXReadRequest and using access type POBJ_ACC_DATA. With thismethod, process data can be received either as response data from the read instruction or as eventdata. It is not recommended to define a user message to occur for response data when the readinstruction is given. The process data is then sent to the application as event data, like the other types ofdata acquisition. However, this method is not suitable for read cycles less than 1 second.Example for the process object description: "CD=var1 AT=rw RF=0".

3.

1.5.2 Client/Server Communication

This section deals with the communication between a PVICOM application and the PVI Manager. Thecommunication between PVI and the PLC is described in the PVI Lines section.

The PVICOM interface acts according to the client/server principle. The PVI Manager acts as the server, and thePVICOM applications are the clients. Servers and clients can be on the same machine (local) or on differentcomputers (remote). When local communication is used, data is exchanged using a shared memory area.Remote communication exchanges data over a TCP/IP network. The communication type determines the typeof client/server connection. Each PVICOM client/server connection is handled using one communicationinstance.

The PVICOM interface allows an application to set up several communication instances. In this way, anapplication can exchange data with several PVI Managers at the same time. Theoretically, up to 65,534communication instances can be registered on one PVI Manager.

PVI base system

1.5.2 Client/Server Communication 17

Page 24: PviBase

1.5.2.1 Communication Instances

To set up a PVICOM communication instance, an application must first call the PVICOM function PviInitialize orPviXInitialize. This will also determine the communication type (local or remote) and the timeout for the life signmonitoring (communication timeout). Setting up also initiates the communication instance (client) registration forthe PVI Manager (server).

If a communication instance is set up, PVICOM functions can send requests to the PVI Manager in addition tothe definition of a user message. After the PVI Manager sends back an appropriate response, the user messagedefined with the request is carried out (Request and Respond). Using this method, the application is able to setup PVI connection and process objects, access dates, conditions, or properties, and free up PVI objects. Whensetting up a link object, a user message can also be defined to signal object events.

If a PVICOM communication instance is no longer needed, then it has to be freed up with either thePviDeinitialize or PviXDeinitialize PVICOM function. This also de−registers the communication instance (client)for the PVI Manager (server).

Each set up PVI link object is assigned to a certain communication instance (client). If a communication instanceis de−registered from the PVI Manager, then all assigned link objects as well as temporary process objects areautomatically freed up.

Each PVICOM communication connection has life sign monitoring. This checks the function of the connection byway of cyclic data exchange. If communication cannot take place within the defined communication timeout (e.g.network connection is interrupted), then the PVI Manager automatically de−registers the communicationinstance. The same thing happens when the PVI Manager is ended. However, the communication instancecontinues to exist on the side of the application (client). It keeps trying (cyclically) to register with the PVIManager (server). If the registration is successful (e.g. network connection could be reestablished or PVIManager is restarted), then client/server communication can begin again immediately. It is important to note,however, that all link objects which were assigned, as well as all temporary process objects in the PVI Manager,were released when the communication instance was de−registered. These objects therefore have to be set upagain by the PVICOM application after the communication connection is reestablished. The PVICOM interfaceuses global events (see also the PviSetGlobEventMsg or PviXSetGlobEventMsg function) to signal theapplication as to the state of the communication connection.

1.5.2.2 Communication Type

The communication type defines the type of connection between a PVICOM application communication instance(client) and the PVI Manager (server). This communication type only refers to PVICOM client/servercommunication and has nothing to do with the data being exchanged between the PVI Manager and a controller(PLC).

The following communication types can be used:

Local The PVI Manager and the PVICOM application are located on the same computer. Data is exchangedusing a shared memory area.

Remote The PVI Manager and the PVICOM application can be located on separate computers. Data isexchanged over a TCP/IP network.

The type of communication is defined by specifying the IP initialization parameter when the PviInitialize functionis called.

If the IP parameter is not specified, then the "local" communication type is used. The PVI Manager is alsostarted automatically when the function is called using local communication (can be turned off with the ASinitialization parameter).

If the IP initialization parameter is specified, then the communication type is set to "remote" and client/servercommunication is handled over a TCP/IP network. The IP parameter specifies the IP address or the host nameof the server computer (PVI Manager). The TCP/IP port number can be specified with the PN initializationparameter.

If the host name of the server computer is specified, then the system must determine the corresponding IPaddress. The procedure is as follows:

PVI base system

18 1.5.2.1 Communication Instances

Page 25: PviBase

Host name of the local computer1. Name entries in the HOSTS file2. The DNS server is queried (if present)3. NetBIOS4.

With the local IP address "IP=127.0.0.1", communication can take place with a local PVI Manager even whenthe remote communication type is being used. However, since a local connection works faster than a remoteconnection, communication type "local" should always be used on a local PVI Manager.

The following prerequisites are necessary for this communication type "remote":

Network connection between both controllers1. TCP/IP protocol must be installed as network components on both controllers2. A unique IP address must be specified on both computers3. The Windows socket DLL wsock32.dll with a version >= 1.1 must be present on both computers4. PVI must be installed on both computers, the same version if possible Basically however, only thecommunication library PviCom.dll and PviLog.dll are needed on the client computer (PVICOMapplication).

5.

TCP/IP communication has to be enabled and an available port number assigned on the servercomputer (PVI Manager) using PVI Manager properties. No other TCP/IP server can use the same portnumber. The port number used here must also be set in the application with the PN initializationparameter.PVI Manager has to be restarted to apply any changes.

6.

Note:A basic function check of TCP/IP communication can be done using the DOS utility program, "ping.exe".

1.5.3 Global Events

Global events are formed in the PVICOM communication instance and are used to signal the state of theconnection between the instance and the PVI Manager (client/server). In order to receive a certain global event,the application has to assign it a user message. This assignment is done with the PVICOM functionPviSetGlobEventMsg or PviXSetGlobEventMsg. The following picture shows the basic sequence for globalevents.

A PVICOM communication instance can trigger the following global events:

Event type No. Description

POBJ_EVENT_PVI_CONNECT #240 The communication instance (client) established the connection to thePVI Manager (server).

POBJ_EVENT_PVI_DISCONN #241

PVI base system

1.5.3 Global Events 19

Page 26: PviBase

The connection between the communication instance (client) to the PVIManager was interrupted (server). The corresponding error code isreported with the event data. The communication timeout plays themain role in recognizing the disruption in the client/server connection.The communication timeout is defined with the PviInitialize orPviXInitialize function.

POBJ_EVENT_PVI_ARRANGE #242 This event signals that the communication instance has been newlyregistered with the PVI Manager. This event can only be triggered ifthere is a valid client/server connection.

The global events POBJ_EVENT_PVI_CONNECT and POBJ_EVENT_PVI_DISCONN only signal the state ofthe client/server connection. In contrast, the POBJ_EVENT_PVI_ARRANGE event signals the application whenlink objects and temporary process objects have to be set up again. If there is a longer interruption in theclient/server connection (doubled communication timeout), then the PVI Manager automatically de−registers thecommunication instance and releases all assigned link objects. If the connection is established later, then thePVICOM application has to set up all objects again. The POBJ_EVENT_PVI_ARRANGE event can be used toautomatically control this procedure.

As for object events, the PVICOM function PviReadResponse or PviXReadResponse has to be called to readevent data and confirm when responses are received. Information about the event can be read beforehand withthe PVICOM function PviGetResponseInfo or PviXGetResponseInfo. An exception is using the callback functionof type PVICALLBACK_DATA as a user message. Since response data is passed along directly to the callbackfunction, it does not have to be read using a PVICOM function.

1.5.4 Objects

In PVI Manager, the process image is managed using process objects. When creating a process object, thePVICOM application also has to assign an object name. Applications can then create link objects using theobject name to establish one or more connections to a process object.

The service object assigns an external object to a process object. Objects which reside outside of PVI are calledexternal objects (e.g. PLC objects). A connection name is assigned to each service object. The connectionname is a component of a process object's connection description.

The uniqueness of the name makes sure that all process objects with the same connection name use the sameservice object and all link objects with the same object name use the same process object. In this way, severalprocess objects can be assigned to one service object, and several link objects can be assigned to one processobject.

PVI base system

20 1.5.4 Objects

Page 27: PviBase

1.5.4.1 Process Objects

Process objects are created with the PVICOM function PviCreateRequest or PviXCreateRequest. They are thecentral part of managing the process image in PVI Manager.

Process objects are divided into different object types. Each object type either represents a certain logical orphysical part of the communication connection or an object within the line or on the PLC.

Object type Description Usage

Binary String

POBJ_PVI #0 Pvi Base object PVI Manager base object

POBJ_LINE #1 Line Line object Represents the PVI line being used (line server)

POBJ_DEVICE #2 Device Device object Represents the physics of the network communication or acommunication device

POBJ_STATION #3 Station Station object Represents a station in a network

POBJ_CPU #4 Cpu CPU object Represents a PLC in a network

POBJ_MODULE #5 Module Module object Represents a module in a station or a CPU (PLC object)

POBJ_TASK #6 Task Task object Represents a task or process in a station, CPU, or module (PLCobject)

POBJ_PVAR #7 Pvar Variableobject

Represents a variable in a station, CPU, module, or task (PLCtask), or a PVI−internal variable

The order in which the object types are listed in the table corresponds to the object hierarchy. Starting from thePVI base object, each process object is assigned to another process object. However according to the objecthierarchy, only objects with a higher−level object type can be assigned. This means that a variable object canbe assigned to all other process objects except a variable object. A line object can only be assigned to the PVIbase object. These assignments lead to a tree structure with the PVI base object as the root. This processobject tree is also called the object structure.

An object name is assigned to each process object. The object path defines a process object contained withinthe object structure. The object name and names of the subordinate process objects are specified in the objectpath. Individual names are separated by a "/" character. Optionally, a process object type can also be specifiedto each name. The object path makes it possible to determine each process object within an object structure.

Example of an object structure (process object tree):

The PVI base object is managed automatically by PVI Manager. It is always present during the PVI Managerruntime. Applications don't need to set up or delete this object. The name of the base object is "Pvi".

PVI base system

1.5.4.1 Process Objects 21

Page 28: PviBase

The line object assigns a PVI line to a subset of the object structure. This automatically assigns all processobjects to the line which are assigned to the line object. The object structure underneath the line object dependson the line being used.

1.5.4.1.1 External and Internal Process Objects

External process objects have a line connection. This means that they are assigned to a certain PVI line with theline object and represent a component of the communication connection or an object in the line or on the PLC. Aconnection description (CD parameter) and therefore a service object are assigned to external process objects.

Internal process objects do not have a line connection and are therefore not assigned to a PVI line. They haveto be directly assigned to the PVI base object and have either no or an empty (null string) connectiondescription. Because of this, a service object is also not assigned to an internal process object. All processobjects in the object structure underneath an internal process object are also internal process objectsautomatically regardless of their connection description.

Basically, process objects from each object type can be set as internal process objects. However, not all accesstypes supported by the line can be used for internal process objects (e.g. upload, download, reading CPUstatus, etc.). In this case, Error 12058 (Access type not supported) is reported.

Internal variable objects can use the functionalities of the process image though. In this way, they can be usedas PVI constants or to exchange data between PVICOM applications. The DV parameter in the process objectdescription can be used to assign process data when creating an internal variable object.

1.5.4.1.2 Undefined, Ready, or Error Process Object States

After being created, external process objects are Undefined. After being identified by the PVI line being used,the state becomes Ready or Error and the corresponding object event POBJ_EVENT_ERROR orPOBJ_EVENT_DATA (if enabled) is carried out.

Depending on the object type, if the state is Ready, then an existing PLC communication connection or a validobject identification is signaled by the PVI line. In the same way, an Error state signals a faulty PLCcommunication connection or an invalid object identification. The type of error is given by the error code. Aprocess object's error state is passed down. In other words, all process objects in the object structureunderneath the erroneous process object receive the same error condition. TheRESP_STATUS_INHERIT_ERR flag is set with the POBJ_EVENT_ERROR object event in the status of theevent data (RESPONSE_INFO structure).

1.5.4.1.3 Active or Inactive Process Object States

Each process object can be in either an active or inactive state. If at least one link object is assigned to theprocess object with an enabled POBJ_EVENT_ERROR or POBJ_EVENT_DATA event, then the process objecttakes on an active state. Otherwise, it is inactive. Process objects with an active state are given priority whenbeing identified by the PVI line. Active or inactive states control process data acquisition for variable objects. Forinactive process objects, process data is not read and PLC communication is not burdened. PVICOMapplications should therefore only keep the process objects which are needed at the time in an active state.

1.5.4.1.4 Static and Temporary Process Objects

A process object can be created either as a temporary or static process object. Both types of objects work thesame way. There is only a difference when creating and enabling the process object.

A static process object is created with the PVICOM function PviCreateRequest or PviXCreateRequest. Toestablish a connection to a static process object, the PVICOM function PviLinkRequest or PviXLinkRequest hasto be used. Static process objects remain throughout the entire runtime of PVI Manager. They also remain if thePVICOM application is ended. Error 12002 (Object name already exists) is reported if you try to create aprocess object which is already present. PVICOM applications can query this error and react accordingly.Process objects can be deleted using the PVICOM function PviDeleteRequest or PviXDeleteRequest. However,this isn't how static process objects should be used. The delete function is only intended for the configurationprogram.

A temporary process object is always created together with a link object. The PVICOM functionPviCreateRequest or PviXCreateRequest are used to do this. Unlike static process objects, calling the

PVI base system

22 1.5.4.1 Process Objects

Page 29: PviBase

PviLinkRequest function is not necessary. An error is not reported if you try to create a process object whichalready exists. Instead, a link object to the already existing process object is created. The process objectdescription specified in the PviCreateRequest function is not applied in this case. Temporary process objectsremain as long as one link object or one other process object is assigned to this process object. Releasing thelast link objects automatically deletes the process object.

A newly set up link object with a line connection triggers a process for either establishing a connection (stationobjects, CPU objects) or for PLC object identification (module objects, task objects, variable objects). Dependingon the line being used, this process can take some time to complete. If the process object is released and thenfreshly set up again, then this process has to be repeated. It is therefore an advantage if PVICOM applicationsonly have to set up process objects once.

1.5.4.2 Link Objects

Link objects are set up with the PVICOM function PviLinkRequest or PviXLinkRequest or with PviCreateRequestor PviXCreateRequest. Releasing link objects takes place using the PVICOM function PviUnlinkRequest orPviXUnlinkRequest or with the PviUnlinkAll function. If the PVICOM communication instance is released(PviDeinitialize or PviXDeinitialize), then all links objects for this communication instance are also released.

A link object established the connection for the PVICOM application to a PVI Manager process object. Theapplication then uses this link object to access process data, process object properties or states, or to carry outspecial services (Request and Respond). The enable mask for object events is also managed in the link object.

If the POBJ_EVENT_ERROR or POBJ_EVENT_DATA event is enabled in the enable mask of the link object,then the process object receives an Active state. If there is no link object with an enabledPOBJ_EVENT_ERROR or POBJ_EVENT_DATA event, then the process object receives the Inactive state.

The PVICOM interface provides 2 methods of modifying the active or inactive state of a process object atruntime:

The existence of at least one link object sets the state to active:If event data is needed, then a link object with the required enabled mask needs to be created (e.g."EV=ed"). If this event data is not longer needed, then link object is released once more. However, it isrequired that all process objects remain in use during runtime. Because of this, this method is primarilyintended for static process objects.

1.

The active or inactive state is set using the enable mask, aided by access type POBJ_ACC_EVMASK:The link object always remains in use here. If event data is needed, then the enable mask needs to beactivated (e.g. "EV=ed"). If the event data is no longer needed, then the enable mask needs to bedeactivated "EV=". Since the link object remains in use, this method is especially suitable for temporaryprocess objects. However, it can also be used for static process objects.

2.

1.5.4.3 Service Objects

A service object assigns a PVI line or an object in a line (communication object or PLC object) to a processobject. Service objects are automatically managed by PVI Manager depending on the definition of the processobject's connection description and the line being used.

1.5.5 Object Names and Connection Descriptions

The object name is the name of a process object in PVI Manager. The connection description consists of theconnection name as well as (usually) optional connection parameters. The connection name is the name of theservice object being used in PVI Manager. The connection description is defined with the CD parameter in theprocess object description when creating the process object or with the POBJ_ACC_CONNECT access type.

For line objects (process objects of type POBJ_LINE), the connection name is defined as the name of the PVIline. PVI Setup stores the names of all installed lines (line servers) in the Windows registry. As an alternative,the path name of the line DLL's can be specified as the connection name.

Evaluating the connection description is carried out by the specified PVI line for all process objects assigned to aline object. The syntax of the connection description therefore depends on the line being used. Internal processobjects either have no connection description or an empty connection description (null string) and are assigneddirectly to the PVI base object (process objects of type POBJ_PVI).

PVI base system

1.5.4.2 Link Objects 23

Page 30: PviBase

All ASCII characters except for the control characters (< code 32), the "/" character (slash), spaces, and the DELcharacter (code 127) can be used. If one of these prohibited characters is used in a name, then the name has tobe surrounded by quotation marks ("...."). PVI then interprets all the characters between the quotation marks asthe process object name. When specifying path names, note that syntactical characters ("/" or "@") and nameparameters (OT parameter) are not a part of the actual process object name and therefore must remain outsideof the quotation marks.

Process object names can be defined as unique object names or as object names with a path specification. The"@" character at the beginning of an object name determines the type of name assignment.

1.5.5.1 Object Names with Path Specification

An object path is specified together with the object name. The object path defines the position of the processobject within the object structure. The object path must always start from an object with a unique object name.The PVI base object is automatically created when PVI Manager is started and has a unique object name. Ifadditional process objects with unique object names have not been created, then the object path must alwaysbe defined starting from the PVI base object. Object names specified with a path must begin with the "@"character. The names of the individual objects within the path must be separated by a "/" character.

In contrast to the method with unique object names, several objects with the same name can be created here.These objects have to be different in either the object assignments or in the object types. For example, avariable object can be created under the "Task1" task object and a second variable object can be created withthe same name under the "Task2" task object. A task object and a module object can also be created with thename name under the same CPU object.

In addition, an object type can be specified for all object names in the object path (OT parameter). This candifferentiate between process objects which have the same name.

The following object types can be specified:

Object type Description

Pvi PVI baseobject

Line Line object

Device Device object

Station Station object

Cpu CPU object

Module Module object

Task Task object

Pvar Variableobject

Object name syntax:

@[/]Pvi/ ... /<ObjectName − 1> [OT=<ObjectType>]/<ObjectName> [OT=<ObjectType>]

Connection description syntax:

CD=<Connection>

Examples:

A device object with the name "DEVICE 1" should be created under the existing line object "LNINA2":

Object Name:@Pvi/LNINA2/"DEVICE 1"Connection description:CD="/IF=com1 /BD=57600 /PA=2"

The PLC variable "Temperature" should be read. To do so, a variable object named "HeaterTemp" should becreated under the existing task object "Heater":

PVI base system

24 1.5.5.1 Object Names with Path Specification

Page 31: PviBase

Object Name:@Pvi/LNINA2 OT=Line/"DEVICE 1" OT=Device/CPU OT=Cpu/Heater OT=Task/HeaterTemp OT=PvarConnection description:CD=Temperature

1.5.5.2 Unique Object Names

All process objects are defined with a object name unique within PVI Manager. This name must not be the sameeven for process objects with varying object types. Unique object names may not begin with the "@".

The object hierarchy in PVI Manager is defined with the first part of the connection description. Either the wholepath to the PVI base object can be specified or just the name of the process object at the next highest level.

The connection is outwardly defined with the second part of the connection description.

Object name syntax:

<ObjectName>

Connection description syntax:

CD=[[[/]Pvi/ ... /]<ObjectName − 1>/]<Connection>

Examples:

A device object with the name "DEVICE 1" should be created under the existing line object "LNINA2":

Object Name:DEVICE 1Connection description:CD=LNINA2/"/IF=com1 /BD=57600 /PA=2"

The PLC variable "Temperature" should be read. To do so, a variable object named "HeaterTemp" should becreated under the existing task object "Heater":

Object Name:HeaterTempConnection description:CD=/Pvi/LNINA2/"DEVICE 1"/CPU/Heater/TemperatureThe specification is identical to: CD=Heater/Temperature

1.5.6 Object descriptions

Object properties are set with the object description when a process or link object is set up. The objectdescription is specified as an ASCII string and terminated with a binary 0 (null).

The individual parameters are differentiated in the string using parameter codes:

<ParameterCode> = ["]<ParameterValue>["]

All alphanumeric characters, special characters "[" (open bracket), "]" (closed bracket), "$" (dollar sign), "*"(asterisk), "+" (plus sign), "−" (minus sign), "," (comma), "." (period), ";" (semicolon), "_" (underscore), as well asASCII characters above 127 can be used as parameter values. If other characters are used (e.g. spaces or the"/" character), then the parameter value has to be specified inside quotation marks ("..."). At least one blankspace needs to be between individual parameter entries.

The following table shows all parameters which can be defined in an object description. The "Obj." columnindicates where (in which object description) the parameter can be specified. The letter "L" stands for the linkobject description and "P" stands for the process object description. Only the CD and EV parameters can beused for all process object types. All other parameters can only be defined in connection with link objects. Thecorresponding access type is indicated in the "Access type" column. Object properties can be set or modified ata later time using this access type.

Par. Obj. Access types Description

PVI base system

1.5.5.2 Unique Object Names 25

Page 32: PviBase

CD P POBJ_ACC_CONNECT Connection descriptionThis parameter can be specified for all process object types (except forPVI base objects).

EV C POBJ_ACC_EVMASK Definition of the enable mask for object events. Default: "EV=ed"."e": Change in error state"d": Change in data"f": Change in data format"c": Change in the connection description"p": Progress information about active requests"s": Status chanes'u': Change in the user tag string'l': Special line eventsExample: "EV=edfc"If no events should be enabled, then specify "EV=".

LT C Link type (see "Process Data Functions" section). Default: "LT=raw"."raw": Raw value"prc": Process value

AT P POBJ_ACC_TYPE Object attributes. Default: "AT=rw""r": Allows read access"w": Allows write access"e": PLC event operation"h": Immediate write echo if access type POBJ_ACC_DATA"d": Direct event trigger for the POBJ_EVENT_DATA event

RF P POBJ_ACC_REFRESH Refresh rate in ms. Default: "RF=1000".=−1: Cyclic data refresh is turned off= 0: Data refresh is only carried out once> 0: Cyclic data refresh is carried out with the specified refresh rate

VT P+L POBJ_ACC_TYPE Variable type (data format). Default in the process object: "VT=i32""i8", "i16", "i32", "i64": 8 to 64−bit signed integer"u8", "u16", "u32", "u64": 8 to 64−bit unsigned integer"f32", "f64": 32/64−bit floating point"boolean": Flag with element length of 1 byte"string": String with 8−bit character size"struct": Structure"time": 32−bit time in ms since midnight"dt": 32−bit date and time in seconds since 1/1/1968"data": General variable type with 1 byte element length

VL P+L POBJ_ACC_TYPE Variable length in bytes (data format). This parameter can only bespecified together with the VT parameter.For single variables, the variable length corresponds to the process datalength. For array variables, the variable length is defined as the elementlength. This parameter does not need to be specified when used inconjunction with variable types which have a fixed variable length (e.g.VT=i32 always has a variable length of 4 bytes).

VN P+L POBJ_ACC_TYPE Number of elements for array variables (data format). Default: VN=1.This parameter can only be specified together with the VT parameter.

{...} P+L POBJ_ACC_TYPE Definition of structure elements(data format)The definition of the structure element must be specified at the end of theobject description. First the nesting depth is defined by a number of "."'s(periods) within each expression in parentheses. Then element variablesare defined.

AL P+L POBJ_ACC_TYPE Structure alignment (data format). 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 P+L POBJ_ACC_TYPE Mode for type casting (cast mode). Default: "CM=0".The mode is defined as a bit list and controls type casting between linkand process objects.Bit 0: String variable for PG2000 or AS 1.3Bit 1: String contents are interpreted as a decimal numberBit 2: Value range is monitored

PVI base system

26 1.5.5.2 Unique Object Names

Page 33: PviBase

Bit 3: Rounding takes place when type casting from a float to an integerBit 4: Strings are always terminated with 0 (null).

VA C Variable addressing. Default: No variable addressingUsing variable addressing, link objects can address subsets from theprocess data of a variable object.

DV P POBJ_ACC_DEFAULT Default value for single variables (process data).This parameter can be used to assign a default data value to processvariable objects of type Integer, Floating Point, Boolean, or String. If thisparameter is specified, then a data format also has to be defined in theobject description. This default value is only written to the process imagebut is not transferred to the PLC.Examples: DV=123, DV=2.561e10, DV="string format"

HY P+L POBJ_ACC_HYSTERESE Assigned event hysteresis. Default: No hysteresisDefinition of event hysteresis for single variables or array variables oftype Integer or Floating Point. Event hysteresis is specified as ahysteresis value.Examples: HY=10, HY=2.5

FS P+L POBJ_ACC_FUNCTION Assigned data function. Default: No functionDefinition of a data function for single variables or array variables of typeInteger or Floating Point. The data function is specified as a functiondescription.

UT P POBJ_ACC_USERTAG With user tags, PVI applications can assign a private user code orspecific user data to a process object (module, task, or variable object) inthe form of a string. User tags are only managed by PVI, not evaluated.

1.5.7 User messages

PVI uses user messages to signal the existence of response or event data in the PVICOM communicationinstance to the PVI application.

User messages can be controlled as a Windows message or as a callback function. Three different types ofcallback functions can be used.

Summary of the different types of user messages:

Windows message Signals using a Windows message. Response or event data is read using theresponse function.Preferred variation for Visual C/C++ applications.

Callback with data Signals using a callback function. Response or event data is transferred using thecallback function.Preferred variation for Visual Basic applications.

Callback without data Signals using a callback function. Response or event data is read using the responsefunction.

Asynchronous callback Signals using an asynchronous callback function. Response or event data is readusing the response function.

A PVICOM application can also use the different user message variants with one another. For example, eventdata can register to the application as a Windows message and response data as callback.

A user message is defined using three parameters:

Message pointer/handle1. Message number2. Message parameter3.

1.5.7.1 User message operation

If PVI Manager (server) sends response or event data to the PVICOM communication instance (client), then thedata is stored in the client temporarily and the application is notified with a user message. The application mustthen react to the user message and call the corresponding PVICOM response function. Once that happens, the

PVI base system

1.5.7 User messages 27

Page 34: PviBase

data is read and the data memory area in the client is freed up. If the application "forgets" to call the responsefunction, then the data remains and occupies memory in the communication instance.

Two parameters that are defined when the function PviInitialize or PviXInitialize is called by the user areimportant for handling user messages in the PVICOM interface:

Initialization parameter LM (limit of PVICOM user messages)1. "RetryTime" (retry type for PVICOM user messages)2.

The initialization parameter LM can be used to limit the number of user messages per communication instance.If limiting is enabled (limit value > 0), then it doesn't mean user messages are lost. Instead, it refers to how theyare distributed in time. A setting of "LM=100" means that the PVICOM sends a maximum of 100 user messagesto the application. An additional user message is then only sent once the application has reacted to a usermessage which has already been sent and has called the corresponding PVICOM response function. With thesetting "LM=1", each new user message is sent only when the previous user message has been processed. Ifthe application "forgets" to call the response function, then an additional user message is not sent. This makesfinding errors in a PVICOM application easier. For this reason, this is the setting used by default by the PVIinterface. The disadvantage, however, is that user messages are delayed. Applications that can quickly andcorrectly process a user message (e.g. servers) should therefore have the limit disabled ("LM=0) or a higherlimit value set ("LM=100", "LM=1000"). Unfortunately, applications which run in Windows 95 have a problem.Unlike other Win32 platforms, the Windows 95 message queue has a fixed size. If the message queue is full(user messages and "normal" Windows messages), then additional messages are not entered and are lost(Windows doesn't report an error with "PostMessage"). Applications which run under Windows 95 musttherefore have user message limitations enabled with a value set between 1 and a maximum of 500 (e.g."LM=100).

The "RetryTime" parameter (specified in seconds) can be used to set user message repeats. If a user messageis not confirmed by calling the corresponding "Response" function, then the same user message is re−sent afterthe "RetryTime" expires. This procedure is repeated until the application acknowledges the user message.Retrying user messages should only be enabled in connection with the initialization parameter setting "LM=1" sothat the time sequence of response and event data can be adhered to. In principle, retrying user messages isonly necessary when debugging Visual Basic applications (occurring with VB 5.0). If the application's executionis stopped by a breakpoint, then the callback function (user message) is not carried out. The user messagetherefore has to be re−sent by the PVICOM interface. However, user messages are not lost in "normal"operation of VB applications and usually with VC applications. In these cases, it is recommended to disable usermessage retries ("RetryTime=0").

The initialization parameter LM and the "RetryTime" parameter do not mean anything when using the callbackfunction of type PVICALLBACK_DATA as a user message.

1.5.7.2 User messages as window messages

The message handle is defined as the handle for the allocated window (type HWND) for this user message. Themessage number is defined as the window message number. A user parameter can be specified as a messageparameter. This message parameter is not evaluated by the PVICOM interface but is passed through with theuser message. Signaling the user message is done as a "post message".

In the application's window procedure assigned by the message handle, user message data is transferred asfollows:

WinProc (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)

Window procedure arguments:

Argument Description

nMsg Message number

wParam Reference to response or event data (for PVI response functions)

lParam Message parameter (4 bytes)

After the user message is received, the application can use the PviGetResponseInfo or PviXGetResponseInfofunction to read information about the data assigned to the user message. The application receives the

PVI base system

28 1.5.7.2 User messages as window messages

Page 35: PviBase

response or event data by calling the corresponding PVI response function (Pvi...Response or PviX...Reponse).The response function has to be called with each user message. Otherwise, the data buffer for the response orevent data is not released.

When possible, applications should use this variant for user messages. Applications in programming languageswhich do not support "private" window messages (e.g. Visual Basic) have to use one of the callback variants.

Example for Visual C++

#include <PviCom.h>

class CPviDlg : public CDialog{ ... DWORD m_hPv; DWORD m_PvData; DWORD m_PvStatus;

void MakePviReadRequ (); LRESULT OnPviReadResp (WPARAM, LPARAM); ... DECLARE_MESSAGE_MAP()};

BEGIN_MESSAGE_MAP(CPviDlg, CDialog) ... ON_MESSAGE (WM_USER+1, OnPviReadResp)END_MESSAGE_MAP()

LRESULT CPviDlg::OnPviReadResp (WPARAM wParam, LPARAM lParam){ T_RESPONSE_INFO Info; long ErrCode;

// read response status: ErrCode = PviGetResponseInfo (wParam, NULL, NULL, &Info, sizeof(Info)); if (ErrCode == 0) m_PvStatus = Info.Status; ...

// read response data: ErrCode = PviReadResponse (wParam, &m_PvData, sizeof(m_PvData)); ...

return (0);}

void CPviDlg::MakePviReadRequ (){ long ErrCode;

// make read request: ErrCode = PviReadRequest (m_hPv, POBJ_ACC_DATA, CWnd::m_hWnd, WM_USER+1, 0); ...}

1.5.7.3 User messages as callback functions with data

The pointer to a callback function provided by the application needs to be specified for the user message'smessage handle. SET_PVICALLBACK_DATA (binary 0xfffffffe) must be specified as the message number. Themessage parameter is passed through to the callback function.

Syntax of the callback function of type PVICALLBACK_DATA:

void WINAPI PviProc (WPARAM wParam, LPARAM lParam, LPVOID pData, DWORD DataLen,T_RESPONSE_INFO* pInfo)

PVI base system

1.5.7.3 User messages as callback functions with data 29

Page 36: PviBase

Arguments of the callback function of type PVICALLBACK_DATA:

Argument Description

wParam Always 0 (reserved for future expansions)

lParam Message parameter (4 bytes)

pData Pointer to the response or event data. If NULL is transferred as a pointer, then no data exists.

DataLen Length of response or event data in bytes

pInfo Pointer to the RESPONSE_INFO structure for additional information

Response or event data is transferred directly to the callback function. Calling the corresponding responsefunction is not necessary or even possible.

Calling the callback function is handled within the PVICOM interface using the window procedure for an internalwindow. This allows the callback function to always be called in the context of the user thread. If an applicationis using asynchronous windows in different threads and the PVICOM functions in more than one of them, it canbe determined where (in which thread context) the callback function is currently running. AsynchronousPVICOM functions are multithread−capable. Calling these function is therefore not the problem; instead, it'saccessing the internal application data buffer. In this case, the application has to be equipped with theappropriate mechanisms for access synchronization (e.g. critical sections).

Within the callback function, unrestricted asynchronous PVICOM functions can be used, but synchronousPVICOM functions may not. In general, the callback function should be kept brief. Actions which may takelonger times (such as accessing databases, etc.) should not be carried out here.

Example for Visual C++

#include <PviCom.h>

class CPviDlg : public CDialog{ ... DWORD m_hPv; DWORD m_PvData; DWORD m_PvStatus;

void MakePviReadRequ (); void MakePviReadResp (DWORD, DWORD*); ...};

static void WINAPI PviProc (WPARAM wParam, LPARAM lParam, LPVOID pData, DWORD DataLen, T_RESPONSE_INFO* pInfo){ CPviDlg* pPviDlg = (CPviDlg*) lParam;

if (pInfo−>ErrCode == 0) && (DataLen == sizeof(DWORD)) pPviDlg−>MakePviReadResp (pInfo−>Status, (DWORD*) pData);}

void CPviDlg::MakePviReadResp (DWORD Status, DWORD* pData){ m_PvStatus = Status; m_PvData = *pData;}

void CPviDlg::MakePviReadRequ (){ long ErrCode;

// make read request: ErrCode = PviReadRequest (m_hPv, POBJ_ACC_DATA, PviProc, SET_PVICALLBACK_DATA, (LPARAM) this); ...}

PVI base system

30 1.5.7.3 User messages as callback functions with data

Page 37: PviBase

1.5.7.4 User messages as callback functions without data

The pointer to a callback function provided by the application needs to be specified for the user message'smessage handle. SET_PVICALLBACK (binary 0xffffffff) must be specified as the message number. Themessage parameter is passed through to the callback function.

Syntax of the callback function of type PVICALLBACK:

void WINAPI PviProc (WPARAM wParam, LPARAM lParam)

Arguments of the callback function of type PVICALLBACK:

Argument Description

wParam Reference to response or event data (for PVI response functions)

lParam Message parameter (4 bytes)

The same rules apply as with user messages as callback functions with data, but response or event data has tobe read with PVICOM function, as with user messages as window messages.

Example for Visual C++

#include <PviCom.h>

#define PV_CNT 40DWORD PvLinkID[PV_CNT];long PvData[PV_CNT];long PvDataError[PV_CNT];long PvWriteError[PV_CNT];HANDLE hPvEvent;

static void WINAPI PviCallback (WPARAM wParam, LPARAM lParam){ T_RESPONSE_INFO Info; long ErrCode; long Data; DWORD LinkID;

// get response information: ErrCode = PviGetResponseInfo (wParam, NULL, NULL, &Info, sizeof(Info)); if (ErrCode != 0) return; // −> no response (skip error 12055)

switch (Info.nMode) { case POBJ_MODE_LINK: // get link response: ErrCode = PviLinkResponse (wParam, &LinkID); if ((DWORD) lParam < PV_CNT) { PvDataError[lParam] = ErrCode; if (ErrCode == 0) PvLinkID[lParam] = LinkID; } break;

case POBJ_MODE_UNLINK: // get unlink response: ErrCode = PviUnlinkResponse (wParam); if ((DWORD) lParam < PV_CNT) PvLinkID[lParam] = 0; break;

case POBJ_MODE_EVENT: case POBJ_MODE_READ: // get read or event response (PV data): ErrCode = PviReadResponse (wParam, &Data, sizeof (Data)); if ((DWORD) lParam < PV_CNT) { PvData[lParam] = Data;

PVI base system

1.5.7.4 User messages as callback functions without data 31

Page 38: PviBase

PvDataError[lParam] = ErrCode; SetEvent (hPvEvent); } break;

case POBJ_MODE_WRITE: // get write response (PV data): ErrCode = PviWriteResponse (wParam); if ((DWORD) lParam < PV_CNT) { PvWriteError[lParam] = ErrCode; SetEvent (hPvEvent); } break; }}

1.5.7.5 User messages as asynchronous callback functions

The pointer to a callback function provided by the application needs to be specified for the user message'smessage handle. SET_PVICALLBACK_ASYNC (binary 0xfffffffd) must be specified as the message number.The message parameter is passed through to the callback function.

The syntax of asynchronous callback functions of type PVICALLBACK_ASYNC correspond to callback functionsof type PVICALLBACK (User messages as callback functions without data).

Unlike the other callback function variations, this variant is not called from an internal window procedure butdirectly from the PVICOM thread of the communication instance. This means that the callback function callalways takes place asynchronously to the user thread. The application itself must therefore provide thecorresponding synchronization mechanisms. The callback function must be kept extremely short since datatransfer (and therefore the life−sign monitoring of the PVICOM communication instance) is completely blockedduring execution. Only the corresponding PVICOM response function may be called within the callback function.However, it is better to save the callback parameters (the wParam and IParam arguments) in a separate list andevaluate the user message in a separate thread. Under no circumstances may the PviInitialize, PviDeinitialize orany other synchronous PVICOM function be called within the callback function.

Only PVICOM application which don't have processing routines for window messages (e.g. "window−less"servers) have to use this callback function variant. This callback function variant is not suitable for Visual Basicapplications.

Example for Visual C++

#include <PviCom.h>

HANDLE hPviEvent;bool bPviExit;

static void WINAPI PviCallback (WPARAM wParam, LPARAM lParam){ Container.AddMsg (wParam, lParam); SetEvent (hPviEvent);}

void CPviThread::PviExit (){ bPviExit = TRUE; SetEvent (hPviEvent);}

void CPviThread::PviProc (WPARAM wParam, LPARAM lParam){ T_RESPONSE_INFO Info; long ErrCode;

ErrCode = PviGetResponseInfo (wParam, NULL, NULL, &Info, sizeof(Info)); if (ErrCode != 0) return; // −> no response (skip error 12055)

PVI base system

32 1.5.7.5 User messages as asynchronous callback functions

Page 39: PviBase

switch (Info.nMode) { case POBJ_MODE_WRITE: ErrCode = PviWriteResponse (wParam);

... }}

void CPviThread::ThreadFunc (){ ...

hPviEvent = CreateEvent (NULL, FALSE, FALSE, NULL); bPviExit = FALSE; ErrCode = PviInitialize (6, 0, NULL, NULL);

...

while (! bPviExit) { LPARAM lParam; WPARAM wParam;

WaitForSingleObject (hPviEvent, INFINITE); while (Container.RemoveMsg (&wParam, &lParam)) CPviThread::PviProc (wParam, lParam); }

...

PviDeinitialize (); CloseHandle (hPviEvent);}

This example shows the recommended procedure for using the callback function of typePVICALLBACK_ASYNC. The PVICOM function calls are carried out in the context of the user thread. Only themessage parameters (wParam, IParam) are stored in a container in the asynchronous PVI callback function.

1.5.8 Requests and Responses

Using PVICOM functions, requests can be sent to the PVI Manager via a communication instance together withthe definition of a user message. After being processed by PVI Manager or the PVI line, the response is sentback and the assigned user message is executed. The response data is then read. The following picture showsthe basic sequence.

PVI base system

1.5.8 Requests and Responses 33

Page 40: PviBase

This procedure accomplishes several things: PVI objects are set up in the manager and then released again;data, states, and properties of PVI objects are read and written; and special PVI Manager functions are carriedout. The sequence in the picture assigns a PVI object to the request. This also applies in most cases. The onlyexceptions are requests for setting up and deleting PVI objects. In this case, the PVI object in the picture wouldbe dropped since these requests would be executed by the manager outside of the object level.

1.5.8.1 Sending Requests and Receiving Responses

PVICOM functions with the word "Request" in their name are used to send requests (e.g. PviLinkRequest,PviReadRequest, PviWriteRequest, etc.). PVICOM functions with the word "Response" in their name are usedto read response data (e.g. PviLinkResponse, PviReadResponse, PviWriteResponse, etc.). An exception isusing the callback function of type PVICALLBACK_DATA as a user message. Since response data is passedalong directly to the callback function, it does not have to be read using a PVICOM function.

The response to a request is a request acknowledgement at the same time. If an error occurs when executing arequest in PVI Manager or in the PVI line, then the response data includes the corresponding error code. If noerrors occur with the response data, then the response signals that the request was executed correctly.

For each request, the user can choose whether the PVICOM application should receive a response. If a usermessage is specified when calling a request function ("hResMsg" argument not equal to zero), then a responseis always sent to the application. If no user message is specified ("hResMsg" argument is zero), then a responseis not sent to the application. Without a response, however, the application cannot determine whether therequest has been carried out correctly or if an error occurred.

A request to cancel one or more active requests can be sent using the POBJ_ACC_CANCEL access type. Thiscancel function can refer to either certain requests or all requests of a link object. For example, a time−intensiverequest (e.g. uploading or downloading modules) can be cancelled before it is completed. Error 12043 isreported in the response data of every cancelled request. The response data for a cancel request is always sentto the PVICOM application after the response data of the requests which were cancelled.

If the application has defined a valid user message when sending the request, then normally response data isalways send to the application. There are only two situations where response data is not sent back for activerequests:

When releasing a link object (PVICOM function PviUnlinkRequest / PviXUnlinkRequest or PviUnlinkAll),all requests assigned to it are cancelled and response data deleted.

1.

When releasing a communication instance (PVICOM function PviDeinitialize or PviXDeinitialize), all2.

PVI base system

34 1.5.8.1 Sending Requests and Receiving Responses

Page 41: PviBase

requests assigned to it are cancelled and response data deleted.

Please Note:However, it is not certain whether a request has been cancelled before being executed or just the response dataafter the execution has been deleted. For example, a variable should be set back to 0 before the object isreleased. If the PviWriteRequest function is called directly before the PviUnlinkRequest function, then there is noguarantee that the write request is carried out. To ensure that the write request is executed, thePviUnlinkRequest function may only be called after the response to the write request is received.

With an interruption of the client/server communication connection, the procedure depends on the length of theinterruption. If the interruption falls within the communication timeout period, then data transfer simply continuesafter the connection is reestablished. Unless there is a delay in processing the request, the PVICOM applicationdoesn't notice the interruption. But if the interruption is longer than the communication timeout allows, then alloutstanding requests trigger a user message and a corresponding error is recorded in the response data.

1.5.8.2 Order of Request Execution

With asynchronous PVICOM functions, several requests can also be sent directly after one another. All of theserequests are stored in the PVICOM communication instance, sent in blocks to PVI Manager and processed atthe same time if possible. The maximum number of requests is limited only by the amount of memory available.Practically, requests should be limited to approx. 500 to 5,000 requests. This way of handling requests is veryefficient since PVI components such as the PVICOM interface, PVI Manager, and the PVI line are usedoptimally and several requests can be executed at the same time.

For example, all variables should be initialized when a PVI application is started. The most time−efficient way todo so would be to call the PVICOM function PviWriteRequest or PviXWriteRequest for all variable objects in aprogram loop. However, it should be noted that the order of calls does not have to match the order of the actualexecution in PVI Manager and the response data being sent back. This also means that the order ofPviWriteRequest calls and the order used to write data to PLC variables also do not have to match. Thisbasically applies to all types of requests. Requests can be rearranged by PVI Manager of the PVI line to usetime the most optimally when processing all outstanding requests. If several requests are directed to oneprocess object, then the likely order of execution is also determined by the priority level of the request. Writerequests to process data have the highest priority. Read requests to process data have an average priority. Allother requests have the lowest priority. After a certain number of requests, a request with lower priority isexecuted to prevent many requests with high priority from stopping the execution of a request with lower priority.This is the reason why we can only mention the 'likely' order. Priority levels cannot be changed by the user.

Requests within one process object and within one priority level are not rearranged though. Here, the order ofcalls corresponds to that of the execution. For example, a PVICOM application can assign the value 4 to avariable object's data before then assigning it 2 directly afterwards. At the end, the variable will hold the value 2.

Please note:If a certain order should be kept when executing requests over several process objects or over different prioritylevels of a process object, then the application may only send the next request once the response of theprevious request has been received.

1.5.9 Access types

The access type is specified whenever a read or write request is specified for a PVI object. This allows processdata, properties, states of process objects, and various services to be selected. Read requests are implementedwith the PviReadRequest or PviXReadRequest function. The PviReadResponse or PviXReadResponse functionis used to read response data. Write requests are implemented with the PviWriteRequest or PviXWriteRequestfunction. The PviWriteResponse or PviXWriteResponse function is used to read response data.

Some access types are directly executed by PVI Manager. Other access types are passed along to the line andprocessed there. Therefore access types which can be used depends on the PVI line being used.

All access types are listed in the following table. Suitable parameter codes for the object description aredisplayed in the "Par." column. The "Type" column lists which access types can be used with which processobject types.

Access types No. Par. Type Description

PVI base system

1.5.8.2 Order of Request Execution 35

Page 42: PviBase

POBJ_ACC_OBJECT #1 All Read access: Reads object type of the process object.The object type is returned in 4−byte binary format(integer).

POBJ_ACC_VERSION #2 PviLineDeviceStationCpuModuleTask

Read access: Either the version of the PVI componentor the version of the PLC object is read depending onthe object type. This version information is returned instring format. Each version entry is terminated with a LF("\n").

Syntax for PVI components version (object type: Pvi,Line, Device):<Title> (<FileName>) <FileVersion> [<Date>] \n

Syntax for PLC object version (object type: Station,Cpu, Module, Task):[<Title>] <Version> [<Date>] \n

POBJ_ACC_ERROR #3 All Read access: Reads error code of the most recenterror

POBJ_ACC_EVMASK #5 EV All Write access: Definition of the enabling mask for theevent type for enabling object events."e": Change in error state"d": Change in data"f": Change in data format"c": Change in the connection description"p": Progress information about active requests"s": Status changes'u': Change in the user tag string'l': Special line eventsSpecifications here take place using string format. Thesequence of letters doesn't really matter. If no eventsshould be enabled, then specify an empty string.

Read access: Reads the current setting

POBJ_ACC_LIST #6 PviLineDeviceStationCpuModuleTask

Read access: List of all process objects which havebeen created in PVI Manager under this process object.This list is returned as a string. The list includes the PVIname and the type of process objects.

Syntax of the process object list:<ObjectName> OT=<ObjectType> \tAll object entries are separated by the \t character(tabulator).

POBJ_ACC_LIST_EXTERN #7 PviLineDeviceStationCpuModuleTask

Read access: List of all process objects which can becreated in PVI Manager under this process object. Thislist is returned as a string. The list includes theconnection name and the type of process objects.

Syntax of the process object list:<ConnectionName> OT=<ObjectType> \tAll object entries are separated by the \t character(tabulator).

Unlike POBJ_ACC_LIST, all process objects which canbe created are shown in this list. This list is created byPVI Manager for process object types "Pvi" and "Line"and includes all lines or devices which were installedwith PVI Setup. For all other process object types, thislist is put together by the line being used. Which line forwhich process object type this access type supports canbe found in the respective line description.

POBJ_ACC_CONNECT #10 CD

PVI base system

36 1.5.8.2 Order of Request Execution

Page 43: PviBase

LineDeviceStationCpuModuleTaskPvar

Write access: Sets or modifies the connectiondescription property of the process object. Theconnection description is specified as a string.Changing this connection description triggers thePOBJ_EVENT_CONNECT event. If an empty string isspecified as the connection description for a line object,then it and all subordinate process objects are handledas internal process objects.

Read access: Reads the currently set connectiondescription (string format). The object hierarchy is notlisted when using unique object names.

POBJ_ACC_DATA #11 Pvar Write access / read access: Access to a variableobject's data

POBJ_ACC_STATUS #12 CpuModuleTaskPvar

Write access / read access: Access to the status of aPLC objectTo delete a PLC module, carry out a write access withthe string "LD=Delete".To delete PLC module reference data (only possible forBR log data modules), write access must be performedusing the string "LD=Clear".

POBJ_ACC_TYPE #13 ATVTCM

Pvar Write access / read access: Reads and writes theobject attributes property, the mode for type casting(cast mode) and/or data format of a variable object.

POBJ_ACC_TYPE_EXTERN #14 ATVT

Pvar Read access: Reads object attributes and data formatas well as the name of the structure definition andelements of a PLC variable.

POBJ_ACC_REFRESH #15 RF Pvar Refresh rate in ms= −1: Cyclic data refresh is turned off= 0: Data refresh is only carried out once> 0: Cyclic data refresh is carried out with the specifiedrefresh rate

Write access: Sets or modifies the refresh rate of theprocess object. The refresh rate is specified as a 4−bytebinary value (integer).

Read access: Reads the currently set refresh time(4−byte binary value)

POBJ_ACC_HYSTERESE #16 HY Pvar As with the HY parameter, event hysteresis is definedby a hysteresis value in string format. Unlike the objectdescription however, the "HY=" parameter is left outhere.

Write access: Sets or modifies event hysteresis of thevariable object (string format)

Read access: Reads the currently set event hysteresis(string format)

POBJ_ACC_DEFAULT #17 DV Pvar Read access: Reads the set default value (DVparameter) of the variable object. The value is returnedin string format.

POBJ_ACC_FUNCTION #18 FS Pvar As with the FS parameter, the data function is definedby a function description in string format. Unlike theobject description however, the "FS=" parameter is leftout here.

Write access: Sets or modifies the data function of thevariable object (string format)

PVI base system

1.5.8.2 Order of Request Execution 37

Page 44: PviBase

Read access: Reads the currently set data function(string format)

OBJ_ACC_UPLOAD #20 Module Read access:Reads BR module from PLC and saves itto a file The PVICOM functionPviReadArgumentRequest orPviXReadArgumentRequest must be used for thisaccess type.

POBJ_ACC_DOWNLOAD #21 CPU Write access:Reads BR module from file and transfersit to PLC

POBJ_ACC_DATE_TIME #22 PviCpuModule

Reads and writes date and time. The data is transferredin binary form in the format of the "tm" structure. Dateand time is defined as local time.

Definition of the "tm" structure in C/C++ (32−bit integer):

struct tm{ int tm_sec; // seconds after the minute − [0,59] int tm_min; // minutes after the hour − [0,59] int tm_hour; // hours since midnight − [0,23] int tm_mday; // day of the month − [1,31] int tm_mon; // months since January − [0,11] int tm_year; // years since 1900 int tm_wday; // days since Sunday − [0,6] int tm_yday; // days since January 1 − [0,365] int tm_isdst; // daylight savings time flag};

Write access: Can only be used for process objects oftype CPU. This sets the data and time of the PLC. Thelast three structure elements are not evaluated.

Read access: The mode of operation of the accessdepends on the process object type being used. Withprocess object types Pvi or Cpu, current informationabout the date and time (local time zone) is read fromthe PC or PLC. With access via a process object of typeModule, the date and time or creation or the last setdate and time are read.

POBJ_ACC_MEM_DELETE #23 CPU Write access:Deletes specified data memory on thePLC The memory type is defined by the LD parameterin the description string.

Syntax of the description string:LD=<MemoryType><MemoryType>: Ram, SysRom, Rom, MemCard,FixRam, PerMem

POBJ_ACC_MEM_INFO #24 CPU Read access: Reads information in string format aboutall existing PLC data memory.

Syntax of the description string:{ <Entry1> } { <Entry2> } ... { <EntryN> }Each <Entry> expression contains information for acertain memory type.<Entry>: LD=<MemoryType> SL=<Length>SF=<LengthFree> SB=<Block><MemoryType>: Memory type (RAM, MemCard, etc.)<Length>: Size of memory (total, in bytes)<LengthFree>: Size of free memory (in bytes)<Block>: Size of the largest free memory area (in bytes)

PVI base system

38 1.5.8.2 Order of Request Execution

Page 45: PviBase

Example:"{ LD=Ram SL=65535 SF=16384 SB=4096 } {LD=FixRam ... }"

POBJ_ACC_MOD_TYPE #25 Module Read access: Reads information about a module instring format.

Syntax of the description string:MT=<ModuleType> ML=<ModuleLengthänge> [DL=<DataLength>] [VI=<Version>]<ModuleType>: Module type as a numeric expression<ModuleLength>: Length of the module in bytes<DataLength>: Length of the reference data in bytes<Version>: Version of the reference data formatThe parameters DL and VI are only listed for BR logdata modules.

POBJ_ACC_UPLOAD_STM #26 Module Read access: Reads a BR module from the PLC andtransfers it to the application in the form of binary data.The PVICOM function PviReadArgumentRequest orPviXReadArgumentRequest must be used for thisaccess type.

POBJ_ACC_DOWNLOAD_STM #27 CPU Write access:Transfers BR module from binary userdata to PLC

POBJ_ACC_MOD_DATA #28 Module Read access: Reads reference data from a module.This access type can only be used in connection withBR log data modules.

POBJ_ACC_LIST_LINE #30 Pvi Read access: List of all list objects which can becreated in PVI Manager under the PVI base object. Thislist is created by PVI Manager and includes all linesinstalled with PVI Setup in string format.

Syntax of the line object list:<LineName1> \t <LineName2> ...All object entries are separated with the character \t(tabulator).<LineName>: connection name for the line object

POBJ_ACC_LIST_DEVICE #31 Line Read access: List of all device object which can becreated in PVI Manager under the line object. This list iscreated by PVI Manager and includes all deviceinstalled with PVI Setup for this line in string format.

Syntax of the device object list:<DeviceName1> \t <DeviceName2> ...All object entries are separated with the character \t(tabulator).<DeviceName>: Connection name for the device object

POBJ_ACC_LIST_STATION #32 LineDevice

Read access: List of all station objects which can becreated in PVI Manager under the correspondingprocess object. This list is created by the line beingused. Which line for which process object type thisaccess type supports can be found in the respective linedescription.

Syntax of the station object list with station namesspecification:<StationName1> \t <StationName2> ...All object entries are separated with the character \t(tabulator).<StationName>: Connection name for the station object

Syntax of the station object list with station number

PVI base system

1.5.8.2 Order of Request Execution 39

Page 46: PviBase

specification:<MinNumber> <MaxNumber>

POBJ_ACC_LIST_CPU #33 LineDeviceStation

Read access: List of all CPU objects which can becreated in PVI Manager under the correspondingprocess object. This list is created by the line beingused. Which line for which process object type thisaccess type supports can be found in the respective linedescription.

Syntax of the CPU object list:<CPUName1> \t <CPUName2> ...All object entries are separated with the character \t(tabulator).<CPUName>: Connection name for the CPU object

POBJ_ACC_LIST_MODULE #34 LineDeviceStationCpu

Read access: List of all module objects which can becreated in PVI Manager under the correspondingprocess object. This list is created by the line beingused. Which line for which process object type thisaccess type supports can be found in the respective linedescription.

Syntax of the module object list:<ModuleName1> \t <ModuleName2> ...All object entries are separated with the character \t(tabulator).<ModuleName>: Connection name (module object)

POBJ_ACC_LIST_TASK #35 LineDeviceStationCpuModule

Read access: List of all task objects which can becreated in PVI Manager under the correspondingprocess object. This list is created by the line beingused. Which line for which process object type thisaccess type supports can be found in the respective linedescription.

Syntax of the task object list:<TaskName1> \t <TaskName2> ...All object entries are separated with the character \t(tabulator).<TaskName>: Connection name for the task object

POBJ_ACC_LIST_PVAR #36 LineDeviceStationCpuModuleTask

Read access: List of all variable objects which can becreated in PVI Manager under the correspondingprocess object. This list is created by the line beingused. Which line for which process object type thisaccess type supports can be found in the respective linedescription.

Syntax of the variable object list:<VariableName 1> [<Info>] \t <VariableName2> [<Info>]...All object entries are separated with the character \t(tabulator).<VariableName>: Connection name for the variableobject<Info>: Description string for additional information

Syntax of the additional information:[SC=<Scope>] [VT=<VariableType> ... ]<Scope>: Scope of a variable on the PLC:"g": global "l": local, "d": dynamic object (also alwayslocal)<VariableType>: Specification of the data format of avariable on the PLC

PVI base system

40 1.5.8.2 Order of Request Execution

Page 47: PviBase

POBJ_ACC_CPU_INFO #50 CPU Read access: Reads CPU information in string format.

Syntax of the description string:[CN=<CPUName>] [CT=<CPUType>] [AW=<APMType>]<CPUName>: Logical name of the CPU<CPUType>: PLC type<APMType>: Application memory type

POBJ_ACC_CANCEL #128 All Write access: Cancels sent PVI request. Request datais made up of a 4−byte integer value. A certain requestor all requests can be cancelled depending on thisinteger value.=0: Cancel all requests.>0: Only cancel requests with the specified access type.

The POBJ_ACC_CANCEL write access and therequest to be cancelled must be led via the same linkobject.See also the Request and Response section.

POBJ_ACC_USERTAG #129 UT ModuleTaskPvar

With user tags, PVI applications can assign a privateuser code or specific user data to a process object(module, task, or variable object) in the form of a string(string terminated with 0) (see also eventtypePOBJ_EVENT_USERTAG). User tags are onlymanaged by PVI, not evaluated.

Write access / read access: Access to the user tagstring

POBJ_ACC_INFO_LICENCE #200 Pvi Read access: Reads PVI Manager license information.License information is read in the format of theT_PVI_INFO_LICENCE structure.

POBJ_ACC_LIST_CLIENTS #210 Pvi Read access: List of all clients logged onto the PVIManager (module names of PVICOM applications).

Syntax of the client list:<ClientModule1> \t <ClientModule2> ...All client entries are separated with the character \t(tab).

POBJ_ACC_SNAPSHOT #240 All Write access: Executes Snapshot function. Whencalling, the name of the snapshot file needs to bespecified as a string. A path can also be specified.

The Snapshot function writes a list of PVI objects (linkobjects, process objects, and service objects) alongwith their status and a list of all registered clients as text(ASCII) in the specified Snapshot file. The Snapshotfunction can be activated for any process object. Onlythe process object for which the Snapshot function wasactivated and all subordinate process objects (objecthierarchy) are written to the Snapshot file. For example,if the Snapshot function was triggered for a task object,then only this task object and the variable objectscreated underneath it are written to the Snapshot file. Ifinformation about all established objects in the PVIManager should be written, then activation must takeplace using the global PVI object (base object "/Pvi").

All other functions in PVI Manager are blocked while theSnapshot function is carried out. This secures theconsistency of the Snapshot data, but can also lead toimmense timing variations when there are large

PVI base system

1.5.8.2 Order of Request Execution 41

Page 48: PviBase

quantities of data being handled by PVI Manager.Therefore, the Snapshot function should only be usedsparingly.

Read access: Path name of the last specified Snapshotfile (string format).

The POBJ_ACC_TYPE, POBJ_ACC_HYSTERESE and POBJ_ACC_FUNCTION can only be used to accessthe properties of the process object. They cannot be used to access the corresponding properties of the linkobject.

1.5.9.1 POBJ_ACC_DATA access type

Write access: Write process data. The data is first written to the PVI process image. Transferring to the PLCthen takes place when external variables are used. Termination of the write procedure is reported along with theresponse data. This also guarantees that the data has been transferred to the PLC. If the "h" object attribute isspecified however, then the response data is sent to the application right after writing to the PVI process image.The application therefore receives a quicker write response. When the response data is received however, itcannot be guaranteed that the data has actually been written to the PLC.

Read access: Activates a read request for process data. Data is read from the PLC and sent with the responsedata to the application. If the process data changes, then a POBJ_EVENT_DATA event is triggered along withthe response data.

1.5.9.2 POBJ_ACC_STATUS access type

This access type is used to read or set a process object's status. This status is defined using a statusdescription in string format. Processing this status description is done in the line being used. Which line thisaccess type supports can be found in the respective line description.

Write access:

Object type Syntax

CPU ST=<Status><Status>: WarmStart, ColdStart, Reset, Diagnose

Module LD=DeleteDeletes module object on the PLC

Task ST=<Status><Status>: Start, Stop, Resume, Cycle, Cycle(<Number>).

Read access:

Object type Syntax

CPU ST=<Status><Status>: WarmStart, ColdStart, Reset, Reconfiguration, NMI, Diagnose, Error

Module ST=<Status> [LD=<LoadType>] [ID=<Identification>]<Status>: NonExisting, Exists, Loading, Incomplete, Complete, Ready, InUse<LoadType>: SysRam, Ram, SysRom, Rom, MemCard, FixRam, DRam, PerMem<Identification>: Identification number for the most current logbook entry for BR log data modules

Task ST=<Status><Status>: NonExisting, Unrunnable, Idle, Running, Stopped, Starting, Stopping, Resuming,Reseting

Pvar ST=<Status> [FC=<Force>] [IO=<Attribute>] [SC=<Scope>]<Force>: Force state 1 or 0<Attribute>: "r" .. input, "w" .. output<Status>: "Const" for constants, "Var" for variables, or "Lkn" for link node<Scope>: Scope of the variable on the PLC:'g': global, 'l': local, 'd': dynamic object (also always local)

PVI base system

42 1.5.9.1 POBJ_ACC_DATA access type

Page 49: PviBase

1.5.9.3 POBJ_ACC_TYPE access type

This access type is used to read or set process object object attributes, data formats and modes for typecasting. This access type works with a description in string format. Like the object description, individualparameters are differentiated in a string with parameter codes.

The description can include the following parameters:AT, VT, VL, VN, AL, CM

Write access: Properties for object attributes, data format and/or type casting mode are set for the processobject depending on the specifications in the description string. These properties can either be set individually ortogether with one another. For example, the "AT=r" string only sets the object attribute. Other properties remainunchanged.A POBJ_EVENT_DATAFORM event is triggered when the data format changes.If the data format for the process object is specified by the line, then the application cannot change it. Anyattempt will be rejected with Error 12039.

Read access: Reads the properties for object attribute, data format, and type casting mode set in the processobject.

1.5.9.4 POBJ_ACC_TYPE_EXTERN access type

Unlike the POBJ_ACC_TYPE access type, POBJ_ACC_TYPE_EXTERN is used to read the properties for theobject attribute and data format of a PLC variable. Processing the read request is done in the PVI line beingused. Which line this access type supports can be found in the respective line description.

The description can include the following parameters:AT, VT, VL, VN, AL, SN, VO, VE

Unlike the object attributes for variable objects, AT is defined as follows:

AT Description

r Read access to the data in the variable is allowed

w Write access to the data in the variable is allowed

e PLC event control is possible for this variable

Still more information can be specified with the data format of the variable:

Par. Description

SN Name of the structure definition for structure variables

VO Variable or structure element offset

Pieces Element information used internally by the line

With structure variables, the names of structure elements can be specified with the description of their dataformat.

{.<ElementName1>[.<ElementName2>] ... }

Read access: Reads properties of object attributes and data format as well as the names of the structuredefinition and elements.

Note:Access types POBJ_ACC_TYPE and POBJ_ACC_TYPE_EXTERN can also return different data formats. Notethat only the POBJ_ACC_TYPE access type (or a POBJ_EVENT_DATAFORM event) can describe the formatof process data in the PVI process image.

1.5.9.5 POBJ_ACC_UPLOAD and POBJ_ACC_UPLOAD_STM access types

These access types are used to read BR modules from the PLC. The PVICOM functionPviReadArgumentRequest or PviXReadArgumentRequest needs to be used since the application also has to

PVI base system

1.5.9.3 POBJ_ACC_TYPE access type 43

Page 50: PviBase

define file names and module parameters with the read request. The application receives either a confirmationof the upload or an error with the response data (PviReadResponse or PviXReadResponse). An upload isalways regulated via a PVI module object. The name of the module on the PLC is defined with the connectiondescription of the process object.

The module data is stored in the specified file with the POBJ_ACC_UPLOAD access type. Module data istransferred to the application with the response data as binary data with POBJ_ACC_UPLOAD_STM. In thiscase, the length of the module data corresponds to the length of the response data.

If the module type is not defined in the calling string (MT parameter not specified), then the module data beingread corresponds to the finished BR module on the PLC. If the module type is defined in the calling string (MTparameter specified), then the reference data is extracted from the specified BR module. The module data beingread then includes only the reference data of the BR module.

Syntax of the calling string for POBJ_ACC_UPLOAD:

["]<FileName>["] ["MT=<ModuleType> ..."]

Syntax of the calling string for POBJ_ACC_UPLOAD_STM:

["MT=<ModuleType> ..."]

Upload parameters in the calling string:

Par. Description

MT Module type for module compilation.Additional parameters can be specified in the calling string depending on the compilation library beingused.

Example of access type POBJ_ACC_UPLOAD in C:

#include <PviCom.h>

static void WINAPI PviUploadResp (WPARAM wParam, LPARAM lParam){ int ErrCode;

ErrCode = PviReadResponse (wParam, NULL, 0); if (ErrCode != 0) printf ("Problem uploading module (PVI Error %d)", ErrCode);}

void UploadRequ (DWORD hModule, char* szFileName){ int ErrCode;

// start PVI upload service: ErrCode = PviReadArgumentRequest (hModule, POBJ_ACC_UPLOAD, szFileName, strlen (szFileName) + 1, PviUploadResp, SET_PVICALLBACK, 0); if (ErrCode != 0) printf ("Can't start upload service (PVI Error %d)", ErrCode);}

Example of access type POBJ_ACC_UPLOAD_STM in C:

#include <PviCom.h>

static void WINAPI PviUploadResp (WPARAM wParam, LPARAM lParam){ DWORD DataLen = 0; void* pData = NULL; int ErrCode; char szFilename[256]; FILE* stream;

PVI base system

44 1.5.9.3 POBJ_ACC_TYPE access type

Page 51: PviBase

PviGetResponseInfo (wParam, NULL, &DataLen, NULL, 0); if (DataLen != 0) { // create data buffer: pData = malloc (DataLen); if (pData == NULL) { printf ("Can't allocate memory"); return; } }

// read module data: ErrCode = PviReadResponse (wParam, pData, DataLen); if (ErrCode != 0) printf ("Problem uploading module (PVI Error %d)", ErrCode); else { // write module data to file: sprintf (szFilename, "C:\\List\\Module%u.bin", lParam); if ((stream = fopen (szFilename, "wb")) != NULL) { fwrite (pData, 1, DataLen, stream); fclose (stream); } else printf ("Can't create file %s", szFilename); }

free (pData);}

void UploadRequ (DWORD hModule, DWORD ModuleNum){ char* szParam; int ErrCode;

szParam = ""; ErrCode = PviReadArgumentRequest (hModule, POBJ_ACC_UPLOAD_STM, szParam, strlen (szParam) + 1, PviUploadResp, SET_PVICALLBACK, ModuleNum); if (ErrCode != 0) printf ("Can't start upload service (PVI Error %d)", ErrCode);}

1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types

These access types are used to write BR modules to the PLC. To carry out a download procedure, the PVICOMfunction PviWriteRequest or PviXWriteRequest needs to be used. The application receives either a confirmationof the download or an error with the response data (PviWriteResponse or PviXWriteResponse). A download isalways regulated via a PVI CPU object.

Module data is read from the specified file with the POBJ_ACC_DOWNLOAD access type. The application musttransfer the module data with the request data using POBJ_ACC_DOWNLOAD_STM. A data block must becreated for this. This data block needs to include the calling string and the binary module data, and the requestfunction (PviWriteRequest or PviXWriteRequest) must be transferred. The size of the data block in bytes iscalculated from the length of the calling string + the size of the binary module data + 1. The calling string inASCII format (character length is 1 byte) must always be at the beginning of the data block and terminated witha binary 0 (null). The binary module data must begin right after the null byte. If a calling string is not needed,then an empty string should be specified in the data block.

If the module type is not defined in the calling string (MT parameter not specified), then the module data needsto include a finished BR module. If the module type is defined in the calling string (MT parameter specified), thenthe module data is regarded as reference data from a BR module. PVI then generates a finished BR modulefrom this reference data and module type information and transfers it to the PLC.

Syntax of the calling string for POBJ_ACC_DOWNLOAD:

["]<FileName>["] [MN=<ModuleName>] [LD=<MemoryType>] [IM=<InstallationMode>]

PVI base system

1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types 45

Page 52: PviBase

or

["]<FileName>["] ["MT=<ModuleType> MN=<ModuleName> ..."] [LD=<MemoryType>]

Syntax of the calling string for POBJ_ACC_DOWNLOAD_STM:

[MN=<ModuleName>] [LD=<MemoryType>] [IM=<InstallationMode>]

or

["MT=<ModuleType> MN=<ModuleName> ..."] [LD=<MemoryType>]

Download parameters in the calling string:

Par. Description

MN Name of the BR module on the PLCIf this parameter is not specified, then the module name entered in the BR module is used. However, amodule name must be specified if a module type (MT parameter) is defined in the calling string.

MT Module type for module compilation.Additional parameters can be specified in the calling string depending on the compilation library beingused.

LD Memory type. Default "LD=Ram".The memory type selects the target memory on the PLC for the download.The following memory types can be specified: SysRam, Ram, SysRom, Rom, MemCard, FixRam, DRam

IM Installation mode Default "IM=Overload".The installation mode determines how a task module is transferred.Overload: Standard mechanismCopy: Exchange is several cyclesOneCycle: Exchange in one cycle

Example of access type POBJ_ACC_DOWNLOAD in C:

#include <PviCom.h>

static void WINAPI PviDownloadResp (WPARAM wParam, LPARAM lParam){ int ErrCode;

ErrCode = PviWriteResponse (wParam); if (ErrCode != 0) printf ("Problem downloading module (PVI Error %d)", ErrCode);}

void DownloadRequ (DWORD hCpu, char* szFileName){ char szParam[256]; int ErrCode;

// start PVI download service: sprintf (szParam, "%s LD=DRam", szFileName); ErrCode = PviWriteRequest (hCpu, POBJ_ACC_DOWNLOAD, szParam, strlen (szParam) + 1, PviDownloadResp , SET_PVICALLBACK, 0); if (ErrCode != 0) printf ("Can't start download service (PVI Error %d)", ErrCode);}

Example of access type POBJ_ACC_DOWNLOAD_STM in C:

#include <PviCom.h>

static void WINAPI PviDownloadResp (WPARAM wParam, LPARAM lParam){ int ErrCode;

PVI base system

46 1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types

Page 53: PviBase

ErrCode = PviWriteResponse (wParam); if (ErrCode != 0) printf ("Problem downloading module (PVI Error %d)", ErrCode);}

void DownloadRequ (DWORD hCpu, char* szModuleName){ char szFilename[256]; FILE* stream; long FileLen; char szParam[256]; long ParamLen; void* pRequData; int ErrCode;

// open file: sprintf (szFilename, "C:\\List\\%s.bin", szModuleName); if ((stream = fopen (szFilename, "rb")) != NULL) { // get file length: fseek (stream, 0, SEEK_END); FileLen = ftell (stream);

// PVI download parameter: sprintf (szParam, "MN=%s LD=Rom", szModuleName); ParamLen = strlen (szParam) + 1;

// create request data buffer: pRequData = malloc (ParamLen + FileLen); if (pRequData != NULL) { // prepare request data buffer: memcpy (pRequData, szParam, ParamLen); fseek (stream, 0, SEEK_SET); FileLen = fread ((BYTE*) pRequData + ParamLen, 1, FileLen, stream);

// start PVI download service: ErrCode = PviWriteRequest (hCpu, POBJ_ACC_DOWNLOAD_STM, pRequData, ParamLen + FileLen, PviDownloadResp , SET_PVICALLBACK, 0); if (ErrCode != 0) printf ("Can't start download service (PVI Error %d)", ErrCode);

free (pRequData); } else printf ("Can't allocate memory");

fclose (stream); } else printf ("Can't open file %s", szFilename);}

1.5.9.7 POBJ_ACC_MOD_DATA access type

This access type allows reference data to be read from BR log data modules. The read access is initiated withthe PVICOM function PviReadArgumentRequest or PviXReadArgumentRequest. The argument parametersspecified in the calling string define the log data to be read. If the read access should only be done with thedefault argument parameters, the PVICOM function PviReadRequest can also be used. The applicationreceives either the requested log data or an error with the response data (PviReadResponse orPviXReadResponse).

Each logbook entry in a BR log data module has a unique identification number (ID). The identification numberis increased by one with each new log entry. Once the number counter is overrun, the identification numbersbegin at zero again. If the identification number is used to find out a difference, this condition needs to be takeninto consideration.

Log entries can be read starting from a certain identification number or from the last (most current) logbookentry. The identification number of the most current log entry for a BR log data module can also be determinedusing the POBJ_ACC_STATUS access type or the POBJ_EVENT_STATUS event type.

PVI base system

1.5.9.7 POBJ_ACC_MOD_DATA access type 47

Page 54: PviBase

Syntax of the calling string:

[DN=<Number>] [ID=<Identification>]

Argument parameters in the calling string:

Par. Description

DN Number of log entries to be read. Default: DN=1

ID Identification number of the first entry to be read. If the parameter ID is not specified, then reading takesplace from the last (most current) entry.

Syntax of the response string:

Response data consists of individual ASCII strings. Each of these strings is terminated with a null character ("\0"character). The next string begins directly after the null character.

<AccessInformation> \0 <LogEntry1> \0 <LogEntry2> \0 ... \0 <LogEntryN> \0

The first string contains general access information:

Par. Description

DN Number of log entries read. The number of subsequent strings is calculated from DN *3.

Three strings are listed for each read logbook entry (<LogEntry>). The (<Information>) string contains generalinformation about the logbook entry. Next comes the string with the message text (<ASCIILogData>) followed bya string with binary log data (<BinaryLogData>) in hex format. If there is no ASCII or binary log data, then anempty string (only the null character) is listed.

In the response data, the first log entry (<LogEntry1>) is always the newest of the logbook entries read.

<Information> \0 <ASCIILogData> \0 <BinaryLogData>

Parameters in the information string:

Par. Description

TLEN Number of characters in the string for the message text (ASCII log data) without the null character.

BLEN Number of characters in the string for the message text (ASCII log data) without the null character.

TIME Time stamp in seconds as a decimal number with decimal places. The number of positions afterthe decimal defines the resolution of the time stamp.

ID Log entry identification number.

E Error number assigned to the log entry as a decimal number.

INFO Additional information as a decimal number.

LEV Level of the log entry as a decimal number.

TN Task name (specified in quotes: TN="<Name>").

Example of access type POBJ_ACC_MOD_DATA for C:

#include <PviCom.h>

//////////////////////////// Parse PVI Parameter: ////////////////////////////

static bool GetNextParam (const char** pszDesc, char* szKeywordBf, int KeywordBfLen, char* szParamBf, int ParamBfLen)

PVI base system

48 1.5.9.7 POBJ_ACC_MOD_DATA access type

Page 55: PviBase

{ const char* szDesc = *pszDesc; char EndChr = ' ';

// skip space characters: while (*szDesc == ' ') szDesc++;

// copy keyword: while (isalpha (*szDesc)) if (−−KeywordBfLen > 0) *(szKeywordBf++) = (char) toupper (*(szDesc++)); else szDesc++; *szKeywordBf = '\0';

if (*szDesc == PVICHR_ASSIGN) { // skip space characters: while (*(++szDesc) == ' ');

// test parameter specification: if (*szDesc == PVICHR_PARAM) { szDesc++; EndChr = PVICHR_PARAM; }

// copy parameter: while ((*szDesc != '\0') && (*szDesc != EndChr)) if (−−ParamBfLen > 0) *(szParamBf++) = *(szDesc++); else szDesc++; *szParamBf = '\0';

if (*szDesc == PVICHR_PARAM) szDesc++; *pszDesc = szDesc; return (TRUE); } *pszDesc = szDesc; return (FALSE);}

bool FindParam (const char* szDesc, const char* szKeyword, char* szParamBf, int ParamBfLen){ char szKeywordBf[16];

while (GetNextParam (&szDesc, szKeywordBf, 16, szParamBf, ParamBfLen)) if (strcmp (szKeywordBf, szKeyword) == 0) return (TRUE); return (FALSE);}

////////////////////////////////// Read logging information: //////////////////////////////////

typedef struct{ bool bValid; DWORD Level; DWORD Error; char Task[32+1]; char Text[80+1];} T_LOGDATA;

static HANDLE hReadLogEvent;

// PVI callback function:static void WINAPI ReadLogProc (WPARAM wParam, LPARAM lParam,

PVI base system

1.5.9.7 POBJ_ACC_MOD_DATA access type 49

Page 56: PviBase

LPVOID pData, DWORD DataLen, T_RESPONSE_INFO* pInfo){ const char* szDesc = (const char*) pData; T_LOGDATA* pLogData = (T_LOGDATA*) lParam; char szParamBf[256]; int Entries = 0;

if (DataLen > 0) if (FindParam (szDesc, KWDESC_DATACNT, szParamBf, sizeof (szParamBf))) Entries = strtol (szParamBf, NULL, 10);

while (Entries−− > 0) { // parse information (string 1): szDesc += (strlen (szDesc) + 1); if (! FindParam (szDesc, "LEV", szParamBf, sizeof (szParamBf))) pLogData−>Level = 0; else pLogData−>Level = strtoul (szParamBf, NULL, 10); if (! FindParam (szDesc, "E", szParamBf, sizeof (szParamBf))) pLogData−>Error = 0; else pLogData−>Error = strtoul (szParamBf, NULL, 10); if (! FindParam (szDesc, "TN", pLogData−>Task, sizeof (pLogData−>Task))) strcpy (pLogData−>Task, "???");

// copy ASCII data (string 2): szDesc += (strlen (szDesc) + 1); strncpy (pLogData−>Text, szDesc, (sizeof (pLogData−>Text)−1)); pLogData−>Text[sizeof (pLogData−>Text)−1] = '\0';

// skip binary data (string 3): szDesc += (strlen (szDesc) + 1);

pLogData−>bValid = TRUE; pLogData++; } SetEvent (hReadLogEvent);}

// Read logging information from module object:void ReadLog (DWORD LinkId, // PVI module object handle T_LOGDATA* pLogData, // pointer to data buffer DWORD ReadCnt) // entries to read{ char szArgParam[32]; int i;

// reset data buffer: for (i = 0; (i < ReadCnt); i++) pLogData[i].bValid = FALSE;

hReadLogEvent = CreateEvent (NULL, FALSE, FALSE, NULL); sprintf (szArgParam, "%s=%u", KWDESC_DATACNT, ReadCnt);

// request read service: if (PviReadArgumentRequest (LinkId, POBJ_ACC_MOD_DATA, szArgParam, strlen (szArgParam), ReadLogProc, SET_PVICALLBACK_DATA, (LPARAM) pLogData) == 0) WaitForSingleObject (hReadLogEvent, INFINITE);

CloseHandle (hReadLogEvent);}

1.5.10 Object Events

Object events are used to send data, status, or property changes in process variable from PVI Manager to thePVI application. To receive object events, a PVI application must define a user message when creating the linkobject. Link objects are set up with the PVICOM functions PviCreateRequest / PviXCreateRequest orPviLinkRequest / PviXLinkRequest. The following picture shows the basic sequence for object events.

PVI base system

50 1.5.10 Object Events

Page 57: PviBase

All object events are guided with link objects. In addition to the user message, the link object also manages arelease mask for events. The event mask is used to release or suppress certain event types. As with the usermessage, the release mask can be defined when setting up a link object. This is done with the EV parameter inthe link object description. The release mask can also be modified at a later time with the POBJ_ACC_EVMASKaccess type. The enable mask is specified as a string. Individual event types are defined with code letters.

The PviReadResponse or PviXReadResponse has to be called in order to read event data or confirm whenresponses are received. Event information such as its type, length of the event data, and the RESPONSE_INFOstructure can be read beforehand with the PviGetResponseInfo or PviXGetResponseInfo. One exception isusing the callback function of type PVICALLBACK_DATA as a user message. Since response data is passedalong directly to the callback function, it does not have to be read using a PVICOM function.

Unlike response data, event data can be overwritten when being transported to the PVI application. If event datais not transported and read by the PVI application with at least the same speed as which they occur, then eventdata piles up in memory until there is no more system memory available. Overwriting prevents ever−increasingsystem memory needs. Only events from the same link object and event type are overwritten. TheRESP_STATUS_OVERWRITE flag in the status of the event data (RESPONSE_INFO structure) is set if eventdata has been overwritten by newer data.

1.5.11 Event types

To receive object events, a PVI application needs to define a user message when a link object is created.

Some event types are generated by PVI Manager, others are generated by the line. Therefore, event typeswhich can be used depends on the PVI line being used.

All event types are listed in the following table. The "EV" columns lists the corresponding code letters forenabling the event type (EV parameter).

Event types No. EV Description

POBJ_EVENT_ERROR #3 e Signals a change in the error state or errorcode of a process object

POBJ_EVENT_CONNECT #10 c Signals a change in the connectiondescription of a process object. The eventdata contains the connection description inthe format of the POBJ_ACC_CONNECTaccess type.

POBJ_EVENT_DATA #11 d Signals a change in a variable object'sprocess data or an end to a process object'serror state

PVI base system

1.5.11 Event types 51

Page 58: PviBase

POBJ_EVENT_STATUS #12 s Signals a status change in the processobject. The event data contains the status inthe format of the POBJ_ACC_STATUSaccess type. This event is generated by theline being used, not PVI Manager. Which linethis status event supports can be found in therespective line description.

POBJ_EVENT_DATAFORM #13 f Signals a change in a variable object's dataformat

POBJ_EVENT_PROCEEDING #128 p This event informs a PVICOM applicationabout the progress of active requests. ThePOBJ_EVENT_PROCEEDING event is onlysent to the application which made therequest. This progress information is sent asa PROCEEDING_INFO structure. This eventis generated by the line being used, not PVIManager. Which line this progress eventsupports can be found in the respective linedescription.

POBJ_EVENT_USERTAG #129 u Signals a change in the user tag. The eventdata contains the user tag in string format(see also access typePOBJ_ACC_USERTAG).

(> 255) l Signals special line events. These events aregenerated by the line being used, not PVIManager. Which PVI line these line eventssupports can be found in the respective linedescription.

1.5.11.1 POBJ_EVENT_ERROR Event Type

This event is sent each type a the error state or error code of a process object changes. The error code is givenas a return value from the PviReadResponse or PviXReadResponse function. The end of the error state issignaled by error code 0 (zero). However, if the POBJ_EVENT_DATA event type is enabled, then the end of theerror state is only signaled by a POBJ_EVENT_DATA event.

A POBJ_EVENT_ERROR event is only triggered if the process object is in an error state. Errors which occur inconnection with other events or requests are reported with the corresponding event or response data and not bya POBJ_EVENT_ERROR event.

1.5.11.2 POBJ_EVENT_DATA Event Type

This event is sent each time a variable object's data is changed. The variable data (process data) is transferredas event data. The format of the data corresponds to the data format set in the process object. If a data format isdefined in the link object, then data is transferred in the format of the link object (type casting).

Process objects without process data (e.g. line objects, module objects, etc.) always send event data with a datalength of 0 (zero). This signals the end of the error state.

The "d" object attribute (AT parameter) can be used to suppress the monitoring of changes in process data inthe variable object as well as overwriting POBJ_EVENT_DATA events. In this case, each individualPOBJ_EVENT_DATA event is sent to the PVI application.

Please note:If event data cannot be transported quickly and read from the PVI application at the same time, then the memoryneeds constantly increase. Therefore, the "d" attribute should be used with extreme care and only whenabsolutely necessary.

The "d" attribute is intended e.g. for variables on the Direct CAN or MTC line if short−lived data changes in thePVI application need to be signaled (e.g. value changes from 0 to 1 and then back to 0 right away). Using the"d" attribute in connection with normal PLC variables doesn't make much sense since the short−lived data

PVI base system

52 1.5.11.1 POBJ_EVENT_ERROR Event Type

Page 59: PviBase

changes cannot be detected within the refresh time anyway.

1.5.11.3 POBJ_EVENT_DATAFORM Event Type

This event is sent each time a variable object's data format is changed. Process objects without process datacannot trigger this event. This event data contains a description of the data format in string format. Like theobject description, individual parameters are differentiated in a string with parameter codes. The data format isdefined with the VT, VL, VN, and AL parameters.

If an application doesn't have a data format defined in the link object, the data is sent in the format of theprocess object with the POBJ_EVENT_DATA event. The POBJ_EVENT_DATAFORM event makes sure thatthe application always sends the current data format of the process object. If a change in the data format occurs,both events are controlled in such a way that the application always receives a POBJ_EVENT_DATAFORMevent first. The POBJ_EVENT_DATA event only occurs afterwards with the data in the new format.

1.5.12 Process Data

The process image represents all the process data required for handling a visualization process. Process data(variable data) is contained in individual variable objects (process objects of type POBJ_PVAR. To access thisdata, the application needs to set up a link object.

Process data is assigned a data format. Process data is mapped in the variable object according to the dataformat property. The data format can be specified by the PVI application in the process object description whensetting up the variable object. The POBJ_ACC_TYPE access type can be used to read or write the currentsetting for the data format property at runtime. You should be aware that the data format can be defined by theline being used for external variable objects. Which line defines the data formats of variables objects can befound in the corresponding section of PVI lines. A data format defined by the line can no longer be changed bythe application.

If a new process variable object is set up, then there is no process data present at first. Internal process objectsdo not contain any valid process data after being setup and have to be provided with data from the application.External process objects are identified by the line being used and then supplied with data. This procedure cantake a bit of time. The DV parameter can be used to provide variable objects with process data right when theyare setup. However, this is only possible for single variables and Integer, Floating Point, Boolean, or String dataformats.

If the data format of variable objects is determined by the line, then the user does not have to specify a dataformat when creating the variable object. However, if the DV parameter is used, then a data format has to bedefined in the process object description in this case. This data format is then overwritten later by the dataformat from the line.

The application uses the link object to read and write data in the format of the variable object. A data format canalso be defined in the link object though. In this case, data is read/written using the format of the link object. Ifthe data format of the variable object and the link object are not the same, then type conversion is carried out.

Data acquisition (supplying variable objects with current data) of external objects (e.g. PLC variables) can bedone by either reading cyclically or using event variables. The 'event variable' operating mode is selected withthe object attribute 'e'.

When reading cyclically, read requests are passed from the PVI Manager to the PVI line being used (lineserver). The line packs these instructions into a data frame and sends them to the connected PLC. It then sendsthe requested data back to the line in the form of a data frame. The line unpacks the data frame and passes theprocess data to the PVI Manager. The process data is then compared with the process image data of therespective variable object. When data changes, the process data is applied and a POBJ_EVENT_DATA event istriggered. This event is then sent to the appropriate PVICOM application via all assigned link objects with anenabled POBJ_EVENT_DATA event.

For event variables, monitoring changes to the process data is carried out on the PLC (or in the line). Processdata is only sent from the PLC to PVI if there are changes. Cyclic reading is omitted. When using this operatingmode, data coming over the PLC communication connection can be considerably reduced. However, note thatboth the line server and PLC event variables must be supported.

PVI base system

1.5.11.3 POBJ_EVENT_DATAFORM Event Type 53

Page 60: PviBase

Basically, process data is only acquired from the line being used for process objects in an active state. In aninactive state, the process image is not updated for the affected variable. This also reduces data traffic with thePLC.

Regardless of the type of data acquisition and the state (active or inactive), the application can also request datafrom external objects with a read instruction (access type POBJ_ACC_DATA). Data is read from the PLC andsent with the response data to the application. If process data is changed in the process image, then aPOBJ_EVENT_DATA event (if enabled) is also triggered along with the response data via all existing linkobjects.

When writing process data to an external variable object with access type POBJ_ACC_DATA, data is firstwritten to the PLC. Once the write has been confirmed by the PLC, response data is sent to the application. Ifthe 'r' object attribute is specified, then a read request is triggered for the affected object in connection with thewrite instruction. Further processing occurs as with cyclic reading.

1.5.12.1 Type casting

To be able to handle process data, PVICOM application have to know the data format of the process data.Although a PVICOM application and a PLC application can "agree" to use a certain data format, any change tothe data format has to always be carried out in both applications. In practice, this frequently leads to hiddenerrors. However, the application has the possibility to read the data format of a variable object(POBJ_EVENT_DATAFORM event or POBJ_ACC_TYPE access type). The application can either check thedata format and output an error message if the format is not permitted, or it can manage the process datadynamically. Type conversion is another solution.

During type conversion (cast function), a data format is predetermined by the PVICOM application. Process datain variable objects is then converted into the given data format when reading and writing, and vice versa. To beable to use type conversion, an application must define a data format when setting up a link object. Processdata will then always be written and read in this format, regardless of the data format of the variable object.

This image shows the formats of the process data from the PLC to the PVICOM application:

When converting types, Integer (signed or unsigned), Float, Boolean, and String variable types can be combinedas array variables or single variables. All other variable types cannot be combined. Error 12036 is reported whenattempting to combine variable types not mentioned above.

PVI base system

54 1.5.12.1 Type casting

Page 61: PviBase

If a structure with structure elements is defined in the link object, then the number of structure elements must beidentical with that of the process variable. The data in the individual structure elements is converted according totheir data format. The same rules apply here as for single variables. In addition, structure data is orientedaccording to the specified structure alignment.

Example of type converting a structure and specifying the structure elements:

Data format of the variable object: "VT=struct AL=2 {. VT=i8 } {. VT=i32 }"

Definition of the structure in C for the PLC (SG3): struct { SINT a; DINT b; }

Specification for the link object data format: "VT=struct {. VT=string VL=16 } {. VT=string VL=16 }"

Definition of the structure in C for the application: struct { char strA[16]; char strB[16]; }

In this example, the type will be converted to string. Of course, strings integer or floating point formats can beused as well.

If only the structure alignment should be set (AL parameter), but the format of the structure elements should beapplied, then a structure without structure elements and variable length 0 (zero) need to be defined as the dataformat for the link object (data format "VT=struct VL=0"). This particular specification applies the structureelements from the data format of the variable objects. Together with a definition of the structure alignment (ALparameter) in the link object, any structure can be oriented according to the specified structure alignment.

Example of type converting a structure without specifying the structure elements:

Data format of the variable object: "VT=struct AL=2 {. VT=i8 } {. VT=i32 }"

Definition of the structure in C for the PLC (SG3): struct { SINT a; DINT b; }

Specification for the link object data format: "VT=struct VL=0 AL=4"

Definition of the structure in C for the application: struct { char A; long B; }

The format of the individual structure elements corresponds to that of the PLC. However, the application workswith structure alignment 4. Therefore, the size of the structure is 8 bytes in the application and 6 bytes in thePLC (SG3).

In arrays, all elements are converted (type cast) individually. The same rules apply here as for single variables.If the array variables possess a different number of elements, then type conversion will be terminated at the endof the smaller array. If the target array is larger, than the rest is filled with binary zeroes.

Example of type converting an array:

Data format of the variable object:

PVI base system

1.5.12.1 Type casting 55

Page 62: PviBase

"VT=u16 VN=10"

Definition of the variable for C in the PLC: INT Array[10];

Specification for the link object data format: "VT=i32 VN=10"

Definition of the variable for C in the application: long Array[10];

All values not equal to 0 (zero) receive the value TRUE when type converting to variable type Boolean. If aString ("VT=string") is type converted to type Boolean, than it will first be converted to an Integer before thevalue is checked as being unequal to zero.

Data in floating point variables (f32, f64) can contain invalid values (infinity, not−a−number) as per the IEEE.Valid values are formed during the type conversion (largest or smallest representable value or 0).

In general, note that loss of value information is possible during type conversion. For example, data in an i16variable (2−byte integer) should be type converted to an i8 (1−byte integer). i8 variables can represent valuesfrom −128 to +127. The value "130" in the i16 variable is outside of the i8 value range and can therefore not berepresented with the i8 variable. This causes a value range violation. Value range monitoring can be activatedwith Bit 2 of the CM parameter.

What happens when value range monitoring is deactivated during type conversion:

Variable type Integer to a variable type Integer with a smaller value range:The number is truncated in its binary form.

Floating point variable type to a variable type with a smaller value range:If the number cannot be represented in the value range, then the result is undefined.

String variable type to a floating point of integer variable type:If the number cannot be represented in the value range, then the result is undefined.

Floating point or integer variable type to a string variable type:If the converted string is longer than the length of the string variable ("VL" parameter), then the string istruncated.

What happens when value range monitoring is activated during type conversion ("CM=4"):

If the value range is violated when writing process data (access type POBJ_ACC_DATA), then the writeinstruction is not executed. Error 12014 is reported with the response data. TheRESP_STATUS_CAST_OVERFLOW or RESP_STATUS_CAST_UNDERFLOW flag is set in the statusof the response data (RESPONSE_INFO structure). In addition, the response data contains theexceeded limit value in the link object's data format. This limit value can be read with the PVICOMfunction PviWriteResultResponse or PviXWriteResultResponse.

If the value range is violated in the read direction (access type POBJ_ACC_DATA or eventPOBJ_EVENT_DATA), then the limit value is supplied with the response or event data. The limit valueis the largest or smallest value which can be represented. The RESP_STATUS_CAST_OVERFLOW orRESP_STATUS_CAST_UNDERFLOW flag is set in the status of the response or event data(RESPONSE_INFO structure).

Monitoring of limits is also carried out for String variable types ("VT=string"). A limit violation occurswhen the string data is longer then the buffer size of the string variables. For example, a string"abcdefg" + terminating null cannot be put completely into a variable with the data format "VT=stringVL=4".

Type conversion modes of operation can be affected by the CM parameter. The parameter can be defined in theprocess object description for a process object and in the link object description for a link object. For typeconversion, settings from both objects are always evaluated (OR function). The setting in the process objectdefines the mode of operation for all connections, while the specification in the link object only applies for thatone connection. CM is assigned 0 (zero) by default.

The CM parameter is structured as a bit list. The adjustable conversion modes are represented by several bitswithin the bit list. If a bit is set, then the corresponding function is activated:

Bit Value Description

PVI base system

56 1.5.12.1 Type casting

Page 63: PviBase

#0 1 PG2000 or AS 1.3 − string variable:If the variable object data format defines a i8 or u8 array (1 byte array), then theprocess data is regarded as a single variable of type String (VT=string) duringtype conversion. When reading the data format (access type POBJ_ACC_TYPEor event POBJ_EVENT_DATAFORM), "String" is returned as the variable type(e.g. actual data format = "VT=i8 VL=1 VN=24" −> returned data format"VT=string VL=24 VN=1"). Setting CM=1 should take place in the processobject. If CM=1 is only specified in the link object, the corresponding typeconversion is carried out, but the actual data format is returned when the dataformat is read.

This conversion mode is intended for "old" PG2000 or AS 1.3 applications. Newapplications should not use this mode. Instead, a string variable should also bedefined as a string variable in the PLC.

#1 2 Decimal mode:Defines how the string contents are interpreted when type converting from theString variable type ("VT=string") to variable type Integer.

Without decimal mode, string contents are interpreted like this:A string with leading 0's is interpreted as an octal number (e.g. −077, 0012).If the string begins with "0x" or "0X", then the following positions are interpretedin hexadecimal (e.g. 0x1f, −0x56a9, 0xA3).In all other cases, the string contents are interpreted as decimal.

If decimal mode is activated (CM=2), then contents of the string are alwaysinterpreted as decimal.

#2 4 Value range monitoring:If value range monitoring is enabled (CM=4), process data is checked whether itcan be represented during type conversion. Value range violations aremonitored. If one occurs, Error 12014 is reported when writing and the largest orsmallest value that can be represented is returned when reading.

#3 8 4/5 rounding mode:Determines how a Floating Point variable type should be converted to an Integervariable type.

Without rounding mode, the positions to the right of the decimal point are simplytruncated. (Examples: 1.3 −> 1, −15.5 −> −15, 0.9999 −> 0)

If rounding mode is switched on (CM=8), then the positions to the right of thedecimal point are rounded. (Examples: 1.3 −> 1, −15.5 −> −16, 0.9999 −> 1)

#4 16 Always terminating string variables with a binary 0 (zero):A string variable with a data format of "VT=string VL=4" can contain a maximumof 4 characters. If string data "abcd" is assigned, then there is no more room forzero−termination. If "zero−termination" mode is enabled, then the string variablewill always be terminated with a binary 0 during type conversion. In the exampleabove, the string variable would contain "abc" and a binary 0 would hold thefourth position.

Individual conversion modes for the CM parameter can be combined. Example: Value range monitoring +rounding mode result in CM=12 (4 + 8 = 12).

1.5.12.2 Variable Addressing

Using variable addressing, link objects can address subsets from the process data of a variable object. All readand write accesses carried out through the link object therefore only address one subset of the process data.The subset is defined by specifying the variable address (VA parameter).

When writing, only the subset in the variable object's process data image is transferred. Then all the processdata from the image is written to the PLC. When reading, this process is executed in reverse. ThePOBJ_EVENT_DATA event is only triggered when a change occurs in the subset.

PVI base system

1.5.12.2 Variable Addressing 57

Page 64: PviBase

Please note:When writing to a subset, all of the process data is always transferred to the PLC. If the process data is changedby the PLC from the time of the last read cycle up to the carrying out of the write instruction, then the data will beplaced back to their old values by the write procedure. Therefore, variable addressing should be used either onlyin the read direction or the PLC accesses the process data only when reading.

Variable addressing is enabled by specifying the VA parameter in the link object description. Since variableaddressing works via type conversion, a data format must be defined for the link object. Any application can setup several link objects to a variable object and divide process data into subsections using different variableaddresses.

Possible addressing types:

Addressing Description

Bit number Bit addressing:With bit addressing, an individual bit is defined an integer variable. In the link object, thedata format of the single variable or array must be defined with variable type Boolean(VT=boolean) or to a type which can be converted to Boolean. The variable object musthave variable type Integer (signed or unsigned). The bit number is specified with the VAparameter. The bit number begins with 0 at the lowest valued bit.Example: "VT=boolean VA=2" − addresses Bit 2.If the variable object is an array of Integers, then a Boolean array can also be defined inthe link object. Bit addressing is then carried out for each individual array.

Array index Array addressing:With array addressing, an individual element is defined an array variable. The element ofthe array variable may not be a structure. A data format for a single variable must bedefined in the link object. The array index is specified in brackets with the VA parameter.The array index begins with 0 at the first array element.Example: "VT=u32 VA=[3]" − addresses the fourth array element.

Example of variable addressing:

Data format of the variable object: "VT=u16 VN=10"

Definition of the variable for C in the PLC: INT Array[10];

Specification for the link object data format and variable addressing: "VT=u32 VA=[3]"

Definition of the variable for C in the application: unsigned long Array4;

1.5.13 Process Data Properties

The following properties can be set for process data:

ObjectAttributes

Object attributes control the approach when acquiring and handling process data of externalvariable objects.

Refresh Time The refresh time determines how frequently the process data of external variable objects isupdated.

Data Format Data format of the process data in the variable object and link object.

1.5.13.1 Object Attributes

Object attributes control the approach when acquiring and handling process data of external variable objects.For internal variable objects, only the "r" and "w" attributes have any significance. The user can can defineobject attributes in the process object description with the AT parameter when creating a variable object. ThePOBJ_ACC_TYPE access type can be used to read or write the current setting for the object attribute propertyat runtime.

PVI base system

58 1.5.13 Process Data Properties

Page 65: PviBase

AT Description

r Allows read access to the process data of a variable object. If this attribute is not specified, a read accessattempt (POBJ_ACC_DATA access type) is rejected with Error 12035. In addition, PVI Manager doesn'tcarry out any cyclic read requests.

w Allows write access to the process data of a variable object. If this attribute is not specified, a write accessattempt (POBJ_ACC_DATA access type) is rejected with Error 12034.

e Operating mode as a line or PLC event variable. Monitoring for changes in the process data is carried out inthe line or on the PLC. For this reason, PVI Manager doesn't need to carry out any cyclic read requests.

h Fast echo after write access. With the "h" object attribute, the time between a write request and a resulting"Data Change" event can be reduced (POBJ_EVENT_DATA event type). The write request itself cannot beaccelerated with this (time between write request and write response). The write data is compared with theprocess image before the transfer to the PLC and, if there is a change, a POBJ_EVENT_DATA event istriggered via all existing link objects.

d Direct event trigger for the POBJ_EVENT_DATA event. The "d" attribute is only effective in connection withthe "e" attribute. A direct event trigger means that all process data returned by the line or PLC is sentdirectly to the application. For more information, see the POBJ_EVENT_DATA Event section.

1.5.13.2 Refresh Time

The refresh time determines how frequently the process data of external variable objects is updated. PVIattempts to acquire process data either through cyclic read accesses ("polling") or by using event variables (PLCevent variables) within this time. The user can define the refresh time in the process object description (RFparameter) when creating a variable object. The POBJ_ACC_REFRESH access type can be used to read orwrite the current refresh time setting at runtime.

Refresh Time Description

−1 The behavior corresponds to that of an internal process variable. The data is not readautomatically. However, the application can control data acquisition using targeted readtasks.

0 Process data is only read once. Reading takes place after the line has initialized the variableobject. As with RF = −1, the application can control further data acquisitioning using targetedread tasks. This setting can be used for constants for example.

Greater than 0 Behavior as with RF = 0, though the variable object is supplied with current process data inthe specified refresh time (specified in ms). The refresh time should be set to correspondwith the requirements of the process data (how current). Basic principle: the highest possiblerefresh rate.

1.5.13.3 Data Format

A data format has to be assigned to be able to access the process data in a variable object (process object oftype POBJ_PVAR). The user can define the process data format in the process object description when creatinga variable object. The POBJ_ACC_TYPE access type can be used to read or write the current setting for thedata format property at runtime. The user must always assign a data format to internal variable objects. Forexternal variable objects, this depends on the PVI line being used. Some lines (e.g. INA2000, NET2000 lines)set the data format for the variable object automatically. In this case, the application doesn't have to define adata format.

The user can assign a data format to each link object regardless of the data format in the variable object. Thisdata format is defined in the link object description when creating a link object. If the data format is different forthe variable object and the link object, then type casting is carried out when reading and writing process data.

Variable objects are divided into 3 types depending on the data format being used:

Single variable Variables with any variable type except for structures. The number of array elements (VNparameter) is always 1.

Structure variable Variable with variable type Structure. The number of array elements (VN parameter) isalways 1. The elements in the structure can consist of single variables, additional structurevariables, or array variables.

Array variable Single variable or structure variable with more than one array element (VN parameter > 1).

PVI base system

1.5.13.2 Refresh Time 59

Page 66: PviBase

The data format is defined using the following parameters:

Par. Description

VT Variable type. Default in the variable object: VT=i32, the link object is not assigned a default data format.See the following table for an overview of all variable types.

VL Variable length in bytes.For single variables, the variable length corresponds to the process data length. For array variables, thevariable length is defined as the element length.

VN Number of elements in array variables. Default: VN=1.PVI supports array variables with up to 65,535 elements.

{...} Definition of structure elements.The definition of the structure element must be specified at the end of the object description. First thenesting depth is defined by a number of "."'s (periods) within each expression in parentheses. Thenelement variables are defined.

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.

Variable length does not have to be specified for variable types with a fixed variable length (e.g. VT=i32 alwayshas a length of 4 bytes). If the variable length is specified however, it has to match with the length of the variabletype. The length of the process data is calculated from the variable length multiplied with the number ofelements (VL * VN). The process data length is the total length of the data of a variable object in the processimage. This includes all filler bytes in structures.

The following variable types can be specified with the VT parameter:

Type Description

i8 8−bit signed integer. Variable length: VL=1. Value range: −128 ... 127.

i16 16−bit signed integer. Variable length: VL=2. Value range: −32768 ... 32767.

i32 32−bit signed integer. Variable length: VL=4. Value range: −2147483648 ...2147483647.

i64 64−bit signed integer. Variable length: VL=8. Value range: −9223372036854775808 ...9223372036854775807.

u8 8−bit unsigned integer. Variable length: VL=1. Value range: 0 ... 255.

u16 16−bit unsigned integer. Variable length: VL=2. Value range: 0 ... 65535.

u32 32−bit unsigned integer. Variable length: VL=4. Value range: 0 ... 4294967295.

u64 64−bit unsigned integer. Variable length: VL=8. Value range: 0 ...18446744073709551615.

f32 32−bit floating point (IEEE Float). Variable length: VL=4. Value range:−3.402823466e+38 ... −1.175494351e−38 / +1.175494351e−38 ... +3.402823466e+38.

f64 64−bit floating point (IEEE Float). Variable length: VL=8. Value range:−1.7976931348623158e+308 ... −2.2250738585072014e−308 /+2.2250738585072014e−308 ... +1.7976931348623158e+308.

boolean Bit variable (flag) mapped to 1 byte. Variable length: VL=1. TRUE = value other than 0,FALSE = value 0.

string String with 1−byte character size and binary 0 termination (null−terminated). The lengthof the string buffer is defined with the variable length (VL parameter). The length of thestring buffer is also the maximum string length. The actual string length is determinedby the binary null character. When reading and writing process data with variable typeString, note that data is only transferred up to and including the null character. Allcharacters after the null character are undefined.

struct Structure. The length of the structure can be defined either by specifying the structureelements or with the variable length (VL parameter).

time 32−bit time difference in milliseconds. For clocks, this time difference refers tomidnight. Variable length: VL=4.

dt 32−bit time and data in seconds since 1/1/1970. Variable length: VL=4.

data General data type. The length is defined with the variable length (VL parameter).

PVI base system

60 1.5.13.2 Refresh Time

Page 67: PviBase

Simple data formats:

Syntax:

VT=<VariableType> [VL=<VariableLength>] [VN=<NumberOfArrayElements>]

This allows both single variables and simple array variables to be defined.

Example of a single variable as a 16−bit signed integer:

"VT=i16"

Example of an array variable with 8 elements and type 32−bit floating point:

"VT=f32 VN=8"

Example of a single variable of type String with 24 characters:

"VT=string VL=24"

Example of an array variable with 5 elements of type String, each with 24 characters:

"VT=string VL=24 VN=5"

Data formats for structures:

In principle, structures can be specified with or without defining the structure elements. If structure elements arenot defined, then the variable length (VL parameter) has to be specified. If structure elements are defined, thenthe variable length is automatically calculated taking the set alignment (AL parameter) into consideration.

Syntax for structure without structure elements:

VT=struct VL=<VariableLength> [VN=<NumberOfArrayElements>]

Syntax for structure with structure elements:

VT=struct [VN=<NumberOfArrayElements>] [AL=<Alignment>] { <Element1> } { <Element2> } ...

<Element>: { <Nesting> VT=<VariableType> [VL=<VariableLength>] [VN=<NumberOfArrayElements>] }

Each structure element (<Element>) is specified inside of braces (curved brackets " {...}"). The nesting depth isdefined by a number of "."'s (periods) at the beginning of each expression in parentheses. The definition of thestructure element also begins with a period. If a second structure is defined inside a structure, then the nestingdepth is increased by one. Therefore, two periods have to specified when defining the elements of the secondstructure. Nesting depth can be increased to a maximum of 64. The element name can be specified after each"." (period) character. However, these names carry no real significance when defining the data format.

Example of a structure variable:

"VT=struct AL=4 {. VT=i16} {. VT=struct VN=2} {.. VT=string VL=24} {.. VT=i32} {. VT=u32}"

Same data format, however specified with element names:"VT=struct AL=4 {.Level VT=i16} {.Msg VT=struct VN=2} {.Msg.Text VT=string VL=24} {.Msg.Number VT=i32} {.Temp VT=u32}"

Both variants correspond to the following C structure with Alignment 4:struct

{ short Level; struct { char Text[24]; long Number; } Msg[2]; unsigned long Temp;

PVI base system

1.5.13.2 Refresh Time 61

Page 68: PviBase

}

Structure alignment:

If structure elements larger than one byte are addressed in a program, memory access by the processor can beaccelerated by setting the structure elements to a data word limit. To do this, "filler bytes" are added to therespective structure elements. However, the filler bytes require more memory to be used.

The structure alignment then defines the size of the data word limit where structure elements are mapped.

Alignment = 1 ....minimum memory requirements and maximum processor access timeAlignment = 8 ....maximum memory requirements and minimum processor access time

In VC++, alignment can be defined globally in the project settings or locally using the Pragma statement"#pragma pack". Alignment is fixed at 4 for VB 6.0.

The alignment requirements for a structure element are determined by the size of the structure element and thealignment specifications. The following rules apply:

<AlignmentRequirement> = min (<AlignmentSpecification>, sizeof (<StructureElement>))

Rules for structures within a structure:

sizeof (<LargestStructureElement>)

The offset of a structure element is determined using the following formula:

<Offset> % <AlignmentRequirement> == 0

The alignment can be specified (AL parameter) when defining the data format of a structure. The process datafor this variable object is then aligned according to this setting.

1.5.14 Process Data Functions

The following functions can be used for process data:

Event Hysteresis Event hysteresis can be used to reduce the number of POBJ_EVENT_DATA events.The hysteresis filter only allows process values through which have value changesgreater than or equal to the specified hysteresis.

Data Functions The data function can be used to scale process values of monitor limit values.

Event hysteresis and the data function can be defined for link objects, process objects (variable objects), or forboth. Defining for a link object is only possible however if a corresponding data format has also already beenspecified for the link object.

Process data is divided into a raw value and a process value in the variable object (process object of typePOBJ_PVAR). The raw value corresponds to the data of the external object (e.g. PLC variable). The processvalue refers to the data which is manipulated using the data function and event hysteresis. If no data function orevent hysteresis is defined, then the raw value and process value in the process object are the same.

When creating a link object, you can select between a raw value and process value link. To do so, the link typein the link object description needs to be set with the LT parameter.

Please note:The LT parameter is preset to the raw value link ("LT=raw"). However, the data function and event hysteresisdefined in the process object is only effective for a process value link ("LT=prc").

This graphic indicates the path of process data in a link and process object in both read and write directions:

PVI base system

62 1.5.14 Process Data Functions

Page 69: PviBase

The event hysteresis and data function defined in the process object is effective for all connected link objectswith a process value link. The event hysteresis and data function defined in the link object is only effective forthis link object. An application can also use both link types. In this case, only two link objects with different linktypes need to be created.

1.5.14.1 Event Hysteresis

Event hysteresis (hysteresis filter) can be defined for variable objects (process objects of type POBJ_PVAR)and for link objects with the parameter HY in the object description. For process objects, the event hysteresisproperty can also be read or modified using the POBJ_ACC_HYSTERESE access type. Event hysteresis canonly be applied for single variables or array variables and the data formats Integer (i8 ..., u8 ...) and FloatingPoint (f32 ...).

Please note:The event hysteresis defined in the process object is only effective if the parameter "LT=prc" has been specifiedin the link object description when creating the link object.

Syntax:

HY=<HysteresisValue>

The hysteresis value can be specified as an integer (specify without commas, valid value range: 2 −2147483647) or as a 64−bit floating point number (specify with decimal, valid value range: greater than 0.0). Avalue outside of the valid ranges deactivates the hysteresis function for the object (e.g. "HY=0.0" or "HY=1").

If event hysteresis is defined, then a POBJ_EVENT_DATA event is only triggered if the value change is greaterthan or equal to the specified hysteresis value. For array variables, the hysteresis filter is used for all arrayelements. The event hysteresis is only active in the read direction and always refers to the process value.

The hysteresis filter in variable objects is intended to suppress system−specific value fluctuations (e.g.measurement value fluctuations on temperature sensors). The hysteresis filter in the link object can be used foruser−specific demands.

1.5.14.2 Data Functions

Each data function has been developed as a Windows DLL and is loaded by PVI Manager as needed. PVISetup generates a key entry in the Windows registry with the function name for each installed data function. All

PVI base system

1.5.14.1 Event Hysteresis 63

Page 70: PviBase

entries are located under the registry key"HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\PviFunc". Each function key includes entries forthe name and path of the DLL as well as function−specific parameters.

A data function can be defined for variable objects (process objects of type POBJ_PVAR) and for linkobjects with the parameter FS in the object description. For process objects, the data function property can alsobe read or modified using the POBJ_ACC_FUNCTION access type. The data function can only be applied forsingle variables or array variables and the data formats Integer (i8 ..., u8 ...) and Floating Point (f32 ...).

The definition of a data function in the variable object is intended to convert system−specific values into astandardized unit, whereas the data function in the link object can be used to further convert values toapplication−specific units. For example, the temperature value of a non−linear temperature sensor is scaled inthe variable object to the unit "degrees Celsius" and then converted to "degrees Fahrenheit" in the link object fordisplay on the screen.

Please note:The data function defined in the process object is only effective if the parameter "LT=prc" has been specified inthe link object description when creating the link object.

Syntax:

FS=[<FunctionName>;]<FunctionDescription>

A data function is selected with the function name. If a function name is not specified, then the default datafunction "LIN" is used. The syntax of the function description depends on the data function being used.Alternatively, the path name of the function DLL can be specified in place of the function name. However,PVICOM application should only work with one registered function name. Function names are not casesensitive.

Function name Short description

LIN Scaling function and limitmonitoring

Only one function DLL is included in PVI at this time

1.5.14.2.1 LIN Data Function

Data function for scaling and limit monitoring. Scaling can be defined using 2 (linear function y=kx+d) or morepoints. The first and last points specified are used for limit monitoring. Limit monitoring can also be definedwithout a scaling function.

What happens when a limit is exceeded depends on the transfer direction:

If the limit value is exceeded when writing process data (access type POBJ_ACC_DATA), then the writeinstruction is not executed. Error 12014 is reported with the response data. TheRESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW flag and the RESP_STATUS_LINKor RESP_STATUS_POBJ flag are set in the status of the response data (RESPONSE_INFO structure).In addition, the response data contains the exceeded limit value in the link object's or process object'sdata format. This limit value can be read with the PVICOM function PviWriteResultResponse orPviXWriteResultResponse.

If the limit value is exceeded in the read direction (access type POBJ_ACC_DATA or eventPOBJ_EVENT_DATA), then the limit value is returned with the response or event data. TheRESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW flag and the RESP_STATUS_LINKor RESP_STATUS_POBJ flag are set in the status of the response or event data (RESPONSE_INFOstructure).

Values can be defined as integers (no commas specified) or as floating point (decimal point specified).Depending on this specification, the scaling function and limit monitoring are calculated either in integer orfloating point format.

Limit monitoring without scaling:

Syntax:

PVI base system

64 1.5.14.2 Data Functions

Page 71: PviBase

FS=[LIN;]<Limit1>,<Limit2>

The specified limits (<Limit 1> and <Limit 2>) define a valid value range for the process data. The valid range istested in the write and read direction.

Example:

"FS=0,100"

valid value range 0 to 100 (identical to specification "FS=100,0" or "FS=0,0;100,100").

Linear function with limit value monitoring:

Syntax:

FS=[LIN;]<XValue1>,<YValue1>;<XValue2>,<YValue2>

Scaling according to a linear function (y=kx+d) within a valid value range. The linear function is defined using 2coordinates. The function calculation and monitoring of the valid value range takes place in the write and readdirections (read process data X −> Y, write process data Y −> X).

Example:

FS=40,30;150,110

valid value range for raw value is 40 to 150. For process value, 30 to 110.

Scaling with several coordinates and limit value monitoring:

Syntax:

FS=[LIN;]<XValue1>,<YValue1>;<XValue2>,<YValue2>; ... ;<XValueN>,<YValueN>

Scaling using coordinates. Theoretically, a maximum of 32,766 coordinates can be specified. Scaling between 2coordinates takes place using linear interpolation (linear function). The valid value range for limit monitoring isdefined using the first (X1,Y1) and the last (Xn,Yn) coordinates. Function calculation and testing of the validvalue range takes place in the write and read directions (read process data X −> Y, write process data Y −> X).

Example:

FS=40,30;100,50;140,80;160,110

valid value range for raw value is 40 to 160. For process value, 30 to 110.

PVI base system

1.5.14.2 Data Functions 65

Page 72: PviBase

The specified function has to be able to be reversed, i.e. "strictly monotonic increasing" or "strictly monotonicdecreasing" within the valid value range.

1.5.15 PVICOM functions

Function Description

PviInitialize Initializes the PVICOM interface and sets up the PVICOM communication instance

PviDeinitialize Ends the communication connection to the PVI Manager and releases the PVICOMcommunication instance

PviSetGlobEventMsg Assigns a user message to a global event of the PVICOM communication instance

PviCreateRequest Request to set up a static process object or a temporary process object with a linkobject

PviCreateResponse Reads a response from a PviCreateRequest instruction. With this response, an IDis passed on to the link object in the application.

PviCreate Synchronous variant of PviCreateRequest / PviCreateResponse functionality

PviDeleteRequest Request for deleting a (static) process object

PviDeleteResponse Reads a PviDeleteRequest response

PviDelete Synchronous variant of PviDeleteRequest / PviDeleteResponse functionality

PviLinkRequest Request to set up a link object

PviLinkResponse Reads a PviDeleteRequest response. With this response, an ID is passed on to thelink object in the application.

PviLink Synchronous variant of PviLinkRequest / PviLinkResponse functionality

PviUnlinkRequest Request to release a link object

PviUnlinkResponse Reads a PviUnlinkRequest response

PviUnlink Synchronous variant of PviUnlinkRequest / PviUnlinkResponse functionality

PviChgLinkRequest Request to change the user message for event data

PviChgLinkResponse Reads a PviChgLinkRequest response

PviChgLink Synchronous variant of PviChgLinkRequest / PviChgLinkResponse functionality

PviUnlinkAll Releases all link objects to which a certain Windows handle or callback pointer isassigned as a user message

PviReadRequest Request for read access to an existing PVI object. The type of read access isdetermined with the access type.

PviReadArgumentRequest Request for read access with argument data to an existing PVI object. The type ofread access is determined with the access type.

PviReadResponse Reads a PviReadRequest or PviReadArgumentRequest response or event datafrom a PVICOM event

PviRead Synchronous variant of PviReadArgumentRequest / PviReadResponsefunctionality

PviWriteRequest Request for write access to an existing PVI object. The type of write access isdetermined with the access type.

PviWriteResponse Reads a PviWriteRequest response

PviWriteResultResponse Reads a PviWriteRequest response with result data

PVI base system

66 1.5.15 PVICOM functions

Page 73: PviBase

PviWrite Synchronous variant of PviWriteRequest / PviWriteResponse functionality

PviGetResponseInfo Reads information about response or event data

PviGetVersion Reads the version string of PVICOM

1.5.15.1 Functions with or without an instance handle

Two function groups are implemented in the PVICOM interface:

Functions with an instance handle ("PviX..."):The PVICOM interface must be initialized with the PviXInitialize function. Then only functions whichbegin with "PviX..." can be used.

1.

Functions without an instance handle ("Pvi..."):The PVICOM interface must be initialized with the PviInitialize function. Then functions which begin with"PviX..." cannot be used.

2.

Functions which use instance handles allow several communication instances to be operated at one time. Eachinstance handle defines a communication instance which controls the client/server communication connection tothe PVI Manager. This means that an application can communicate with several PVI Managers at the same time(remote communication type). If functions which do not use instance handles are called, then only onecommunication instance is present. Applications can then only communicate with one PVI Manager. Generally,an application can also set up several communication instances to the same PVI Manager. However, it shouldbe noted that data transfer takes longer over several instances than it does over just one.

1.5.15.2 Asynchronous and synchronous functions

The PVICOM functions with the word "Request" or "Response" in their name (e.g. PviReadRequest,PviXWriteRequest, PviReadResponse, PviXWriteResponse, etc.) allow requests to be handled asynchronouslyand can therefore also be called asynchronous PVICOM functions. While a PVI request is being executed, theapplication can send another PVI request or handle other tasks.

Synchronous PVICOM functions handle sending request data, waiting for the response, and reading theresponse data within a function. Since synchronous functions use asynchronous functions internally, they don'tsave any runtime. However, their use is substantially easier within a PVICOM application since the programdoesn't have to worry about user messages and assigning requests and responses. In general, asynchronousand synchronous functions can also be mixed together.

Note the following when using synchronous PVICOM functions:

Synchronous PVICOM functions are not multithread−capable. That means that two synchronousfunctions may not be called from different threads at the same time. This also applies if the requestswere given over different communication instances.

1.

When the client/server connection is broken, the application stays in the PVICOM function until thecommunication timeout expires (see Communication instances). If the application is only using onethread, then the entire application cannot be operated during this time.

2.

If a synchronous function is being run right then, then neither the assigned link object of the assignedcommunication instance can be freed up.

3.

The RESPONSE_INFO structure cannot be read with synchronous functions.4.

Please note:Synchronous functions should only be used in test programs, simple visualization applications, or smallPVICOM applications like demo programs. If PVICOM functions need to be called from several threads, thenyou should only use asynchronous PVICOM functions. Using asynchronous PVICOM functions is recommendedwith the "remote" communication type or for high−speed applications.

Please note:Handling exceptions (e.g. try/catch combination) in connection with PVICOM functions is not allowed. PVICOMfunctions come equipped with internal mechanisms for communication control and synchronizing access. If thesequence of these mechanisms is interrupted, then it can lead to undefined PVICOM behavior. An exception ina PVICOM function may also be caused by specifying faulty function arguments (e.g. incorrect buffer pointer).For this reason, critical pointer arguments should be checked before PVICOM functions are called in order foroperation to go smoothly.

PVI base system

1.5.15.1 Functions with or without an instance handle 67

Page 74: PviBase

1.5.15.3 PviInitialize, PviXInitialize Functions

1.5.15.3.1 Definition for C/C++

int PviInitialize (INT Timeout, INT RetryTime, LPCSTR pInitParam, LPVOID pRes)

int PviXInitialize (LPDWORD phPvi, INT Timeout, INT RetryTime, LPCSTR pInitParam, LPVOID pRes)

1.5.15.3.2 Definition for Basic

PviInitialize (ByVal Timeout As Long, ByVal RetryTime As Long, ByVal pInitParam As String, ByVal pRes AsLong) As Long

PviXInitialize (ByRef phPvi As Long, ByVal Timeout As Long, ByVal RetryTime As Long, ByVal pInitParam AsString, ByVal pRes As Long) As Long

1.5.15.3.3 Arguments

Argument I/O Description

phPvi Out Pointer to a variable used for recording the Link IDTo avoid problems with undefined instance handles, the instance handle should bepreinitialized with 0 (zero) in the application. If the value is 0, PVICOM recognizes the instancehandle as invalid and returns an appropriate error.

Timeout In Communication timeout for the client/server (application/PVI Manager) communication insecondsThe timeout also defines the time for the life sign monitor. An additional period is needed todetect a disruption in the client/server connection. To determine the total time where acommunication disruption would be detected (at the latest), the timeout value specified herehas to be doubled. If the timeout is 5, then an interruption in the connection can be detected inas early as 5 seconds and as late as 10 seconds. Connection interrupts are not recognized assuch by the PVICOM interface if they occur within the timeout period. Data transfer simplycontinues once the connection is reestablished. Often used values are 3 − 10 seconds for localcommunication and 5 − 30 seconds for remote communication.Specification: 1 − 3600, = 0 ... Default value of 30 s used

RetryTime In Retry time for PVICOM user messages is seconds.The default setting ("RetryTime=0") should normally be used for this parameter. See the UserMessage Operations section for more information about this parameter.Specification: 1 − 3600, <= 0 ... no retries (default setting)

pInitParam In Pointer to a NULL−terminated initialization parameter string. If no initialization parameters areneeded, then NULL can be specified as the pointer.

pRes Reserved for expansions. NULL should always be specified for this parameter.

1.5.15.3.4 Return Value

The value 0 (null) signals that the initialization was carried out correctly. A value other than 0 (null) indicates anerror, and the return value corresponds to the error code of the error which actually occurred.

1.5.15.3.5 Description

The PviInitialize or PviXInitialize function initializes the PVICOM interface, establishes a PVICOMcommunication instance, and initiates the registration of the communication instance (client) with PVI Manager(server). Once registered, a communication connection between the communication instance (client) and PVIManager (server) is opened. It should be noted, that client registration is only initiated. Therefore, returning fromthe function does not guarantee stable client/server communication. The PVICOM communication instance cansignal the current status of the communication connection with the help of global events from the application. Todo so however, the desired global event must be activated with the PviSetGlobEventMsg orPviXSetGlobEventMsg function after the PviInitialize or PviXInitialize function is called.

Unlike the function "PviInitialize", "PviXInitialize" can be called more than once. Each call sets up a newcommunication instance. This allows a PVICOM application to be able to communicate with several PVIManagers on different computers. If a communication instance is set up with PviXInitialize, then PVICOMfunctions must subsequently be called with an instance handle (PviX...). See also the Functions With or Without

PVI base system

68 1.5.15.3 PviInitialize, PviXInitialize Functions

Page 75: PviBase

an Instance Handle section.

If the initialization function PviInitialize (or PviXInitialize) doesn't report an error, then sending requests canbasically begin immediately (Request and Response). If the communication connection is not active at this point,then all requests are buffered in the communication instance.

Initialization parameters:

The individual initialization parameters are differentiated in the string using parameter codes:

<ParameterCode> = ["]<ParameterValue>["]

If a parameter value has characters that are not alpha numeric, they must be entered in ("...") quotation marks.At least one blank space needs to be between individual parameter entries.

Par. Description

AS Auto−Start (only for the local communication type).1 ... PVI Manager is started (default).0 ... PVI Manager is not started automatically and must be started already when the function is called.

LM Limit on user messages. Default: "LM=1"PVICOM applications basically do not need to change the default setting of this parameter. However, if anapplication is able to respond quickly to PVICOM user messages, then a higher limit value ("LM=100","LM=1000") or turning off the limiting ("LM=0") can speed up user message execution. See the UserMessage Operations section for more information about this parameter.Specification: 1 − 65535, <= 0 −> No limiting.

PT Process timeout in seconds. Default: "PT=0".This timeout can be used to monitor the time between requests and responses. This parameter is onlyintended for PVICOM applications which carry out particular tasks. Standard application do not need to bemonitored and should use the default setting (no timeout monitoring).Specification: 1 − 3600, <=0 −> No timeout monitoring

IP TCP/IP address or host name.If the IP initialization parameter is specified, then the Remote communication type is used for PVICOMcommunication. Either the TCP/IP address (e.g. "IP=10.43.50.62") or the host name ("IP=SystemPC1") ofthe server (PVI Manager) is specified with this parameter. If the host name is given, then the IP addressassigned to the name is determined by the system.

PN TCP/IP port number. Default: "PN=20000".This parameter is only required in conjunction with the IP parameter. The port number assigned to PVIManager needs to be specified here (PVI Manager Properties).Specification: 1024 − 32767.

Example for Visual C++

Application and PVI Manager are on the same computer:

#include <PviCom.h>

int Initialize (HWND hWnd){ int Error;

// Create and initialize communication instance: Error = PviInitialize (4, 0, NULL, NULL); if (Error != 0) return (Error);

// Set global Event ARRANGE to generate PVI objects: Error = PviSetGlobEventMsg (POBJ_EVENT_PVI_ARRANGE, hWnd, WM_USER+1, 0); if (Error != 0) return (Error); return (0);}

int Deinitialize (){ int Error;

PVI base system

1.5.15.3 PviInitialize, PviXInitialize Functions 69

Page 76: PviBase

// Free communication instance: Error = PviDeinitialize (); return (Error);}

Here, the application should communicate with two PVI Managers where the first PVI Manager is on the samecomputer and the second PVI Manager is on a different computer:

#include <PviCom.h>

DWORD hPvi1 = 0;DWORD hPvi2 = 0;

int Initialize (HWND hWnd){ int Error;

// Create and initialize communication instance 1: Error = PviXInitialize (&hPvi1, 6, 0, "", NULL); if (Error != 0) return (Error);

// Set global Event ARRANGE to generate PVI objects for manager 1: Error = PviXSetGlobEventMsg (hPvi1, POBJ_EVENT_PVI_ARRANGE, hWnd, WM_USER+1, 0); if (Error != 0) return (Error);

// Create and initialize communication instance 2: Error = PviXInitialize (&hPvi2, 8, 0, "IP=10.43.50.62 PN=20001", NULL); if (Error != 0) return (Error);

// Set global Event ARRANGE to generate PVI objects for manager 2: Error = PviXSetGlobEventMsg (hPvi2, POBJ_EVENT_PVI_ARRANGE, hWnd, WM_USER+2, 0); if (Error != 0) return (Error); return (0);}

int Deinitialize (){ int Error; int LastError = 0;

if (hPvi1 != 0) { // Free communication instance 1: Error = PviXDeinitialize (hPvi1); if (Error != 0) LastError = Error; else hPvi1 = 0; }

if (hPvi2 != 0) { // Free communication instance 2: Error = PviXDeinitialize (hPvi2); if (Error != 0) LastError = Error; else hPvi2 = 0; }

return (LastError);}

1.5.15.4 PviDeinitialize, PviXDeinitialize Functions

PVI base system

70 1.5.15.4 PviDeinitialize, PviXDeinitialize Functions

Page 77: PviBase

1.5.15.4.1 Definition for C/C++

int PviDeinitialize ()

int PviXDeinitialize (DWORD hPvi)

1.5.15.4.2 Definition for Basic

PviDeinitialize () As Long

PviXDeinitialize (ByVal hPvi As Long) As Long

1.5.15.4.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

1.5.15.4.4 Return Value

A value other than 0 signals an error. The error code is returned as a value.

1.5.15.4.5 Description

This function is used to end the communication connection to PVI Manager and release the PVICOMcommunication instance.

After the function is called, no user messages are sent to the application. Note, however, that windowpost−messages may still be in the window message queue. They should be ignored after calling the"PviDeinitialize" function.

1.5.15.5 PviSetGlobEventMsg, PviXSetGlobEventMsg functions

1.5.15.5.1 Definition for C/C++

int PviSetGlobEventMsg (DWORD nGlobEvent, LPVOID hEventMsg, DWORD EventMsgNo, LPARAMEventParam)

int PviXSetGlobEventMsg (DWORD hPvi, DWORD nGlobEvent, LPVOID hEventMsg, DWORD EventMsgNo,LPARAM EventParam)

1.5.15.5.2 Definition for Basic

PviSetGlobEventMsg (ByVal nGlobEvent As Long, ByVal hEventMsg As Long, ByVal EventMsgNo AsLong,ByVal EventParam As Long) As Long

PviXSetGlobEventMsg (ByVal hPvi As Long, ByVal nGlobEvent As Long, ByVal hEventMsg As Long, ByValEventMsgNo As Long, ByVal EventParam As Long) As Long

1.5.15.5.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

nGlobEvent In Selects the global event type where the user message should be assignedPOBJ_EVENT_PVI_CONNECT, POBJ_EVENT_PVI_DISCONN, orPOBJ_EVENT_PVI_ARRANGE can be specified as an event.

hEventMsg In Definition of a user message which is executed when the global event occurs. If hEventMsg =0 (zero) is specified, then the user message for this event is deleted.

EventMsgNo In Message number of the user message

EventParam In message parameter of the user message

PVI base system

1.5.15.4 PviDeinitialize, PviXDeinitialize Functions 71

Page 78: PviBase

1.5.15.5.4 Return value

A value other than 0 signals an error. The error code is returned as a value.

1.5.15.5.5 Description

This function assigns a user message to a global event from the communication instance. The PviDeinitialize orPviXDeinitialize function is used to release all communication instance assignments.

A different user message can be specified for each global event type. If the same user message is defined for allevents, then the event type can be read from the RESPONSE_INFO structure (PviGetResponseInfo function).

After receiving the corresponding user message for a global event, the PVI application has to call the PVICOMfunction PviReadResponse.

Example for Visual C++

#include <PviCom.h>

class CPviDlg : public CDialog{ ... int Initialize (); void CreatePviObjects (); LRESULT OnPviGlobalEvent (WPARAM, LPARAM); ... DECLARE_MESSAGE_MAP()};

BEGIN_MESSAGE_MAP(CPviDlg, CDialog) ... ON_MESSAGE (WM_USER+1, OnPviGlobalEvent)END_MESSAGE_MAP()

LRESULT CPviDlg::OnPviGlobalEvent(WPARAM wParam, LPARAM lParam){ T_RESPONSE_INFO Info; int Error;

Error = PviGetResponseInfo (wParam, NULL, NULL, &Info, sizeof (Info)); if (Error != 0) // no event data: return (0);

// execute this function on every valid event: Error = PviReadResponse (wParam, NULL, 0);

switch (Info.nType) { case POBJ_EVENT_PVI_CONNECT: ViewText ("State: CONNECT"); break;

case POBJ_EVENT_PVI_DISCONN: ViewText ("State: DISCONNECT − Error #%d", Error); break;

case POBJ_EVENT_PVI_ARRANGE: CreatePviObjects (); break; } return (0);}

void CPviDlg::CreatePviObjects(){ int ErrCode;

...}

PVI base system

72 1.5.15.5 PviSetGlobEventMsg, PviXSetGlobEventMsg functions

Page 79: PviBase

int CPviDlg::Initialize (){ int Error;

// create and initialize communication instance: Error = PviInitialize (8, 0, "IP=10.43.50.62 PN=23840", NULL); if (Error != 0) return (Error);

// set global events: PviSetGlobEventMsg (POBJ_EVENT_PVI_CONNECT, CWnd::m_hWnd, WM_USER+1, 0); PviSetGlobEventMsg (POBJ_EVENT_PVI_DISCONN, CWnd::m_hWnd, WM_USER+1, 0); PviSetGlobEventMsg (POBJ_EVENT_PVI_ARRANGE, CWnd::m_hWnd, WM_USER+1, 0);

return (0);}

1.5.15.6 PviCreateRequest, PviXCreateRequest Functions

1.5.15.6.1 Definition for C/C++

int PviCreateRequest (LPCSTR pObjectName, DWORD ObjectTyp, LPCSTR pObjektDescriptor, LPVOIDhEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor, LPVOID hResMsg,DWORD ResMsgNo, LPARAM ResParam)

int PviXCreateRequest (DWORD hPvi, LPCSTR pObjectName, DWORD ObjectTyp, LPCSTRpObjektDescriptor, LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTRpLinkDescriptor, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

1.5.15.6.2 Definition for Basic

PviCreateRequest (ByVal pObjectName As String, ByVal ObjectType As Long, ByVal pObjectDescriptor AsString, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByValpLinkDescriptor As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) AsLong

PviXCreateRequest (ByVal hPvi As Long, ByVal pObjectName As String, ByVal ObjectType As Long, ByValpObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam AsLong, ByVal pLinkDescriptor As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParamAs Long) As Long

1.5.15.6.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pObjectName In Pointer to the object name or object path name. Given as a null−terminated string.

ObjectType In Object type specificationPOBJ_LINE, POBJ_DEVICE, POBJ_STATION, POBJ_CPU, POBJ_MODUL,POBJ_TASK, POBJ_PVARIf the object type is specified with the object name in pObjectName ("OT" parameter",then the object type given here is irrelevant.

pObjectDescriptor In Pointer to the process object description. Given as a null−terminated string.

hEventMsg In Definition of the user message which is assigned to the link object for signaling objectevent data (events). If hEventMsg doesn't equal 0 (zero), then a temporary processobject and a link object are set up. If hEventMsg equals 0 (zero), then a static processobject without a link object is set up.

EventMsgNo In Message number of the user message= 0 (Null): No user message for event data is assigned to the link object In this case,either 0 (zero) or any value not equal to 0 can be specified for hEventMsg (e.g.PVI_HMSG_NIL).

EventParam In message parameter of the user message

pLinkDescriptor In Pointer to the link object description. Given as a null−terminated string.

PVI base system

1.5.15.6 PviCreateRequest, PviXCreateRequest Functions 73

Page 80: PviBase

hResMsg In Definition of the user message which signals the response for this function call(Requests and Responses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.6.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.6.5 Description

This function sends a request to PVI Manager to set up a process object. Either a static process object or atemporary process object can be set up with a link object. The hEventMsg function parameter is used to selectthe type of the process object. Response data must be read with either the PviCreateResponse orPviXCreateResponse function unless using a callback function of type PVICALLBACK_DATA.

Specifying "hEventMsg=0" (zero) sets up a static process object without a link object. If a process object alreadyexists in PVI Manager which has the same name and same object type, Error 12002 (Object name alreadyexists) is reported with the response. If there isn't such a process object, it will be set up as a static processobject and set using the object parameters defined with pObjectDescriptor. The EventMsgNo, EventParam, andpLinkDescriptor parameters are not evaluated in this case and are therefore irrelevant.

If the hEventMsg function parameter defines a user message (value other than zero), then a process object anda link object are set up. If there is already a process object (temporary or static) in PVI Manager with the samename and object type, then only a link object is set up for this process object and the pObjectDescriptorparameter becomes irrelevant. This corresponds to the way the PviLinkRequest function works. However, if nocorresponding process object is present, then a temporary process object is set up and set using the objectparameters defined with pObjectDescriptor.

The object parameters defined with pLinkDescriptor are used when setting up the link object. The applicationreceives a Link ID with the response data for identifying the set up link object.

Example for Visual C++

#include <PviCom.h>

class CPviDlg : public CDialog{ ... int m_CreateRequestCnt; DWORD m_LinkID[1024]; long m_ErrCode[1024];

void CreatePviObjects (); LRESULT OnPviCreateResp (WPARAM, LPARAM); LRESULT OnPviObjEvent (WPARAM, LPARAM); ... DECLARE_MESSAGE_MAP()};

BEGIN_MESSAGE_MAP(CPviDlg, CDialog) ... ON_MESSAGE (WM_USER+2, OnPviCreateResp) ON_MESSAGE (WM_USER+3, OnPviObjEvent)END_MESSAGE_MAP()

LRESULT CPviDlg::OnPviObjEvent (WPARAM wParam, LPARAM lParam){

PVI base system

74 1.5.15.6 PviCreateRequest, PviXCreateRequest Functions

Page 81: PviBase

... return (0);}

LRESULT CPviDlg::OnPviCreateResp (WPARAM wParam, LPARAM lParam){ int ErrCode; DWORD LinkID;

ErrCode = PviCreateResponse (wParam, &LinkID); if (ErrCode != 0) m_ErrCode[lParam] = ErrCode; else m_LinkID[lParam] = LinkID;

if (−−m_CreateRequestCnt <= 0) { // last create response was received: ... } return (0);}

void CPviDlg::CreatePviObjects(){ int ErrCode;

// Initialize members: m_CreateRequestCnt = 0; memset (m_LinkID, 0, sizeof (m_LinkID)); memset (m_ErrCode, 0, sizeof (m_ErrCode));

// Create line object: ErrCode = PviCreateRequest ("@Pvi/LNINA2", POBJ_LINE, "CD=LnIna2", CWnd::m_hWnd, WM_USER+3, 1, "EV=e", CWnd::m_hWnd, WM_USER+2, 1); if (ErrCode != 0) m_ErrCode[1] = ErrCode; else m_CreateRequestCnt++;

// Create device object: ErrCode = PviCreateRequest ("@Pvi/LNINA2/COM2", POBJ_DEVICE, "CD=\"/IF=com2\"", CWnd::m_hWnd, WM_USER+3, 2, "EV=e", CWnd::m_hWnd, WM_USER+2, 2); if (ErrCode != 0) m_ErrCode[2] = ErrCode; else m_CreateRequestCnt++;

// Create CPU object: ErrCode = PviCreateRequest ("@Pvi/LNINA2/COM2/CPU", POBJ_CPU, "CD=\"\"", CWnd::m_hWnd, WM_USER+3, 3, "EV=e", CWnd::m_hWnd, WM_USER+2, 3); if (ErrCode != 0) m_ErrCode[3] = ErrCode; else m_CreateRequestCnt++;

... // Create variable object for global CPU variable PVar1: ErrCode = PviCreateRequest ("@Pvi/LNINA2/COM2/CPU/PVar1", POBJ_PVAR, "CD=PVar1", CWnd::m_hWnd, WM_USER+3, 10, "VT=i32 LT=prc", CWnd::m_hWnd, WM_USER+2, 10); if (ErrCode != 0) m_ErrCode[10] = ErrCode; else m_CreateRequestCnt++; ...}

PVI base system

1.5.15.6 PviCreateRequest, PviXCreateRequest Functions 75

Page 82: PviBase

1.5.15.7 PviCreateResponse, PviXCreateResponse Functions

1.5.15.7.1 Definition for C/C++

int PviCreateResponse (DWORD wParam, LPDWORD pLinkID)

int PviXCreateResponse (DWORD hPvi, DWORD wParam, LPDWORD pLinkID)

1.5.15.7.2 Definition for Basic

PviCreateResponse (ByVal wParam As Long, ByRef pLinkID As Long) As Long

PviXCreateResponse (ByVal hPvi As Long, ByVal wParam As Long, ByRef pLinkID As Long) As Long

1.5.15.7.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

pLinkID Out Pointer to the variable used to record the Link ID (only required if a link object was setup)

1.5.15.7.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when thefunction is called (e.g. response data had been previously deleted), then Error 12055 (no response datapresent) is reported.

1.5.15.7.5 Description

This function is used to read the response from a request made by PviCreateRequest or PviXCreateRequest.

If a request has been made to set up a link object, then the Link ID is written to the variable specified by pLinkID.The link object can be clearly identified later with the Link ID. If a static process object has been set up, then avalid Link ID is not returned with the response. The pLinkID parameter may then be specified as a null pointer.

Please note:If a user message has been defined with the PviCreateRequest or PviXCreateRequest function call, then thePviCreateResponse or PviXCreateResponse function must be called once the user message is received.However, this does not apply when using a callback function of type PVICALLBACK_DATA.

1.5.15.8 PviCreate, PviXCreate Functions

1.5.15.8.1 Definition for C/C++

int PviCreate (LPDWORD pLinkID, LPCSTR pObjectName, DWORD ObjectTyp, LPCSTR pObjektDescriptor,LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor)

int PviXCreate (DWORD hPvi, LPDWORD pLinkID, LPCSTR pObjectName, DWORD ObjectTyp, LPCSTRpObjektDescriptor, LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTRpLinkDescriptor)

1.5.15.8.2 Definition for Basic

PviCreate (ByRef pLinkID As Long, ByVal pObjectName As String, ByVal ObjectType As Long, ByValpObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam AsLong, ByVal pLinkDescriptor As String) As Long

PviXCreate (ByVal hPvi As Long, ByRef pLinkID As Long, ByVal pObjectName As String, ByVal ObjectType AsLong, ByVal pObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal

PVI base system

76 1.5.15.7 PviCreateResponse, PviXCreateResponse Functions

Page 83: PviBase

EventParam As Long, ByVal pLinkDescriptor As String) As Long

1.5.15.8.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pLinkID Out Pointer to the variable used to record the Link ID (only required if a link object was setup)

pObjectName In Pointer to object names or object path names. Given as a null−terminated string.

ObjectType In Object type specificationPOBJ_LINE, POBJ_DEVICE, POBJ_STATION, POBJ_CPU, POBJ_MODUL,POBJ_TASK, POBJ_PVARIf the object type is specified with the object name in pObjectName ("OT" parameter",then the object type given here is irrelevant.

pObjectDescriptor In Pointer to the process object description. Given as a null−terminated string.

hEventMsg In Definition of the user message which is assigned to the link object for signaling objectevent data (events). If hEventMsg doesn't equal 0 (zero), then a temporary processobject and a link object are set up. If hEventMsg equals 0 (zero), then a static processobject without a link object is set up.

EventMsgNo In Message number of the user message= 0 (Null): No user message for event data is assigned to the link object In this case,either 0 (zero) or any value not equal to 0 can be specified for hEventMsg (e.g.PVI_HMSG_NIL).

EventParam In message parameter of the user message

pLinkDescriptor In Pointer to the link object description. Given as a null−terminated string.

1.5.15.8.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout).

1.5.15.8.5 Description

This function is the synchronous variant of PviCreateRequest / PviCreateResponse or PviXCreateRequest /PviXCreateResponse functionality. See the Asynchronous and Synchronous Functions section.

1.5.15.9 PviDeleteRequest, PviXDeleteRequest Functions

1.5.15.9.1 Definition for C/C++

int PviDeleteRequest (LPCSTR pObjectName, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

int PviXDeleteRequest (DWORD hPvi, LPCSTR pObjectName, LPVOID hResMsg, DWORD ResMsgNo,LPARAM ResParam)

1.5.15.9.2 Definition for Basic

PviDeleteRequest (ByVal pObjectName As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByValResParam As Long) As Long

PviXDeleteRequest (ByVal hPvi As Long, ByVal pObjectName As String, ByVal hResMsg As Long, ByValResMsgNo As Long, ByVal ResParam As Long) As Long

1.5.15.9.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pObjectName In Pointer to the object name or object path name. Given as a null−terminated string.

hResMsg In

PVI base system

1.5.15.8 PviCreate, PviXCreate Functions 77

Page 84: PviBase

Definition of the user message which signals the response for this function call (Requestsand Responses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.9.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.9.5 Description

This function sends a request to PVI Manager to delete a process object. Response data must be read with thePviDeleteResponse or PviXDeleteResponse function unless using a callback function of typePVICALLBACK_DATA.

This function is intended to delete static process objects. In principle, it is also possible to delete temporaryprocess objects, but this is not necessary since deleting process objects takes place automatically when linkobjects are released.

When a process object is deleted, all subordinate process objects (object hierarchy) are also deleted and allconnected link objects are released.

1.5.15.10 PviDeleteResponse, PviXDeleteResponse Functions

1.5.15.10.1 Definition for C/C++

int PviDeleteResponse (DWORD wParam)

int PviXDeleteResponse (DWORD hPvi, DWORD wParam)

1.5.15.10.2 Definition for Basic

PviDeleteResponse (ByVal wParam As Long) As Long

PviXDeleteResponse (ByVal hPvi As Long, ByVal wParam As Long) As Long

1.5.15.10.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

1.5.15.10.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when thefunction is called (e.g. response data had been previously deleted), then Error 12055 (no response datapresent) is reported.

1.5.15.10.5 Description

This function is used to read the response from a request made by PviDeleteRequest or PviXDeleteRequest.

PVI base system

78 1.5.15.9 PviDeleteRequest, PviXDeleteRequest Functions

Page 85: PviBase

Please note:If a user message has been defined with the PviDeleteRequest or PviXDeleteRequest function call, then thePviDeleteResponse or PviXDeleteResponse function must be called once the user message is received.However, this does not apply when using a callback function of type PVICALLBACK_DATA.

1.5.15.11 PviDelete, PviXDelete Functions

1.5.15.11.1 Definition for C/C++

int PviDelete (LPCSTR pObjectName)

int PviXDelete (DWORD hPvi, LPCSTR pObjectName)

1.5.15.11.2 Definition for Basic

PviDelete (ByVal pObjectName As String) As Long

PviXDelete (ByVal hPvi As Long, ByVal pObjectName As String) As Long

1.5.15.11.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pObjectName In Pointer to object names or object path names. Given as a null−terminated string.

1.5.15.11.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout).

1.5.15.11.5 Description

This function is the synchronous variant of the PviDeleteRequest / PviDeleteResponse or PviXDeleteRequest /PviXDeleteResponse functionality. See the Asynchronous and Synchronous Functions section.

1.5.15.12 PviLinkRequest, PviXLinkRequest Functions

1.5.15.12.1 Definition for C/C++

int PviLinkRequest (LPCSTR pObjectName, LPVOID hEventMsg, DWORD EventMsgNo, LPARAMEventParam, LPCSTR pLinkDescriptor, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

int PviXLinkRequest (DWORD hPvi, LPCSTR pObjectName, LPVOID hEventMsg, DWORD EventMsgNo,LPARAM EventParam, LPCSTR pLinkDescriptor, LPVOID hResMsg, DWORD ResMsgNo, LPARAMResParam)

1.5.15.12.2 Definition for Basic

PviLinkRequest (ByVal pObjectName As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByValEventParam As Long, ByVal pLinkDescriptor As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long,ByVal ResParam As Long) As Long

PviXLinkRequest (ByVal hPvi As Long, ByVal pObjectName As String, ByVal hEventMsg As Long, ByValEventMsgNo As Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String, ByVal hResMsg As Long,ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long

1.5.15.12.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pObjectName In Pointer to the object name or object path name. Given as a null−terminated

PVI base system

1.5.15.11 PviDelete, PviXDelete Functions 79

Page 86: PviBase

string.

hEventMsg In Definition of the user message which is assigned to the link object forsignaling object event data (events). 0 (zero) cannot be specified for thisparameter.

EventMsgNo In Message number of the user message= 0 (Null): No user message for event data is assigned to the link object In thiscase, any value other than zero can be specified for hEventMsg (e.g.PVI_HMSG_NIL).

EventParam In message parameter of the user message

pLinkDescriptor In Pointer to the link object description. Given as a null−terminated string.

hResMsg In Definition of the user message which signals the response for this functioncall (Requests and Responses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.12.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.12.5 Description

This function sends a request to PVI Manager to set up a link object. Response data must be read with thePviLinkResponse or PviXLinkResponse function unless using a callback function of type PVICALLBACK_DATA.

The object parameters defined with pLinkDescriptor are used when setting up the link object. The applicationreceives a Link ID with the response data for identifying the set up link object.

Example for Visual C++

#include <PviCom.h>

class CPviDlg : public CDialog{ ... int m_LinkRequestCnt; DWORD m_LinkID[256]; long m_ErrCode[256];

void LinkPviObjects (); LRESULT OnPviLinkResp (WPARAM, LPARAM); LRESULT OnPviObjEvent (WPARAM, LPARAM); ... DECLARE_MESSAGE_MAP()};

BEGIN_MESSAGE_MAP(CPviDlg, CDialog) ... ON_MESSAGE (WM_USER+3, OnPviObjEvent) ON_MESSAGE (WM_USER+4, OnPviLinkResp)END_MESSAGE_MAP()

LRESULT CPviDlg::OnPviObjEvent (WPARAM wParam, LPARAM lParam){ ... return (0);}

PVI base system

80 1.5.15.12 PviLinkRequest, PviXLinkRequest Functions

Page 87: PviBase

LRESULT CPviDlg::OnPviLinkResp (WPARAM wParam, LPARAM lParam){ int ErrCode; DWORD LinkID;

ErrCode = PviLinkResponse (wParam, &LinkID); if (ErrCode != 0) m_ErrCode[lParam] = ErrCode; else m_LinkID[lParam] = LinkID;

if (−−m_LinkRequestCnt <= 0) { // last link response was received: ... } return (0);}

void CPviDlg::LinkPviObjects(){ int ErrCode;

// Initialize members: m_LinkRequestCnt = 0; memset (m_LinkID, 0, sizeof (m_LinkID)); memset (m_ErrCode, 0, sizeof (m_ErrCode));

// Link to variable object PVar1 (process value): ErrCode = PviLinkRequest ("@Pvi/LNINA2/COM2/CPU/PVar1", CWnd::m_hWnd, WM_USER+3, 0, "VT=i32 LT=prc", CWnd::m_hWnd, WM_USER+4, 0); if (ErrCode != 0) m_ErrCode[0] = ErrCode; else m_LinkRequestCnt++;

// First link to variable object PVar2 (raw value): ErrCode = PviLinkRequest ("@Pvi/LNINA2/COM2/CPU/PVar2", CWnd::m_hWnd, WM_USER+3, 1, "VT=i32 LT=raw", CWnd::m_hWnd, WM_USER+4, 1); if (ErrCode != 0) m_ErrCode[1] = ErrCode; else m_LinkRequestCnt++;

// Second link to variable object PVar2 (process value): ErrCode = PviLinkRequest ("@Pvi/LNINA2/COM2/CPU/PVar2", CWnd::m_hWnd, WM_USER+3, 101, "VT=i32 LT=prc", CWnd::m_hWnd, WM_USER+4, 101); if (ErrCode != 0) m_ErrCode[101] = ErrCode; else m_LinkRequestCnt++; ...}

1.5.15.13 PviLinkResponse, PviXLinkResponse Functions

1.5.15.13.1 Definition for C/C++

int PviLinkResponse (DWORD wParam, LPDWORD pLinkID)

int PviXLinkResponse (DWORD hPvi, DWORD wParam, LPDWORD pLinkID)

1.5.15.13.2 Definition for Basic

PviLinkResponse (ByVal wParam As Long, ByRef pLinkID As Long) As Long

PviXLinkResponse (ByVal hPvi As Long, ByVal wParam As Long, ByRef pLinkID As Long) As Long

PVI base system

1.5.15.13 PviLinkResponse, PviXLinkResponse Functions 81

Page 88: PviBase

1.5.15.13.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

pLinkID Out Pointer to variables used for recording the Link ID

1.5.15.13.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when thefunction is called (e.g. response data had been previously deleted), then Error 12055 (no response datapresent) is reported.

1.5.15.13.5 Description

This function is used to read the response from a request made by PviLinkRequest or PviXLinkRequest.

The Link ID is written to the variable specified by pLinkID. The link object can be clearly identified later with theLink ID.

Please note:If a user message has been defined with the PviLinkRequest or PviXLinkRequest function call, then thePviLinkResponse or PviXLinkResponse function must be called once the user message is received. However,this does not apply when using a callback function of type PVICALLBACK_DATA.

1.5.15.14 PviLink, PviXLink Functions

1.5.15.14.1 Definition for C/C++

int PviLink (LPDWORD pLinkID, LPCSTR pObjectName, LPVOID hEventMsg, DWORD EventMsgNo, LPARAMEventParam, LPCSTR pLinkDescriptor)

int PviXLink (DWORD hPvi, LPDWORD pLinkID, LPCSTR pObjectName, LPVOID hEventMsg, DWORDEventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor)

1.5.15.14.2 Definition for Basic

PviLink (ByRef pLinkID As Long, ByVal pObjectName As String, ByVal hEventMsg As Long, ByVal EventMsgNoAs Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String) As Long

PviXLink (ByVal hPvi As Long, ByRef pLinkID As Long, ByVal pObjectName As String, ByVal hEventMsg AsLong, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String) As Long

1.5.15.14.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

pLinkID Out Pointer to variables used for recording the Link ID

pObjectName In Pointer to object names or object path names. Given as a null−terminated string.

hEventMsg In Definition of the user message which is assigned to the link object for signaling objectevent data (events). 0 (zero) cannot be specified for this parameter.

EventMsgNo In Message number of the user message= 0 (Null): No user message for event data is assigned to the link object In this case, anyvalue other than zero can be specified for hEventMsg (e.g. PVI_HMSG_NIL).

EventParam In message parameter of the user message

pLinkDescriptor In Pointer to the link object description. Given as a null−terminated string.

PVI base system

82 1.5.15.13 PviLinkResponse, PviXLinkResponse Functions

Page 89: PviBase

1.5.15.14.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout).

1.5.15.14.5 Description

This function is the synchronous variant of PviLinkRequest / PviLinkResponse or PviXLinkRequest /PviXLinkResponse functionality. See the Asynchronous and Synchronous Functions section.

1.5.15.15 PviUnlinkRequest, PviXUnlinkRequest Functions

1.5.15.15.1 Definition for C/C++

int PviUnlinkRequest (DWORD LinkID, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

int PviXUnlinkRequest (DWORD hPvi, DWORD LinkID, LPVOID hResMsg, DWORD ResMsgNo, LPARAMResParam)

1.5.15.15.2 Definition for Basic

PviUnlinkRequest (ByVal LinkID As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByValResParam As Long) As Long

PviXUnlinkRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal hResMsg As Long, ByVal ResMsgNo AsLong, ByVal ResParam As Long) As Long

1.5.15.15.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

hResMsg In Definition of the user message which signals the response for this function call (Requests andResponses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.15.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.15.5 Description

This function sends a request to PVI Manager to release a link object. Response data must be read with thePviUnlinkResponse or PviXUnlinkResponse function unless using a callback function of typePVICALLBACK_DATA.

If no additional link or process objects are assigned to a temporary process object, then the process object isalso released.

Once a link object is released, no more events are via this object. In addition, all requests and response dataassigned to the link object are deleted. The corresponding user message are no longer executed.

PVI base system

1.5.15.14 PviLink, PviXLink Functions 83

Page 90: PviBase

Please note:The application can still receive user messages for response or event data until the response of the unlinkrequest is received.

If the PVICOM application should still receive the response data for all active requests when the link object isreleased, then the release procedure needs to be carried out in two steps:

Send write request with access type POBJ_ACC_CANCEL and value '0' (zero) to the link object. Thiscancels all active requests and carries out the user messages from them. Error 12043 is reported withthe response data.

1.

After receiving the response to the cancel request, send the request for releasing the link object.2.

1.5.15.16 PviUnlinkResponse, PviXUnlinkResponse Functions

1.5.15.16.1 Definition for C/C++

int PviUnlinkResponse (DWORD wParam)

int PviXUnlinkResponse (DWORD hPvi, DWORD wParam)

1.5.15.16.2 Definition for Basic

PviUnlinkResponse (ByVal wParam As Long) As Long

PviXUnlinkResponse (ByVal hPvi As Long, ByVal wParam As Long) As Long

1.5.15.16.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

1.5.15.16.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when thefunction is called (e.g. response data had been previously deleted), then Error 12055 (no response datapresent) is reported.

1.5.15.16.5 Description

This function is used to read the response from a request made by PviUnlinkRequest or PviXUnlinkRequest.

Please note:If a user message has been defined with the PviUnlinkRequest or PviXUnlinkRequest function call, then thePviUnlinkResponse or PviXUnlinkResponse function must be called once the user message is received.However, this does not apply when using a callback function of type PVICALLBACK_DATA.

1.5.15.17 PviUnlink, PviXUnlink functions

1.5.15.17.1 Definition for C/C++

int PviUnlink (DWORD LinkID)

int PviXUnlink (DWORD hPvi, DWORD LinkID)

1.5.15.17.2 Definition for Basic

PviUnlink (ByVal LinkID As Long) As Long

PviXUnlink (ByVal hPvi As Long, ByVal LinkID As Long) As Long

PVI base system

84 1.5.15.16 PviUnlinkResponse, PviXUnlinkResponse Functions

Page 91: PviBase

1.5.15.17.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

1.5.15.17.4 Return value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout).

1.5.15.17.5 Description

This function is the synchronous variant of PviUnlinkRequest / PviUnlinkResponse or PviXUnlinkRequest /PviXUnlinkResponse functionality. See the Asynchronous and synchronous functions section.

Please note:All response and event data for an object is deleted after the PviUnlink or PviXUnlink function is carried out.When using the window message as a user message, however, those user messages already sent can nolonger be deleted (message queue). Error 12055 is returned if a PVICOM application responds to one of theseuser messages by calling a PVI response function (Pvi...Response or PviX...Response) or thePviGetResponseInfo or PviXGetResponseInfo function. The PVICOM application must therefore query for error12055 and handle it accordingly. A better option is using the asynchronous functions PviUnlinkRequest /PviUnlinkResponse or PviXUnlinkRequest / PviXUnlinkResponse. This prevents the situation from happeningsince no additional user message exist for an object once the user message for the unlink response data hasbeen received.

1.5.15.18 PviChgLinkRequest, PviXChgLinkRequest Functions

1.5.15.18.1 Definition for C/C++

int PviChgLinkRequest (DWORD LinkID, DWORD EventMsgNo, LPARAM EventParam, LPVOID hResMsg,DWORD ResMsgNo, LPARAM ResParam)

int PviXChgLinkRequest (DWORD hPvi, DWORD LinkID, DWORD EventMsgNo, LPARAM EventParam,LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

1.5.15.18.2 Definition for Basic

PviChgLinkRequest (ByVal LinkID As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByValhResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long

PviXChgLinkRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal EventMsgNo As Long, ByValEventParam As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) AsLong

1.5.15.18.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

EventMsgNo: In New message number of the user message.= 0 (Null): No user message for event data is assigned to the link object

EventParam In New message parameter of the user message

hResMsg In Definition of the user message which signals the response for this function call (Requestsand Responses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In

PVI base system

1.5.15.17 PviUnlink, PviXUnlink functions 85

Page 92: PviBase

Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.18.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.18.5 Description

This function sends a request to change the user message for event data. Response data must be read with thePviChgLinkResponse or PviXChgLinkResponse function unless using a callback function of typePVICALLBACK_DATA.

If a window message is used as a user message, then the message number (EventMsgNo) and the messageparameter (EventParam) can be changed with PviChgLinkRequest. If using a callback function as a usermessage, only the message parameter can be changed (EventParam). Specifying the message number isirrelevant in this case.

The POBJ_ACC_EVMASK access type is intended to enable or disable events. The PviChgLinkRequest shouldnot be used for this purpose.

1.5.15.19 PviChgLinkResponse, PviXChgLinkResponse Functions

1.5.15.19.1 Definition for C/C++

int PviChgLinkResponse (DWORD wParam)

int PviXChgLinkResponse (DWORD hPvi, DWORD wParam)

1.5.15.19.2 Definition for Basic

PviChgLinkResponse (ByVal wParam As Long) As Long

PviXChgLinkResponse (ByVal hPvi As Long, ByVal wParam As Long) As Long

1.5.15.19.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

1.5.15.19.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when thefunction is called (e.g. response data had been previously deleted), then Error 12055 (no response datapresent) is reported.

1.5.15.19.5 Description

This function is used to read the response from a request made by PviChgLinkRequest or PviXChgLinkRequest.

Please note:If a user message has been defined with the PviChgLinkRequest or PviXChgLinkRequest function call, then thePviChgLinkResponse or PviXChgLinkResponse function must be called once the user message is received.

PVI base system

86 1.5.15.18 PviChgLinkRequest, PviXChgLinkRequest Functions

Page 93: PviBase

However, this does not apply when using a callback function of type PVICALLBACK_DATA.

1.5.15.20 PviChgLink, PviXChgLink Functions

1.5.15.20.1 Definition for C/C++

int PviChgLink (DWORD LinkID, DWORD EventMsgNo, LPARAM EventParam)

int PviXChgLink (DWORD hPvi, DWORD LinkID, DWORD EventMsgNo, LPARAM EventParam)

1.5.15.20.2 Definition for Basic

PviChgLink (ByVal LinkID As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long) As Long

PviXChgLink (ByVal hPvi As Long, ByVal LinkID As Long, ByVal EventMsgNo As Long, ByVal EventParam AsLong) As Long

1.5.15.20.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

pLinkID In Pointer to variables used for recording the Link ID

EventMsgNo: In New message number of the user message= 0 (Null): No user message for event data is assigned to the link object. In this case, anyvalue other than zero can be specified for hEventMsg (e.g. PVI_HMSG_NIL).

EventParam In New message parameter of the user message

1.5.15.20.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is disrupted (communication timeout).

1.5.15.20.5 Description

This function is the synchronous variant of the PviChgLinkRequest / PviChgLinkResponse orPviXChgLinkRequest / PviXChgLinkResponse functionality. See the Asynchronous and Synchronous Functionssection.

1.5.15.21 PviUnlinkAll, PviXUnlinkAll Functions

1.5.15.21.1 Definition for C/C++

int PviUnlinkAll (LPVOID hEventMsg)

int PviXUnlinkAll (DWORD hPvi, LPVOID hEventMsg)

1.5.15.21.2 Definition for Basic

PviUnlinkAll (ByVal hEventMsgAs Long) As Long

PviXUnlinkAll (ByVal hPvi As Long, ByVal hEventMsgAs Long) As Long

1.5.15.21.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

hEventMsg In Window handle or pointer to callback function.

PVI base system

1.5.15.20 PviChgLink, PviXChgLink Functions 87

Page 94: PviBase

1.5.15.21.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the request or if the connection between the communication instance and PVIManager is interrupted (communication timeout).

1.5.15.21.5 Description

This function can be used to release several link objects with one function call. The window handle or callbackpointer specified in "hEventMsg" are compared with user messages to signal event data from all link objects in acommunication instance. If they match, then the corresponding link object is released. In this way, all link objectsassigned to a certain window or callback function can be released.

Once the link objects are released, no more events are sent for this object. In addition, all requests assigned tothe link objects are cancelled and response data is deleted. The corresponding user message are no longerexecuted.

The PviUnlinkAll and PviXUnlinkAll functions work synchronously. There is no asynchronous variant. See theAsynchronous and Synchronous Functions section.

1.5.15.22 PviReadRequest, PviXReadRequest Functions

1.5.15.22.1 Definition for C/C++

int PviReadRequest (DWORD LinkID, DWORD nAccess, LPVOID hResMsg, DWORD ResMsgNo, LPARAMResParam)

int PviXReadRequest (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID hResMsg, DWORDResMsgNo, LPARAM ResParam)

1.5.15.22.2 Definition for Basic

PviReadRequest (ByVal LinkID As Long, ByVal nAccess As Long, ByVal hResMsg As Long, ByVal ResMsgNoAs Long, ByVal ResParam As Long) As Long

PviXReadRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal nAccess As Long, ByVal hResMsg AsLong, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long

1.5.15.22.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

nAccess In Access type

hResMsg In Definition of the user message which signals the response for this function call (Requests andResponses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.22.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

PVI base system

88 1.5.15.21 PviUnlinkAll, PviXUnlinkAll Functions

Page 95: PviBase

1.5.15.22.5 Description

This function sends a read request to a link object. This link object then passes the request on to the assignedprocess object. The link object is set using the LinkID function parameter. If a user message has been definedwith the read request, it will be executed as soon as the PVICOM communication instance receives theresponse from PVI Manager. To read the response data, the application needs to call the PviReadResponse orPviXReadResponse function. This does not apply when using a callback function of type PVICALLBACK_DATA.

An access type is assigned to select how read access takes place. The PviReadArgumentRequest orPviXReadArgumentRequest function needs to be used for read accesses with argument data.

1.5.15.23 PviReadArgumentRequest, PviXReadArgumentRequest Functions

1.5.15.23.1 Definition for C/C++

int PviReadArgumentRequest (DWORD LinkID, DWORD nAccess, LPVOID pArgData, LONG ArgDataLen,LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

int PviXReadArgumentRequest (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID pArgData, LONGArgDataLen, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

1.5.15.23.2 Definition for Basic

PviReadArgumentRequest (ByVal LinkID As Long, ByVal nAccess As Long, ByRef pArgData As Any, ByValArgDataLen As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long

PviXReadArgumentRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal nAccess As Long, ByRefpArgData As Any, ByVal ArgDataLen As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByValResParam As Long) As Long

1.5.15.23.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

nAccess In Access type

pArgData In Pointer to argument data for write access

ArgDataLen In Length of argument data= 0: No argument data present. 0 (zero) may be specified for pArgData.

hResMsg In Definition of the user message which signals the response for this function call (Requests andResponses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.23.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.23.5 Description

This function works similarly to the PviReadRequest or PviXReadRequest function. The only difference is thatargument data for read access can be specified with PviReadArgumentRequest or PviXReadArgumentRequest.Access types which require argument data for read requests (e.g. OBJ_ACC_UPLOAD)therefore need to usethis function.

PVI base system

1.5.15.22 PviReadRequest, PviXReadRequest Functions 89

Page 96: PviBase

1.5.15.24 PviReadResponse, PviXReadResponse Functions

1.5.15.24.1 Definition for C/C++

int PviReadResponse (WPARAM wParam, LPVOID pData, LONG DataLen)

int PviXReadResponse (DWORD hPvi, WPARAM wParam, LPVOID pData, LONG DataLen)

1.5.15.24.2 Definition for Basic

PviReadResponse (ByVal wParam As Long, ByRef pData As Any, ByVal DataLen As Long) As Long

PviXReadResponse (ByVal hPvi As Long, ByVal wParam As Long, ByRef pData As Any, ByVal DataLen AsLong) As Long

1.5.15.24.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

pData Out Pointer to the user data buffer used for recording the response or event data

DataLen In Length of the user data buffer in bytes= 0: Response or event data is not copied. 0 (zero) may be specified for pData.

1.5.15.24.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error can be reported whenreading the response data to a read request if an error occurs when the request is executed, if thecommunication instance connection to PVI Manager is interrupted (communication timeout), or if there is anapplication error. The value '0' signals that the write request has been carried out and the response data in theuser data buffer is valid. Unless there is an application error, an error can only be reported in connection with thePOBJ_EVENT_ERROR when reading event data.

If the reference specified in "wParam" is not valid when the function is called (e.g. response data had beenpreviously deleted), then Error 12055 (no response or event data present) is reported.

1.5.15.24.5 Description

This function is used to read event data or response data from a previously made request by PviReadRequest /PviXReadRequest or PviReadArgumentRequest / PviXReadArgumentRequest.

This response or event data is copied to the user data buffer. If the length of the user data buffer is larger thanthe length actual data, then whatever space remains in the buffer will be filled with binary 0's (zero). If the lengthof user data buffer is smaller than the length of the data, then copying is stopped when the end of the buffer isreached. Any remaining response or event data is lost. To prevent this from happening, the PVI application hasto set the dimensions of the user data buffer accordingly. To achieve this, the application can ask for the lengthof the response/event data with the PviGetResponseInfo or PviXGetResponseInfo function before this functionis called.

Please note:After receiving the user message in connection with a read request or an event, the PviReadResponse orPviXReadResponse must be called. However, this does not apply when using a callback function of typePVICALLBACK_DATA.

1.5.15.25 PviRead, PviXRead functions

1.5.15.25.1 Definition for C/C++

int PviRead (DWORD LinkID, DWORD nAccess, LPVOID pArgData, LONG ArgDataLen, LPVOID pData, LONGDataLen)

PVI base system

90 1.5.15.24 PviReadResponse, PviXReadResponse Functions

Page 97: PviBase

int PviXRead (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID pArgData, LONG ArgDataLen,LPVOID pData, LONG DataLen)

1.5.15.25.2 Definition for Basic

PviRead (ByVal LinkID As Long, ByVal nAccess As Long, ByRef pArgData As Any, ByVal ArgDataLen As Long,ByRef pData As Any, ByVal DataLen As Long) As Long

PviXRead (ByVal hPvi As Long, ByVal LinkID As Long, ByVal nAccess As Long, ByRef pArgData As Any, ByValArgDataLen As Long, ByRef pData As Any, ByVal DataLen As Long) As Long

1.5.15.25.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

nAccess In Access type

pArgData In Pointer to argument data for write access

ArgDataLen In Length of argument data= 0: No argument data present. 0 (zero) may be specified for pArgData.

pData Out Pointer to the user data buffer used for recording the response data

DataLen In Length of the user data buffer in bytes= 0: No response data is copied. 0 (zero) may be specified for pData.

1.5.15.25.4 Return value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the read request or if the connection between the communication instance and PVIManager is disrupted (communication timeout) or if an application error occurs. The value '0' signals that theread request has been carried out and the response data in the user data buffer is valid.

1.5.15.25.5 Description

This function is the synchronous variant of PviReadArgumentRequest / PviReadResponse orPviXReadArgumentRequest / PviXReadResponse functionality. See the Asynchronous and synchronousfunctions section.

1.5.15.26 PviWriteRequest, PviXWriteRequest Functions

1.5.15.26.1 Definition for C/C++

int PviWriteRequest (DWORD LinkID, DWORD nAccess, LPVOID pData, LONG DataLen, LPVOID hResMsg,DWORD ResMsgNo, LPARAM ResParam)

int PviXWriteRequest (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID pData, LONG DataLen,LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)

1.5.15.26.2 Definition for Basic

PviWriteRequest (ByVal LinkID As Long, ByVal nAccess As Long, ByRef pData As Any, ByVal DataLen AsLong, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long

PviXWriteRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal nAccess As Long, ByRef pData As Any,ByVal DataLen As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) AsLong

1.5.15.26.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

PVI base system

1.5.15.25 PviRead, PviXRead functions 91

Page 98: PviBase

LinkID In Link ID from the PviCreateResponse, PviLinkResponse, orPviXCreateResponse, PviXLinkResponse functions.

nAccess In Access type

pData In Pointer to write data

DataLen In Length of the write data in bytes= 0: No write data present. 0 (zero) may be specified for pData.

hResMsg In Definition of the user message which signals the response for this function call(Requests and Responses)= 0 (Null): No response is sent by PVI Manager

ResMsgNo In Message number of the user message= 0 (Null): Same meaning as hResMsg=0.

ResParam In message parameter of the user message

1.5.15.26.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function onlyreports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal functionparameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the definedresponse message is not executed. If an error occurs during data transfer or when handling the request, then itis reported only with the response data.

1.5.15.26.5 Description

This function sends a write request to a link object. This link object then passes the request on to the assignedprocess object. The link object is set using the LinkID function parameter. If a user message has been definedwith the write request, it will be executed as soon as the PVICOM communication instance receives theresponse from PVI Manager. To read the response data, the application needs to call the PviWriteResponse orPviXWriteResponse function. This does not apply when using a callback function of type PVICALLBACK_DATA.

An access type is assigned to each write request to select how write access takes place.

1.5.15.27 PviWriteResponse, PviXWriteResponse Functions

1.5.15.27.1 Definition for C/C++

int PviWriteResponse (WPARAM wParam)

int PviXWriteResponse (DWORD hPvi, WPARAM wParam)

1.5.15.27.2 Definition for Basic

PviWriteResponse (ByVal wParam As Long) As Long

PviXWriteResponse (ByVal hPvi As Long, ByVal wParam As Long) As Long

1.5.15.27.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user messagemust be specified.

1.5.15.27.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. An error can be reported whenreading the response data to a write request if an error occurs when the request is executed, if thecommunication instance connection to PVI Manager is interrupted (communication timeout), or if there is anapplication error. The value '0' signals that the write request has been carried out.

If the reference specified in "wParam" is not valid when the function is called (e.g. response data had beenpreviously deleted), then Error 12055 (no response present) is reported.

PVI base system

92 1.5.15.26 PviWriteRequest, PviXWriteRequest Functions

Page 99: PviBase

1.5.15.27.5 Description

This function is used to read the response data from a request made by PviWriteRequest or PviXWriteRequest.

Please note:After receiving the user message in connection with a write request, the PviWriteResponse/PviXWriteResponseor PviWriteResultResponse/PviXWriteResultResponse function needs to be called. However, this does notapply when using a callback function of type PVICALLBACK_DATA.

1.5.15.28 PviWriteResultResponse, PviXWriteResultResponse functions

1.5.15.28.1 Definition for C/C++

int PviWriteResultResponse (WPARAM wParam, LPVOID pRstData, LONG RstDataLen)

int PviXWriteResultResponse (DWORD hPvi, WPARAM wParam, LPVOID pRstData, LONG RstDataLen)

1.5.15.28.2 Definition for Basic

PviWriteResultResponse (ByVal wParam As Long, ByRef pRstData As Any, ByVal RstDataLen As Long) AsLong

PviXWriteResultResponse (ByVal hPvi As Long, ByVal wParam As Long, ByRef pRstData As Any, ByValRstDataLen As Long) As Long

1.5.15.28.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Reference to the response data. The "wParam" parameter from the user message must bespecified.

pRstData Out Pointer to the user data buffer used for recording the result data

RstDataLen In Length of the user data buffer in bytes= 0: No result data is copied. 0 (zero) may be specified for pRstData.

1.5.15.28.4 Return value

A value other than 0 signals an error. The error code is returned as a value. An error can be reported whenreading the response data to a write request if an error occurs when the request is executed, if thecommunication instance connection to PVI Manager is interrupted (communication timeout), or if there is anapplication error. The value '0' signals that the write request has been carried out.

If the reference specified in "wParam" is not valid when the function is called (e.g. response data had beenpreviously deleted), then Error 12055 (no response present) is reported.

1.5.15.28.5 Description

This function works similarly to the PviWriteResponse or PviXWriteResponse function. The only difference isthat the PviWriteResultResponse or PviXWriteResultResponse function can be used to read result data of awrite access.

Please note:After receiving the user message in connection with a write request, the PviWriteResponse/PviXWriteResponseor PviWriteResultResponse/PviXWriteResultResponse function needs to be called. However, this does notapply when using a callback function of type PVICALLBACK_DATA.

1.5.15.29 PviWrite, PviXWrite functions

1.5.15.29.1 Definition for C/C++

int PviWrite (DWORD LinkID, DWORD nAccess, LPVOID pData, LONG DataLen, LPVOID pRstData, LONGRstDataLen)

PVI base system

1.5.15.27 PviWriteResponse, PviXWriteResponse Functions 93

Page 100: PviBase

int PviXWrite (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID pData, LONG DataLen, LPVOIDpRstData, LONG RstDataLen)

1.5.15.29.2 Definition for Basic

PviWrite (ByVal LinkID As Long, ByVal n Access As Long, ByRef pData As Any, ByVal DataLen As Long, ByRefpRstData As Any, ByVal RstDataLen As Long) As Long

PviXWrite (ByVal hPvi As Long, ByVal LinkID As Long, ByVal n Access As Long, ByRef pData As Any, ByValDataLen As Long, ByRef pRstData As Any, ByVal RstDataLen As Long) As Long

1.5.15.29.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

LinkID In Link ID from the PviCreateResponse, PviLinkResponse or PviXCreateResponse,PviXLinkResponse functions

nAccess In Access type

pData In Pointer to write data

DataLen In Length of the write data in bytes= 0: No write data present. 0 (zero) may be specified for pData.

pRstData Out Pointer to the user data buffer used for recording the result data

RstDataLen In Length of the user data buffer in bytes= 0: No result data is copied. 0 (zero) may be specified for pRstData.

1.5.15.29.4 Return value

A value other than 0 signals an error. The error code is returned as a value. An error is reported if an erroroccurs while carrying out the write request or if the connection between the communication instance and PVIManager is disrupted (communication timeout) or if an application error occurs. The value '0' signals that thewrite request has been carried out and the result data (if present) in the user data buffer is valid.

1.5.15.29.5 Description

This function is the synchronous variant of PviWriteRequest / PviWriteResultResponse or PviXWriteRequest /PviXWriteResultResponse functionality. See the Asynchronous and synchronous functions section.

1.5.15.30 PviGetResponseInfo, PviXGetResponseInfo Functions

1.5.15.30.1 Definition for C/C++

int PviGetResponseInfo (DWORD wParam, LPDWORD pParam, LPDWORD pDataLen, T_RESPONSE_INFO*pInfo, DWORD InfoLen)

int PviGetXResponseInfo (DWORD hPvi, DWORD wParam, LPDWORD pParam, LPDWORD pDataLen,T_RESPONSE_INFO* pInfo, DWORD InfoLen)

1.5.15.30.2 Definition for Basic

PviGetResponseInfo (ByVal wParam As Long, ByRef pParam As Long, ByRef pDataLen As Long, ByRef pInfoAs T_RESPONSE_INFO, ByVal InfoLen As Long) As Long

PviXGetResponseInfo (ByVal hPvi As Long, ByVal wParam As Long, ByRef pParam As Long, ByRef pDataLenAs Long, ByRef pInfo As T_RESPONSE_INFO, ByVal InfoLen As Long) As Long

1.5.15.30.3 Arguments

Argument I/O Description

hPvi In Instance handle from the PviXInitialize function

wParam In Pointer to response or event data. The "wParam" parameter from the usermessage must be specified.

PVI base system

94 1.5.15.29 PviWrite, PviXWrite functions

Page 101: PviBase

pParam Out Pointer to the variable (4 bytes) for recording the user parameter. If the userparameter is not needed, then a null pointer can be specified.

pDataLen Out Pointer to a variable (4 bytes) for recording the length of the response or eventdata. If the length is not needed, then a null pointer can be specified.The value 0 (zero) as a response data length means that there is no responsedata present.

pInfo Out Pointer to a user buffer (T_RESPONSE_INFO structure) where additionalinformation is copied. If additional information is not needed, then a null pointercan be specified.

InfoLen In Size of the user buffer "pInfo" in bytes

1.5.15.30.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. This function only returns errorswhich occur when it is called, such as user errors (e.g. illegal function parameters) or Error 12055 (no responsedata present). Errors which affect the request itself can only be read with the appropriate response function orfrom the RESPONSE_INFO structure.

1.5.15.30.5 Description

The application can use the PviGetResponseInfo or PviXGetResponseInfo function to read information aboutthe response or event data after a user message is received. The function can only be executed before thecorresponding response function is called. This function cannot be used in connection with synchronousfunctions. Calling this function is also not necessary when using a callback function of typePVICALLBACK_DATA as a user message.

1.5.15.31 PviGetVersion Function

1.5.15.31.1 Definition for C/C++

void PviGetVersion (LPSTR pVersionBf, DWORD VersionBfLen)

1.5.15.31.2 Definition for Basic

PviGetVersion (ByVal pVersionBf As String, ByVal VersionBfLen As Long)

1.5.15.31.3 Arguments

Argument I/O Description

pVersionBf Out Pointer to the user buffer for recording the version string

VersionBfLen In Length of the user buffer in bytes

1.5.15.31.4 Description

This function copies the current version string of PVICOM.DLL to the user buffer.

Versions of other PVI components (manager, lines, devices, etc.) can be determined with access typePOBJ_ACC_VERSION.

1.5.16 PVICOM Structures

Structure Description

PROCEEDING_INFO Object events of event type POBJ_EVENT_PROCEEDING transferevent data using the format of the PROCEEDING_INFO structure.

RESPONSE_INFO Information about event or response data is transferred using the formatof the RESPONSE_INFO structure (see User Messages of typeSET_PVICALLBACK_DATA and the PVICOM functionPviGetResponseInfo).

PVI base system

1.5.15.30 PviGetResponseInfo, PviXGetResponseInfo Functions 95

Page 102: PviBase

1.5.16.1 PROCEEDING_INFO Structure

1.5.16.1.1 Structure for C/C++

typedef struct{ DWORD nAccess; DWORD Percent; char Info[32];} T_PROCEEDING_INFO;

1.5.16.1.2 Structure for Basic

Public Type T_PROCEEDING_INFO nAccess As Long Percent As Long Info As String * 32End Type

1.5.16.1.3 Elements

Element Description

nAccess Access type of the running request

Percent Progress given in % (0 − 100)

Info Additional information text for display

1.5.16.2 RESPONSE_INFO Structure

1.5.16.2.1 Structure for C/C++

typedef struct{DWORD LinkID; DWORD nMode; DWORD nType; DWORD ErrCode; DWORD Status;} T_RESPONSE_INFO;

1.5.16.2.2 Structure for Basic

Public Type T_RESPONSE_INFO LinkID As Long nMode As Long nType As Long ErrCode As Long Status As LongEnd Type

1.5.16.2.3 Elements

Element Description

LinkID Link ID

nMode User message modeSee following table

nType Access type or event typeIf an event (nMode = POBJ_MODE_EVENT), then nType contains the type of event. If a response toa read or write request (nMode = POBJ_MODE_READ or nMode = POBJ_MODE_WRITE), thennType contains the access type of the request.

ErrCode If ErrCode is not equal to 0 (zero=, then an error is reported with the response or event data. Thesame error is reported as a return value when reading the response or event data with thecorresponding "Response" function. However, if a different error is passed on as the return value,then this error occurred right when the function was called.

Status Status contains the status flags (bits) of the response or event dataSee following table

PVI base system

96 1.5.16.1 PROCEEDING_INFO Structure

Page 103: PviBase

Definition of status flags (bits) in the "Status" element:

Status flag Bit Description

RESP_STATUS_CAST_OVERFLOW #0 Upper range exceeded during type casting

RESP_STATUS_CAST_UNDERFLOW #1 Lower range exceeded during type casting

RESP_STATUS_OVERFLOW #2 Upper limit value exceeded with the data function

RESP_STATUS_UNDERFLOW #3 Lower limit value exceeded with the data function

RESP_STATUS_POBJ #4 The limit value transgression (RESP_STATUS_OVERFLOW orRESP_STATUS_UNDERFLOW) occurred in the data function ofthe process object.

RESP_STATUS_LINK #5 A limit value transgression (RESP_STATUS_OVERFLOW orRESP_STATUS_UNDERFLOW) occurred in the data function ofthe link object.

RESP_STATUS_INHERIT_ERR #8 Error state was received from a higher−level process object

RESP_STATUS_OVERWRITE #9 Event data overwritten by more current data at least once. See theObject Events section.

Definition for the mode of the user message in the "nMode" element:

Mode No. Description

POBJ_MODE_NULL #0 Undefined

POBJ_MODE_EVENT #1 Global event or object event

POBJ_MODE_READ #2 Response to a PviReadRequest or PviReadArgumentRequest request

POBJ_MODE_WRITE #3 Response to a PviWriteRequest request

POBJ_MODE_CREATE #4 Response to a PviCreateRequest request

POBJ_MODE_DELETE #5 Response to a PviDeleteRequest request

POBJ_MODE_LINK #6 Response to a PviLinkRequest request

POBJ_MODE_CHGLINK #7 Response to a PviChgLinkRequest request

POBJ_MODE_UNLINK #8 Response to a PviUnlinkRequest request

1.6 PVI lines

The basic task of a PVI line is to connect PVI objects (service objects) with objects outside of PVI. The line isalso responsible for communicating with B&R controllers (PLCs) and determines the communication protocol tobe used to do so.

PVI contains the following lines (line servers):

Line name Name and usage

LNINA2 INA2000 line:Communication with the INA2000 protocol (SG3 / SG4)

LNNET2 NET2000 line:Communication with the NET2000 protocol (SG3 / SG4)

LNMINI MININET line:Communication with the MININET protocol (SG2)

LNDCAN Direct CAN line:Sending and receiving CAN messages

LNMTC MTC line:Access to Maintenance Controller (MTC) functions

LNOS9NET OS9/Net line:OS9/Net communication via ARCNET (SG2)

Line servers are Windows DLLs which are loaded by PVI Manager as needed. PVI Setup generates a key entryin the Windows registry with the line name for each installed line. All entries are located under the registry key"HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\PviLine". Each line key includes entries for thename and path of the DLL as well as line−specific parameters.

PVI base system

1.6 PVI lines 97

Page 104: PviBase

1.6.1 Line object

To assign a line server to a line object (process object of type POBJ_LINE), the line name needs to be specifiedin the line object's connection description. This loads the line DLL registered under the line name. Alternatively,the name of the line DLL can be specified in the connection description. However, PVI applications should onlyuse the registered line name for the connection description. Line names are not case sensitive.

Connection description syntax:

/LN=<LineName>

or

<LineName>

If the line name is defined as the /LN parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description example:

CD="/LN=LnIna2"

or

CD=LnIna2

1.6.2 INA2000 line

The INA2000 line is used to communicate with B&R SG3 and SG4 controllers (System 2000) using the INA2000protocol.

The following topics are covered in this section:

INA2000 process objects• INA2000 access types• INA2000 events• INA2000 communication•

1.6.2.1 INA2000 process objects

A line object, a device object, and a CPU object are all need to establish a communication connection to a PLC.

Process objects in the INA2000 line:

Description Type Connection Usage

Line object Line "LNINA2" INA2000 line

Device object Device Device parameters Represents the communication device being used

Station object Station Can be specified, but not required

CPU object CPU Connection parameterPLC name

Represents a PLC within a network or a routed PLC

Module object Module PLC module name Represents a module on the PLC

Task object Task PLC task name Represents a task on the PLC

Variable object Pvar PLC variable name Represents a variable on the PLC

Allowed object structure for INA2000 process objects:

PVI base system

98 1.6.1 Line object

Page 105: PviBase

There is no limit to the number of process objects. Theoretically, any number of device objects can be assignedto a line object, any number of CPU objects can be assigned to a device object, etc.

1.6.2.2 INA2000 access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Type" column indicates which access types in the INA2000 line canbe used with which process object types.

Access types Type Special Features

POBJ_ACC_VERSION LineDeviceCpuModuleTask

Line object: Version of the line DLLDevice object: Version of the INA frame DLL and device DLLCPU object: PLC operating system is read ("Vxxx").Modules and task object: Module version is read ("x.xx").

POBJ_ACC_LIST_EXTERN Line List of all installed (PVI Setup) INA2000 devices

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS CpuModuleTaskPvar

POBJ_ACC_TYPE_EXTERN Pvar

POBJ_ACC_UPLOAD *) Module POBJ_EVENT_PROCEEDING supported

POBJ_ACC_DOWNLOAD *) CPU POBJ_EVENT_PROCEEDING supported

POBJ_ACC_DATE_TIME CpuModule

POBJ_ACC_MEM_DELETE CPU

POBJ_ACC_MEM_INFO CPU

POBJ_ACC_MOD_TYPE Module

POBJ_ACC_UPLOAD_STM Module POBJ_EVENT_PROCEEDING supported

POBJ_ACC_DOWNLOAD_STM CPU POBJ_EVENT_PROCEEDING supported

POBJ_ACC_MOD_DATA Module Read reference data from BR log data objects.This access type is only supported beginning with PLC operating

PVI base system

1.6.2.2 INA2000 access types 99

Page 106: PviBase

system V2.85 (SG4 Automation Runtime).

POBJ_ACC_LIST_STATION Not supported

POBJ_ACC_LIST_CPU Not supported

POBJ_ACC_LIST_MODULE CPU Module objects on the PLC with a module path specification

POBJ_ACC_LIST_TASK CPU Task objects on the PLC with a module path specification

POBJ_ACC_LIST_PVAR CPUtask

CPU object: List of global variablesTask object: List of local and global variables.

The variable list contains additional information such as scope andvariable type.

POBJ_ACC_CPU_INFO CPU

*) Translating BR modules

1.6.2.3 INA2000 events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special Features

POBJ_EVENT_STATUS Support only for link node variables (process object type: Pvar) beginning withPLC operating system V2.80 and for BR log data objects (process object type:Module) beginning with PLC operating system V2.85.

POBJ_EVENT_PROCEEDING Progress events are supported for access types OBJ_ACC_UPLOAD,POBJ_ACC_UPLOAD_STM, POBJ_ACC_DOWNLOAD, andPOBJ_ACC_DOWNLOAD_STM.

1.6.2.4 INA2000 Communication

INA2000 communication is supported on the following devices:

Serial Communication• CAN Communication• Ethernet UDP Communication• Modem Communication• Profibus FDL Communication• LS251 Communication• AR000 Communication•

Each INA2000 communication connection has life sign monitoring. As soon as a connection is established, it ischecked every second by exchanging small data packets (ping/pong).

General PC requirements:

The INA2000 line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me Only the B&R standard CAN card is supported.

Windows NT/2000/XP −

Windows CE Only serial, CAN, and Ethernet communication aresupported.

General PLC requirements:

The INA2000 communication operates on a restricted basis (services) with PLC operating system 1.91. To useall the services (e.g. module upload, download, etc), PLC operating system 2.10 is required.If multi−master capability or a TCP/IP communication between PC and PLC is needed, PLC operating system2.20 or higher must be used. For INA2000 event handling over the PLC (PLC monitors data changes), PLCoperating system 2.24 or higher is needed.

PVI base system

100 1.6.2.3 INA2000 events

Page 107: PviBase

INA2000 requests are processed on the PLC during idle time. To ensure suitable response times, an idle time of20% is a minimum requirement. If 20% idle time cannot be guaranteed for technical reasons, the response timeincreases resulting in a slower data refresh rate.

1.6.2.4.1 Serial Communication

All necessary components are installed with PVI Setup.

Serial communication can only be operated as a point−to−point connection (RS232 or RS422).

1.6.2.4.2 CAN Communication

"CAN" needs to be selected as an additional interface in PVI Setup.

CAN communication is operated as an INA2000 network with a maximum of 32 stations (can be expanded to255). CAN node numbers are used to differentiate between individual stations.

PC requirements:

The description of the B&R CAN device driver can be used to find out which CAN cards can be used with whichWindows platforms.

PLC requirements:

To use INA2000 communication over CAN, CAN communication must be enabled in Automation Studio. See theAutomation Studio documentation (Projects −> Hardware Configuration −> CAN configuration).

1.6.2.4.3 Ethernet UDP Communication

"Ethernet" needs to be selected as an additional interface in PVI Setup.

PC requirements:

The TCP/IP protocol must be installed.

PLC requirements:

To use INA2000 communication over Ethernet, Ethernet communication must be enabled in Automation Studio.See the Automation Studio documentation (Projects −> Hardware Configuration −> Ethernet configuration).

The following applies for SG4 (i386) targets:Configuring the IP address and the station number (INA node number) takes place in the Ethernet Propertiesdialog box in Automation Studio. Additional modules do not have to be transferred to the PLC.

The following applies for SG3 (m68k) targets:The "FBTCPIP.BR" and "TCPIPMGR.BR" modules need to be burned for INA2000 communication. In addition,a "TCPIPCFG.DAT" data object must exist with the appropriate settings.

Using several Ethernet network cards on a PC:

How can you be sure that PVI uses the correct network card to communication with the controller if two or morenetwork cards are located on the PC?

The subnet mask needs to be set correctly so that the correct network card for PLC communication is selected.The IP address of the target station (PLC) is linked with the subnet mask with an AND operation resulting in thecorrect network card being found and used for communication purposes.

Example:

Device parameters: /IF=tcpip /SA=1CPU parameters /DA=13 /DAIP=172.43.70.13IPAdr NW1: 172.43.71.12 Subnet Mask: 255.255.255.0IPAdr NW2: 172.43.70.12 Subnet Mask: 255.255.255.0IPAdr PLC: 172.43.70.13

PVI base system

1.6.2.4 INA2000 Communication 101

Page 108: PviBase

This would make sure that the second network card is used for PLC communication. If a DHCP server isconfigured for a network card, then it must be known which IP address and subnet masks the DHCP serverspecifies so that the second network card can be configured correctly.

1.6.2.4.4 Modem Communication

All necessary components are installed with PVI Setup.

As with serial communication, modem communication is also a point−to−point connection.

Modem features:

Transparency: Standard Windows functions are used to access the modem. In other words, all modemsthat can be installed in Windows can be used. The user just needs to install the modem and doesn'tneed to know anything else about modem technology (AT commands, etc.).

Automatic connection establishment: An active, created connection (see below) is constantly monitored.If the connection is lost (e.g. telephone line interrupted, modem disconnected or turned off), it tries tore−establish the connection in periodic intervals. The number of attempts as well as the intervalsbetween attempts can be configured.

Active connection: Windows establishes a dial−up connection with a specified telephone number andtransfers the protocol determined by the PVI line over this connection.

Passive connection: Windows waits for an incoming call, answers automatically, and makes theconnection. In this operating mode it is possible e.g. for a PLC itself to initiate the connection to aWindows computer with PVI.

PC requirements:

The PVI modem requires Microsoft TAPI version 2.0. This version is already installed in Windows NT 4.0. Whenusing Windows 95, it is necessary to replace the standard TAPI Version 1.4 with a newer version. The currentversion from Microsoft (www.microsoft.com) is version 2.1 To install TAPI Version 2.1 in Windows 95, start the"tapi2195.exe" program in the "Pvi\SysSetup\Modem" directory. This file is installed with the PVI Setup option"Modem System Components".

A modem is installed in the Windows Control Panel under Modems. A new modem can be added in the dialogbox and its settings can be edited ("Properties"). The modem name shown in this dialog box corresponds to themodem name which needs to be specified as a PVI device parameter (/MO).Dialing details are set in "Control Panel Modems" (current location, calling card, etc).

1.6.2.4.5 Profibus FDL Communication

"Profibus" needs to be selected as an additional interface in PVI Setup.

Please note:INA2000 communication over Profibus FDL is only possible on the System 2000. Other systems are notsupported by PVI!

Settings for PLC Profibus cards (NW100 / NW150) and the PC card (5A1104.00−090) can be taken from thePROFIBUS User's Manual (MASYS2PB−E).

PC requirements:

Data transfer with the PC occurs using a 32−kb DPR. An available address range must be set on the PC for thispurpose. This is set with HEX−switches SW1 and SW2 on the Profibus card (SW1 = 0; SW2 = D). If only oneProfibus card is used in the system, the jumpers BR1 and BR2 are left open. Additional information can befound in the Profibus User's Manual.

To ensure that the memory on the PC is also free, the memory area must be excluded in BIOS. On theIPC5000, either 32 bytes (1 Profibus card) or 64 bytes (two Profibus cards) must be excluded starting at thebase address D000 under "PNP/PCI Configuration" in BIOS.

PLC requirements:

NW100 or NW150 with revision xx.05 or higher

PVI base system

102 1.6.2.4 INA2000 Communication

Page 109: PviBase

On the PLC, operating system V.2.00 or higher is necessary. The "FBPB.BR" module must be burned forINA2000 communication. The Profibus configuration module is already a component of the operating systemand can be modified using suitable tools if necessary.

To allow INA2000 communication via Profibus, the configuration for INA2000 Profibus communication must beupdated in the Sysconf module.

1.6.2.4.6 LS251 Communication

"LS251" needs to be selected as an additional interface in PVI Setup.

PC requirements:

In Windows NT/2000/XP, the LS251 card is automatically detected by the operating system when inserted. Thecorresponding driver can then be selected under "Pvi\Drivers\Ls251\W2k_xx" in the Hardware Wizard.

Runtime PLC requirements:

PLC operating system V2.01 or higher must be installed on the LS251.

1.6.2.4.7 AR000 Communication

"AR000" needs to be selected as an additional interface in PVI Setup.

PC requirements:

AR000 Runtime Emulation must be installed.

1.6.2.5 INA2000 device objects

The communication device being used is determined with the INA2000 device object. The followingcommunication devices can be defined:

Serial device• CAN device• Ethernet UDP device• Modem device• Profibus FDL device• LS251 device• AR000 device•

The communication device is defined in the device object's connection description with the necessary deviceparameters. Within the connection description, individual parameters are differentiated between using parameteridentifiers. These parameter identifiers always begin with the "/" character.

Connection description syntax:

/IF=<DeviceName> [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

The /IF parameter is common to all communication devices. All other parameters depend on the communicationdevice being used. Device names are not case sensitive, and at least one space character must be betweeneach parameter specification.

The connection description must always be specified in quotation marks ("...") in the object description.

Connection description example:

CD="/IF=com1 /BD=57600 /PA=2"

1.6.2.5.1 Serial device

The following table shows all parameters which can be defined for serial communication in the device object'sconnection description.

PVI base system

1.6.2.4 INA2000 Communication 103

Page 110: PviBase

Par. Value Default Description

/IF com1 ...comX

None By default: COM1 to COM4. With some serial interface cards or adapters, it is possible tohave more than COM4.Example: "/IF=com1"

/BD 9600,19200,38400,57600,115200

57600 Baud rate in bits per secondExample: "/BD=38400"

/RS −1, 0,232,422,485

232 Sets the RS232 or RS422 protocol. RS485 is not supported by INA2000.Example: "/RS=422"

This parameter sets the flow control of the CTS (clear to send) and RTS (request tosend) lines of the serial interface.Possible parameter values:= −1: PVI doesn't modify the current setting (see the interface device properties) of theCTS/RTS flow control.= 0: Always shut off the RTS line (disables RTS flow control).= 232: Use RTS handshake.= 422: Always turn on the RTS line.= 485: Turn on the RTS line at the beginning of a transfer or during the transfer.CTS flow control is disabled whenever the parameter value >= 0.

Many USB/serial adapters (USB to serial interface) do not handle CTS/RTS flow controlcorrectly. The parameter "/RS=0" must be specified to establish an RS232 connectionusing these adapters.

/PA 0 − 4 1 Parity setting0=NO PARITY1=ODD PARITY2=EVEN PARITY3=MARK PARITY4=SPACE PARITY

Default setting for INA2000 communication is "/PA=2".

Connection description example:

CD="/IF=com2 /BD=115200 /PA=2"

1.6.2.5.2 CAN device

To address an INACAN device, it has to first be set up as a CAN device with the B&R CAN device configurator.Configuring CAN devices is done via the "CAN Devices" menu item in the Control Panel. The device list in theconfigurator shows all CAN devices which have already been set up. The device number must also be specifiedin the PVI device name. The CAN1 device corresponds to the PVI device name INACAN1. CAN2 correspondsto INACAN2, etc. The B&R CAN device configurator is also used to set device resources (IRQs, port addresses,etc.).

The following table shows all parameters which can be defined for CAN communication in the device object'sconnection description.

Par. Value Default Description

/IF inacan1 ...inacanX

None CAN device. The device being used has to be entered in the device list of theB&R CAN device configurator.Example: "/IF=inacan1"

/CNO 0, 1 0 CAN controller number (channel).2 CAN controllers are available on the LS172 card. The desired controller isselected with the /CNO parameter. No value other than 0 (zero) may bespecified for the default CAN controller.Examples for LS172 card:CAN bus 1: "/IF=inacan2 /CNO=0"

PVI base system

104 1.6.2.5 INA2000 device objects

Page 111: PviBase

CAN bus 2: "/IF=inacan2 /CNO=1"

/IT 0 − 60000,0 = off

0 Interval timeout (msec)Defines the maximum time which is to pass between two CAN messages whenreceiving or sending an INA frame. This parameter is used together with the /RTparameter for the INA2000 CPU object to detect a broken connection.This parameter is not allowed to be less than the reaction time for the controller(5 msec for PLC) plus a reserve of at least 25 ms (accordingly higher for heavyinterrupt loads on the PCs), but should be smaller than /RT. If quick detection ofthe broken connection is not required, monitoring interval timeouts does notneed to be enabled (/IT=0). Example: "/IT=80"

/BI 0 − 2047 /536870911

1598 Base CAN ID for INA2000 communicationEvery station in the INA2000 network must have the same setting.Example: "/BI=1598"

/MDA 32 − 255 32 Number of maximum possible INA2000 stations (= highest station number)Every station in the INA2000 network must have the same setting.Example: "/MDA=50"

/SA 1 − /MDA 1 Station number of the source station (separate station)The station number must be unique within the INA2000 network.Example: "/SA=3"

/BD 10000,20000,50000,100000,125000,150000,250000,500000,800000,1000000

*) Baud rate (data rate) on the CAN bus in bits per second. This parameter canalso be specified in kBits per second.Every station in the INA2000 network must have the same setting.Example: "/BD=250000" or "/BD=250"

/CMODE 11, 29 *) CAN communication with 29−bit identifiers (extended frames) or 11−bitidentifiers (standard frames).If 29−bit CAN identifiers (extended frames) are used, then 11−bit identifierscannot be sent or received.Every station in the INA2000 network must have the same setting.Example: "/CMODE=29"

/CT >= 1,0 = off

*) Cycle time (in ms) within which the specified number (maximum) of CANmessages are sent (/MC parameter).Values < 20 ms don't make sense.Example: "/CT=20"

/MC >= 1 *) Maximum number of CAN messages sent within the specified cycle time (/CTparameter).Example: "/MC=15"

*) The /BD, /CMODE, /CT, and /MC parameters can also be set using the B&R CAN device configurator. Ifthese parameters are not specified in the connection description (the recommended method), then thevalues set in the configurator are used instead. If one of these parameters is specified in the connectiondescription, then the corresponding configurator setting is overwritten.

The /CT and /MC parameters are used to limit messages. These allow the number of sent CAN messages to berestricted per cycle. This can reduce the load from the PC to the CAN bus. This could be important if otherstations on the bus can only process a certain number of received CAN messages with the set baud rate, or iftheir interrupt load in general should be reduced. However, the disadvantage of limiting frames is slower CANcommunication.

Connection description example:

CD="/IF=inacan3 /CNO=1 /SA=3"

PVI base system

1.6.2.5 INA2000 device objects 105

Page 112: PviBase

1.6.2.5.3 Ethernet UDP device

The following table shows all parameters which can be defined for Ethernet UDP communication in the deviceobject's connection description.

Par. Value Default Description

/IF tcpip None Ethernet UDP deviceSpecification: "/IF=tcpip"

/LOPO 1024 − 32767 11159 Port number of the source station (separate station)If the value is specified in hexadecimal, then "0x" must be usedto introduce the value (e.g. "/LOPO=0x2b97").A different default port number then only needs to be set if it isnot unique within the local computer.Example: "/LOPO=11159"

/SA 0 − 99 / 255 1 Station number of the source station (separate station)The station number must be unique within the INA2000 network.The highest station number possible is 99 for SG3 targets and255 for SG4 targets.Example: "/SA=3"

Connection description example:

CD="/IF=tcpip /SA=3"

1.6.2.5.4 Modem device

The following table shows all parameters which can be defined for modem communication in the device object'sconnection description.

Par. Value Default Description

/IF modem1 ...modemX

None Modem deviceExample: "/IF=modem1"

/MO Modemname

None Name of the modem, as it appears in the Setup dialog box(Control Panel −> Modems). The string must be enclosed insingle quotation marks. If single quotes are to be used in thestring, then the whole expression needs to be enclosed byanother set of single quotes (e.g. m'56k is specified as/MO='m''56k' ).Example: "/MO='MicroLink 56k'"

/TN Telephonenumber

None Telephone number. Telephone number to be dialed accordingto the "ITU−T Recommendation E.123" format, e.g.+43(7748)6586. The entire telephone number should alwaysbe specified (with country code). Conversions to the actualnumber are done automatically. This string must be written insingle quotation marks. If a call is being waited for, an emptystring should be entered (/TN='').Example: "/TN='+43(7748)6586'"

/MR 0 − INFINITE INFINITE Maximum number of unsuccessful dialing attempts. Specifieshow often it should be attempted to re−establish a brokenconnection. If "INFINITE" is specified, redialing continuesindefinitely. A value 0 means that no attempts at redialing aremade.The /MR parameter is only relevant if /TN is not empty.Examples: "/MR=50", "/MR=INFINITE"

/RI 0 − 3600 60 Time interval between dialing attempts in seconds. If a dialingattempt fails, then this time interval is always observed beforeanother attempt is made. The /RI parameter is only relevant if/TN is not empty.Example: "/RI=120"

/IT 0 − 60000 40

PVI base system

106 1.6.2.5 INA2000 device objects

Page 113: PviBase

Interval timeout (msec)Defined as the maximum time that can pass betweenreceiving two consecutive characters.Example: "/IT=100"

The /MO and /TN parameters must always be specified along with the /IF parameter.

The operating system automatically reads the serial interface. This function is carried out using a buffer wherethe data received is stored. The operating system stops reading if one of the following situations occurs:

The buffer is full.1. A time span longer than the interval timeout has passed since the last character was received.2.

Because of this, setting the /IT parameter for the interval timeout is extremely important. If the interval timeout istoo small, INA2000 frames can be lost. This would cause the connection to be broken. If it is too big, datathroughput is reduced because the interval timeout passes before the PC detects a received frame. The presetvalue of 40 ms has been selected due to measurements that show that a modem (using internal buffering) caninsert breaks of approx. 35 ms into byte flow. Normally, it is not necessary to choose another value. However,increasing the timeout value may be necessary e.g. when using other types of modems or when line quality ispoor (modems have their own transfer security with automatic send retry).

Connection description example:

CD="/IF=modem1 /MO='ZyXEL MODEM Omni 288S' /TN='+43(7748)999'"

1.6.2.5.5 Profibus FDL device

The following table shows all parameters which can be defined for Profibus FDL communication in the deviceobject's connection description.

Par. Value Default Description

/IF pbusfdl1 ...pbusfdlX

None Profibus deviceExample: "/IF=pbusfdl1"

/BA 0x00000 −0xFFFFF

0xD0000 Base address of the DPR on the Profibus card. If the value is specified inHexadecimal, then "0x" must be used to introduce the value.Example: "/BA=0xD0000"

/FF Path name*)

nw_load.bin Path name of the firmware file for the Profibus cardExample: "/FF=nw.bin"

/FC Path name*)

nw_pb_32.br Path name of the network configuration file for the Profibus cardExample: "/FC=nw_pb.br"

/CB 1 − 255 2 Amount of communication buffers on the Profibus cardExample: "/CB=4"

/SA 0−127 1 Station number of the source station (separate station)The station number must be unique within the INA2000 network.Example: "/SA=2"

*) Default firmware and configuration files are components of PVI. If a path is not specified, then the filesmust be located in the PVI Manager directory.

Settings such as baud rate and timeout are not to be defined via the device parameters. This is done bymodifying the configuration file using suitable tools.

Connection description example:

CD="/IF=pbusfdl1 /FF=c:\pbconfig\nw_load.bin /FC=c:\pbconfig\nw_pb_32.br /SA=1"

1.6.2.5.6 LS251 device

The following table shows all parameters which can be defined for LS251 communication in the device object'sconnection description.

PVI base system

1.6.2.5 INA2000 device objects 107

Page 114: PviBase

Par. Value Default Description

/IF ls251_1 ...ls251_9

None LS251 deviceExample: "/IF=ls251_1"

Connection description example:

CD="/IF=ls251_1"

1.6.2.5.7 AR000 device

The following table shows all parameters which can be defined for AR000 communication in the device object'sconnection description.

Par. Value Default Description

/IF ar000_1 None AR000 deviceExample: "/IF=ar000_1"

Connection description example:

CD="/IF=ar000_1"

1.6.2.6 INA2000 CPU objects

The CPU object is used to determine the PLC in a network or using Routing and to set parameters for thecommunication connection. The following stations can be defined in the CPU object depending on thecommunication device being used:

Serial station• CAN station• Ethernet UDP station• Modem station• Profibus FDL station• LS251 station• AR000 station•

The parameters for determining the PLC are defined in the connection description of the CPU object. Thecommunication device being used is defined by the higher−level device object. Within the connectiondescription, individual parameters are differentiated between using parameter identifiers. These parameteridentifiers always begin with the "/" character.

Connection description syntax:

[/CN=<RoutingPath>] [/SP=<PathName>] [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

With the exception of the /CN and /SP parameters, CPU object parameters are also dependent on thecommunication device being used. At least one empty space is to be entered between the individual parameterspecifications.

The connection description must always be specified in quotation marks ("...") in the object description.

Connection description example:

CD="/CN=IF3/IF2.7 /DA=2 /RT=400"

1.6.2.6.1 Serial station

The following table shows all parameters which can be defined for serial communication in the CPU object'sconnection description.

Par. Values Default Description

/CN Path None

PVI base system

108 1.6.2.5 INA2000 device objects

Page 115: PviBase

Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/RT 1−65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. The timein which an interrupted connection is detected is a result of the Response Timeout *4.Example: "/RT=400".

Connection description example:

CD="/RT=400"

1.6.2.6.2 CAN station

The following table shows all parameters which can be defined for CAN communication in the CPU object'sconnection description.

Par. Values Default Description

/CN Path None Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/DA 1 − 32 / 255 2 Station number of the target station.The station number must be unique within the INA2000 network.Example: "/DA=5"

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. Thetime in which an interrupted connection is detected is a result of the ResponseTimeout * 4.Example: "/RT=600"

Rule of thumb for the RT setting for CAN:275 ms * number of CAN stations + 100 ms

/RW 1 100000=none

*) Write request delay time in msecWith a delay time for write requests, a defined delay must pass between receiving amessage from a CAN station on the bus and sending the next message to this CANstation. Example: "/RW=30"

*) The /RW parameter can also be set with the B&R CAN device configurator. If this parameter is notspecified in the connection description, then the value set in the configurator is used. If thisparameter is specified in the connection description, then the corresponding configurator setting isoverwritten for this station (PLC communication connection).

Connection description example:

CD="/DA=13 /RT=600"

1.6.2.6.3 Ethernet UDP station

The following table shows all parameters which can be defined for Ethernet UDP communication in the CPUobject's connection description.

Par. Values Default Description

/CN Path None

PVI base system

1.6.2.6 INA2000 CPU objects 109

Page 116: PviBase

Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/DA 1 − 99 / 255 7 Station number of the target station.Automatic identification of the target station from the station number. Thestation number must be unique within the INA2000 network. The highest stationnumber possible is 99 for SG3 targets and 255 for SG4 targets.Example: "/DA=56"

/DAIP IP addressHost name

None IP address of the target stationManual identification of the target station from the IP address or identificationfrom the host name (DNS, only possible for SG4).Examples: "/DAIP=68.10.10.27" ... IP address, "/DAIP=CP340su" ... Hostname.

Specifying the /DA parameter depends on whether the /DAIP parameter isspecified:If the /DAIP parameter is not specified, then the /DA parameter must always bespecified. If the /DAIP parameter is specified as an IP address, the /DAparameters is optional. If /DA is specified, however, the defined station numbermust be correct. If the /DAIP parameter is specified as a host name, the /DAparameter is ignored.

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. Thetime in which an interrupted connection is detected is a result of the ResponseTimeout * 4.Example: "/RT=200"

/REPO 1025 − 32767 11159 TCP/IP port number of the target stationIf the value is specified in Hexadecimal, then "0x" must be used to introducethe value (e.g. "/LOPO=0x2b97").The port number must match the setting on the target station (PLC).Example: "/REPO=11159"

/CKDA 0 / 1 1 Enables or disables the check to see if the target station number (/DAparameter) is unique.The /CKDA parameter is irrelevant if used together with the /DAIP parameter(check is always disabled).Example: "/CKDA=0" ... Checking is disabled.

The target station can be identified with either the /DA parameter or with the /DAIP parameter. If the /DAparameter is used, then all PLC stations on the network must have their own unique station numbers (nodeswitch setting or configured node number). When the connection is established, the INA2000 line checkswhether the PLC station numbers are unique. If more than one PLC has the same station number in thenetwork, the connection is broken. This check can be disabled with the /CKDA parameter.

Target stations are identified automatically using broadcasts. However, some network components (switches /ISDN routers, etc.) do not pass along the broadcast. Because of this, automatically identifying the target stationis not possible. In this case, the target station muse be identified with the /DAIP parameter. If there are morethan 99 or 255 PLC stations connected to the network, then the /DAIP parameter must also be used. Then allPLC stations can use the same node numbers.

Connection description examples:

CD="/DA=5 /RT=200"

CD="/DAIP=10.43.50.244 /RT=200"

PVI base system

110 1.6.2.6 INA2000 CPU objects

Page 117: PviBase

1.6.2.6.4 Modem station

The following table shows all parameters which can be defined for modem communication in the CPU object'sconnection description.

Par. Values Default Description

/CN Path None Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. The timein which an interrupted connection is detected is a result of the Response Timeout *4.Example: "/RT=350"

For modem communication, this parameter's default value is usually not suitable. Forhouse internal communication, 350 ms is appropriate. A larger value must be usedduring long−distance telephone connections (especially satellite calls).

Response timeout:

The response timeout necessary can be calculated by adding up the following times.

2 * transfer time when using a defined transfer rate between modems (or between the PC and modemshould this be smaller) for 255 bytes

1.

Signal runtime in both directions (significant during satellite communication or normal long−distanceconnections)

2.

2 * delay, which normally results in 80 ms (2 * 40 ms)3. Reaction time of the opposite station (a maximum value of 20 msec can be assumed for a PLC)4. When routing to the opposite station (path specification), 20 ms must be added for each path segment5.

Connection description example:

CD="/RT=350"

1.6.2.6.5 Profibus FDL station

The following table shows all parameters which can be defined for Profibus FDL communication in the CPUobject's connection description.

Par. Values Default Description

/CN Path None Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/DA 1 − 127 5 Station number of the target station.The station number must be unique within the INA2000 network.Example: "/DA=2"

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. The timein which an interrupted connection is detected is a result of the Response Timeout *4.Example: "/RT=300"

Connection description example:

PVI base system

1.6.2.6 INA2000 CPU objects 111

Page 118: PviBase

CD="/DA=2 /RT=300"

1.6.2.6.6 LS251 station

The following table shows all parameters which can be defined for LS251 communication in the CPU object'sconnection description.

Par. Values Default Description

/CN Path None Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. The timein which an interrupted connection is detected is a result of the Response Timeout *4.Example: "/RT=200"

Connection description example:

CD="/RT=200"

1.6.2.6.7 AR000 station

The following table shows all parameters which can be defined for AR000 communication in the CPU object'sconnection description.

Par. Values Default Description

/CN Path None Path specification for RoutingExample: "/CN=IF3/IF2.7"

/SP Path name None Pathname of the working directory for storing temporary module information.Specifying a working directory speeds up the identification of variables.Example: "/SP=c:\Temp\"

/RT 1 − 65535 275 Response timeout in millisecondsIf a response to a sent frame is not received with this time, then the frame istransferred again. After the third retry, the connection is deemed cancelled. The timein which an interrupted connection is detected is a result of the Response Timeout *4.Example: "/RT=200"

Connection description example:

CD="/RT=200"

1.6.2.6.8 Routing

Routing can be used to establish a connection to PLC stations on other networks via a PLC stationcommunication connection. These connections can also run via several PLC stations. Individual stations aredefined in the routing path.

The following graphic shows an example of a network configuration and corresponding PVI process objects:

PVI base system

112 1.6.2.6 INA2000 CPU objects

Page 119: PviBase

The PC is only serially connected to PLC 1. The PLC stations are connected via a CAN network one after theother. Communication to PLC 2 and PLC 3 take place via PLC 1. For this, the routing path must be specified inthe respective CPU objects.

Routing path:

Syntax:

<Entry1>/<Entry2>/.../<EntryN>

Individual path entries are separated by a "/" character.

Syntax for entry:

SL<Slot>.SS<Subslot>.IF<Interface>.<Address>

All parts of the entry are separated by "." (period) characters. The specifications for SL<Slot> and SS<Subslot>do not need to be specified for 0 or 1. The <Address> entry is only needed for connection over a network.

SL<Slot> Slot number: 0 (1) − 15.

SS<Subslot> Subslot number: 1 − 3.

IF<Interface> Interface number: 1 − 15.

<Address> Station address: 1 − ff (hexadecimal)

Routes to or via peripheral processors:

CP Main processor

PP<Slot> Peripheral process, slot number: 0 (1) −15.

If a peripheral processor should be routed to another peripheral processor, then the path specification must beconducted via the CPU.

Examples:

/CN=IF3/IF2.7

From the PC to the first PLC, then via IF3 to the next station (PLC) and from there to a CAN station with stationnumber 7 via IF2.

/CN=SL6.IF1

PVI base system

1.6.2.6 INA2000 CPU objects 113

Page 120: PviBase

From PC to the first PLC, then from there via Slot 6 (e.g. IF050) and IF1.

/CN=PP3

From the PC to the first PLC and then to peripheral processor 3.

PLC requirements:

PLC operation system beginning with version V2.20.The number of parallel connections defines how many entries are possible in the internal routing table. Themaximum configurable number of parallel connections is 16. Configuring parallel connections has an effect onthe memory being used by the system. Memory is "given away" by configuring unnecessary parallelconnections. The number of communication channels defines the number of "physical communicationchannels", so that for each open connection an entry is dynamically occupied and, additionally, an entry for thedefault configured "PG2000" connection is necessary. For this reason, the configured number must be at leastone greater than the number of parallel connections.

The following changes need to made in Sysconf:

Communication ConnectionsNumber of parallel connections (sum from client andserver connections)1<= conn_cnt <= 16

Communication Channels 5 + conn_cnt (+1 for each inserted PB card)

System SemaphoresLocIQDrv: 2 InaIQDrv: 2 + 2 * 2 * conn_cnt ==>(default+8) <=Semaphores <= (default+68)

Stack >=0x00014000

1.6.2.7 INA2000 Module Objects

The INA2000 module object represents the module present on the PLC.

The name of the module must be specified in the connection description. Module names are case sensitive.

Connection description syntax:

/RO=<ModuleName>

or

<ModuleName>

If the module name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=Module1"

CD=Module2

1.6.2.8 INA2000 Task Objects

The INA2000 task object represents a PLC task.

The name of the task must be specified in the connection description. Task names are case sensitive.

Connection description syntax:

/RO=<TaskName>

PVI base system

114 1.6.2.7 INA2000 Module Objects

Page 121: PviBase

or

<TaskName>

If the task name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=Task1"

CD=Task2

1.6.2.9 INA2000 variable objects

This section covers normal PLC variables (PVs). The features of link node variables are covered in a differentsection.

The INA2000 variable object represents a PLC variable. An INA2000 variable object can be created at twodifferent positions in the PVI object structure. If the variable object is created under a CPU object, then a globalPLC variable is addressed. If the variable object is created under an INA2000 task object, then a local PLCvariable (task variable) is addressed.

The name of the PLC variable must be specified in the connection description. Variable names are casesensitive.

Please note:INA2000 can only address variable up to 64 KB in size. Variables bigger than 64 KB can only be used inconnection with the extended BR module format. The extended BR module format is supported by PLCoperating system V2.85 or higher (SG4 Automation Runtime only).

The INA2000 line supports PLC event variables (see also the AT parameter). Monitoring for changes in theprocess data is already being carried out on the PLC. PVI Manager doesn't need to carry out any cyclic readrequests. If the data in a PLC variables is not changed very often (at least not as often as the refresh time), thenoperating as a PLC event variable can reduce the data coming up in INA2000 communication. However, onedisadvantage of this is an increased need for computing time on the PLC. It needs to be noted that specifyingthe refresh time (RF parameter) also has an effect on PLC event variables. Only single variables can beoperated as PLC event variables.

INA2000 only guarantees data consistency for single variables that are a maximum of 4 bytes in size. If the datafrom entire structures or fields should be transferred consistently, the user must implement correspondingmeasures (e.g. with handshake variables).Example: the data for a structure should be written on one side (e.g. PLC), and read and checked forconsistency on the other side (e.g. PC). when doing this, a counter variable is used at the start (first element)and at the end (last element) of the structure. A 1 or 2 byte counter is sufficient for applications. On the PLC, thesecond counter (last element in the structure) is increased by 1 (add 1 to counter state) before writing thestructure data. Then the structure data between the counters can be written. After the write procedure, the valueof the second counter is transferred to the first counter (first element in the structure). On the PC, the states ofthe two counters can be compared. If they are the same, the structure data between the counters is consistent.

The data format of the variable object is given by the INA2000 line and corresponds to that of the PLC variableor an element of the PLC variable. An alignment of 2 is used for structure variables on SG3 targets and analignment of 4 on SG4 targets.

Connection description syntax:

Single variables, array variables, and structure variables:

/RO=<variable_name>

or

<variable_name>

PVI base system

1.6.2.9 INA2000 variable objects 115

Page 122: PviBase

Element of an array variable:

/RO=<variable_name>[<index>]

or

<variable_name>[<index>]

Range of an array variable:

/RO=<variable_name>[<index 1>−<index 2>]

or

<variable_name>[<index1>−<index2>]

Element of a structure variable:

/RO=<variable_name>.<element_name>

or

<variable_name>.<element_name>

Dynamic variables are specified like static variables. If a pointer to a dynamic variables should be read, then "&"needs to precede the name.

If the variable name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=TempValue"

Singe variable "TempValue" is addressed.

CD=TempField[2]

The 3rd element (index begins with 0) of an array variable is addressed.

CD=TempField[1−5]

Elements 2 through 6 of an array variable are addressed. The data format in the process object corresponds tothat of the array variable on the PLC. However, the number of array elements is only 5.

CD=Vert.Stat.TempField[0]

The 1st element of an array variable inside the "Stat" structure and the "Vert" structure is addressed.

CD=Sensor[3].Value

The "Value" element within the 4th element of the "Sensor" structure−array variable is addressed.

CD="&ViewBf"

Pointer to the dynamic variable "ViewBf" is addressed.

Example of object description:

AT=rwe CD="/RO=TempValue"

Single variable "TempValue" is addressed and operated as a PLC event variable.

PVI base system

116 1.6.2.9 INA2000 variable objects

Page 123: PviBase

1.6.2.10 Translating BR Modules

In PVI, a module download is carried out with access type POBJ_ACC_DOWNLOAD, and a module upload iscarried out with access type POBJ_ACC_UPLOAD.

If a module type is defined in the call string (MT parameter), reference data is extracted from the BR moduleduring the upload or a BR module is generated from the reference data during a download.

This procedure is carried out in special PVI components − BR module translation libraries (Windows DLLs). Thefirst three characters in the module type determine the translation library being used. This is loaded by theINA2000 line if need be. PVI Setup generates a key entry in the Windows registry for each installed translationlibrary. All key entries are located under the registry key "...\Pvi\PviLine\LNINA2\BR_TypeTranslation". Thename of the key corresponds to the first 3 characters of the module type. Each key contains entries for the pathname of the translation library as well as for specific parameters.

Module Type Description

BRT Binary Module Translation

NC_ NC Module Translation

1.6.2.10.1 Binary Module Translation

Additional parameters in the call string during download / upload:

Param. Description

MT "MT=BRT" must be specified.

MV When downloading, it is possible to specify the version number of themodule.

Example of a complete call string for module downloading:

"C:\BRSRC\test1.txt" "MT=BRT MN=Test1 MV=1.0" LD=Ram

Example of a complete call string for module uploading:

"C:\BRSRC\test1.txt" "MT=BRT"

1.6.2.10.2 NC Module Translation

Additional parameters in the call string during download / upload:

Param. Description

MT The desired NC module type ("NC_...") must be specified.

RL When uploading, the language of any comments can be specified in a generated text.

Supported module types for module downloading (MT parameter):

Module Type Description

NC_CNC CNC program

NC_ZP0 Zero offset table

NC_TDT Tool data table

NC_RPT R parameter table

NC_CAM Cam profile, definition using slave position(s)

NC_CAP Cam profile, definition using polynomial(s)

Supported module types for module uploading (MT parameter):

ModuleType

Description

NC_xxx

PVI base system

1.6.2.10 Translating BR Modules 117

Page 124: PviBase

NC data object. When uploading the module, specifying "MT=NC_" is sufficient since the moduletype is read from the module header.

Adjustable languages (RL parameter):

Language Description

GER, DEU, 49 or 049 Comments in German

ENG, USA, 1, 001 Comments in English

Example of a complete call string for module downloading:

"C:\BRSRC\cnctest.txt" "MT=NC_CNC MN=CncObj1" LD=Ram

Example of a complete call string for module uploading:

"C:\BRSRC\cnctest.txt" "MT=NC_ RL=ENG"

1.6.2.11 Link node variables

A link node represents the status of a connection between a PV and an I/O point.

Link node variables in PVI can be used for observation (e.g. evaluating the link node status) or monitoring (e.g.displaying data from inputs regardless of the force state). INA2000 data acquisition is a bit slower with link nodevariables as it is with normal variables (PVs). For this reason, normal variables are the better choice forvisualization tasks.

Please note:Link node variables can only be used beginning with PLC operating system V2.80 (SG4 Automation Runtime). Ifthe PLC operating system doesn't support link node variables, error 4599 is reported in the PVI variable object.

In the INA2000 line, the data and status of a link node are accessed using INA2000 variable objects. Like globalPLC variables, these variable objects must be set up under the CPU object. PVI can be used to access theproducer, force, and consumer values of a link node. The following image shows the PVI "pick−up" points withina link node for the producer, force, and consumer values.

Each of the three pick−up points (producer, force, and consumer) are mapped in PVI using a separate variableobject. Code letters in the variable object's connection description are used for differentiation. The producer andconsumer values can only be read (read−only access). The force value can be both read and written. Link nodevariables cannot be used as PLC event variables. Otherwise, link node variables behave the same as normalvariables (PLC PVs) in PVI.

Connection description syntax:

/RO=<code>+<link_node_name>

or

<code>+<link_node_name>

PVI base system

118 1.6.2.11 Link node variables

Page 125: PviBase

<code> Pick−up point

P Producer value

F Force value

C Consumer value

The link node name begins with the percent character (%). This is followed by the prefix 'I' (input), 'Q' (output) or'M' (memory) and the prefix 'X' (1−bit), 'B' (1−byte), 'W' (2−byte), 'D' (4−byte) or 'L' (8−byte) according to IEC IEC61131−3. The next data point path is separated by a period (.) character.

If the /RO parameter is specified, the connection description must always be specified in quotation marks ("...")in the object description.

Connection description example:

CD="/RO=C+%IX.SL3.Input10"

Accesses the consumer value of the link node variable "Input10" on slot 3.

1.6.2.11.1 Link node status

The status of a link node can be read via all connected variable objects (POBJ_ACC_STATUS access type).Link node variables in the INA2000 line also support status events (POBJ_EVENT_STATUS event type).

The link node status in INA2000 is read together with the link node data. This allows the status to always be ascurrent as the data.

Link node status syntax:

ST=Lkn.<source> FC=<force> UL=<unresolved_link> [IO=<attribute>]

Par. Description

ST <source> is used to specify the source of the link node variable'sdata."d" .. Default value, "p" .. Producer value, "f" .. Force valueSpecifying the source depends on the pick−up point being used.

FC <force> is used to specify the force state.1 .. Force active, 0 .. Force inactive

UL <unresolved_link> signals PV links to the link node.1 .. At least one PV link present, 0 .. No PV links present

IO <attribute> signals the type of I/O link."r" .. Link with input, "w" .. Link with outputIf the IO parameter is not specified, there is no I/O link.

Example of link node status:

ST=Lkn.p FC=0 UL=1 IO=r

1.6.3 NET2000 line

The NET2000 line is used to communicate with B&R SG3 and SG4 controllers (System 2000) using theNET2000 protocol.

The following topics are covered in this section:

NET2000 process objects• NET2000 access types• NET2000 events• NET2000 communication•

PVI base system

1.6.2.11 Link node variables 119

Page 126: PviBase

1.6.3.1 NET2000 process objects

A line object, a device object, and a station object are all needed to establish a communication connection to aPLC. However, the connection is only established with the first variable object.

Process objects in the NET2000 line:

Name Type Connection Usage

Line object Line "LNNET2" NET2000 line

Device object Device Device parameter Represents the communication device being used

Station object Station Station number Represents a NET2000 station (PLC) in a network

CPU object CPU Can be specified, but not required

Module object Module Can be specified, but not required

Task object Task PLC task name Represents a task on the PLC

Variable object Pvar PLC variable name Represents a variable on the PLC

Allowed object structure for NET2000 process objects:

1.6.3.2 NET2000 access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Type" column indicates which access types in the NET2000 line canbe used with which process object types.

Access types Type Special features

POBJ_ACC_VERSION LineDevice

Line object: Version of the line DLLDevice object: Version of the NET2000 state machine, INA frameDLL, and device DLL

POBJ_ACC_LIST_EXTERN Line List of all installed (PVI Setup) NET2000 devices

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS Not supported

POBJ_ACC_TYPE_EXTERN Pvar

POBJ_ACC_UPLOAD Not supported

PVI base system

120 1.6.3.1 NET2000 process objects

Page 127: PviBase

POBJ_ACC_DOWNLOAD Not supported

POBJ_ACC_DATE_TIME Not supported

POBJ_ACC_MEM_DELETE Not supported

POBJ_ACC_MEM_INFO Not supported

POBJ_ACC_MOD_TYPE Not supported

POBJ_ACC_UPLOAD_STM Not supported

POBJ_ACC_DOWNLOAD_STM Not supported

POBJ_ACC_LIST_STATION Not supported

POBJ_ACC_LIST_CPU Not supported

POBJ_ACC_LIST_MODULE Not supported

POBJ_ACC_LIST_TASK Not supported

POBJ_ACC_LIST_PVAR Not supported

POBJ_ACC_CPU_INFO Not supported

1.6.3.3 NET2000 events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special features

POBJ_EVENT_STATUS Not supported

POBJ_EVENT_PROCEEDING Not supported

1.6.3.4 NET2000 Communication

NET2000 communication is supported on the following devices:

Serial communication• Modem communication• LS251 communication•

NET2000 is a master/slave protocol where the PVI NET2000 line carries out the functions of the master. Amultimaster function is not possible via the NET2000 protocol. Identifying variables using NET2000 requests iscarried out during the idle time by the PLC. NET2000 requests for reading and writing variable data areexecuted in a defined task class (NET2000.task_class). This enables the response time to be influenced by theselected task class.

A NET2000 communication connection doesn't provide life sign monitoring. If the NET2000 line is not requestingany data from the PLC (e.g. if there are no active variable objects present), then the existence of the NET2000communication connection cannot be monitored.

General PC requirements:

The NET2000 line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me −

Windows NT/2000/XP −

Windows CE Only supports serial communication

General PLC requirements:

PLC operating system V2.20 or higher is needed for NET2000 communication. In addition, a NET2000 slavedriver is needed on the PLC (NET2000 library).

PVI base system

1.6.3.3 NET2000 events 121

Page 128: PviBase

1.6.3.4.1 Serial Communication

All necessary components are installed with PVI Setup.

Serial communication can be operated as a point−to−point connection (RS232/RS422) or as a networkconnection (RS485).

PLC requirements:

For RS485 operation, take note that active/passive switching of the RS485 interface can take up to 15msec inWindows NT and up to 10msec in Windows 95. This can cause a bus collision with a PLC response. Setting theidle time on the PLC can delay the response frame by the required time. The idle time is specified in characterswhen NET2000 is initialized.

Example: NET2000.mode = "RS485,19200,I=100"

Since the response frame requires a minimum of 10 ms because it runs in the PLC task class(NET2000.task_class=1), the difference can be determined with the idle time (1 character corresponds to:1/baud rate * 11 bits).

RS485 network:

Executed as an RS485 twisted pair cable, shielded. Cross−section: min. 0.5 mm². Wave impedance: 120 ohms.Terminating resistance: 120 ohms on both ends. Length: maximum 1,200 meters. Maximum line resistance: 50ohms per wire.

The cabling for the RS485 network can only be made using a bus structure. The bus connection can be madeeither directly or using a maximum 0.25 m long branch line.

1.6.3.4.2 Modem Communication

All necessary components are installed with PVI Setup.

As with serial communication (RS232/RS422), modem communication is also a point−to−point connection.

Modem features:

Transparency: Standard Windows functions are used to access the modem. In other words, all modemsthat can be installed in Windows can be used. The user just needs to install the modem and doesn'tneed to know anything else about modem technology (AT commands, etc.).

Automatic connection establishment: An active, created connection (see below) is constantly monitored.If the connection is lost (e.g. telephone line interrupted, modem disconnected or turned off), it tries tore−establish the connection in periodic intervals. The number of attempts as well as the intervalsbetween attempts can be configured.

Active connection: Windows establishes a dial−up connection with a specified telephone number andtransfers the protocol determined by the PVI line over this connection.

Passive connection: Windows waits for an incoming call, answers automatically, and makes theconnection. In this operating mode it is possible e.g. for a PLC itself to initiate the connection to aWindows computer with PVI.

PC requirements:

The PVI modem requires Microsoft TAPI version 2.0. This version is already installed in Windows NT 4.0. Whenusing Windows 95, it is necessary to replace the standard TAPI Version 1.4 with a newer version. The currentversion from Microsoft (www.microsoft.com) is version 2.1 To install TAPI Version 2.1 in Windows 95, start the"tapi2195.exe" program in the "Pvi\SysSetup\Modem" directory. This file is installed with the PVI Setup option"Modem System Components".

A modem is installed in the Windows Control Panel under Modems. A new modem can be added in the dialogbox and its settings can be edited ("Properties"). The modem name shown in this dialog box corresponds to themodem name which needs to be specified as a PVI device parameter (/MO).Dialing details are set in "Control Panel Modems" (current location, calling card, etc).

PVI base system

122 1.6.3.4 NET2000 Communication

Page 129: PviBase

1.6.3.4.3 LS251 Communication

"LS251" needs to be selected as an additional interface in PVI Setup.

PC requirements:

In Windows NT/2000/XP, the LS251 card is automatically detected by the operating system when inserted. Thecorresponding driver can then be selected under "Pvi\Drivers\Ls251\W2k_xx" in the Hardware Wizard.

Runtime PLC requirements:

PLC operating system V2.01 or higher must be installed on the LS251.

1.6.3.5 NET2000 device objects

The communication device being used is determined with the NET2000 device object. The followingcommunication devices can be defined:

Serial device• Modem device• LS251 device•

The NET2000 protocol parameters apply for all communication devices.

The communication device with the necessary device parameters and NET2000 protocol parameters aredefined in the connection description of the device object. Within the connection description, individualparameters are differentiated between using parameter identifiers. These parameter identifiers always beginwith the "/" character.

Connection description syntax:

/IF=<DeviceName> [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

The /IF parameter as well as the NET2000 protocol parameters are common to all communication devices.Device parameters depend on the communication device being used. Device names are not case sensitive, andat least one space character must be between each parameter specification.

The connection description must always be specified in quotation marks ("...") in the object description.

Connection description example:

CD="/IF=com1 /BD=57600 /RS=422"

1.6.3.5.1 Serial device

The following table shows all device parameters which can be defined for serial communication in the deviceobject's connection description.

Par. Value Default Description

/IF com1 ...comX

None By default: COM1 to COM4. With some serial interface cards or adapters, it ispossible to have more than COM4.Example: "/IF=com1"

/BD 9600,19200,38400,57600,115200

57600 Baud rate in bits per secondExample: "/BD=38400"

/RS −1, 0,232,422,485

232 Sets the RS232, RS422, or RS485 protocolExample: "/RS=485"

This parameter sets the flow control of the CTS (clear to send) and RTS (request tosend) lines of the serial interface.

PVI base system

1.6.3.4 NET2000 Communication 123

Page 130: PviBase

Possible parameter values:= −1: PVI doesn't modify the current setting (see the interface device properties) of theCTS/RTS flow control.= 0: Always shut off the RTS line (disables RTS flow control).= 232: Use RTS handshake.= 422: Always turn on the RTS line.= 485: Turn on the RTS line at the beginning of a transfer or during the transfer.CTS flow control is disabled whenever the parameter value >= 0.

Many USB/serial adapters (USB to serial interface) do not handle CTS/RTS flowcontrol correctly. The parameter "/RS=0" must be specified to establish an RS232connection using these adapters.

/PA 0 − 4 1 Parity setting0=NOPARITY1=ODDPARITY2=EVENPARITY3=MARKPARITY4=SPACEPARITY

Default setting for NET2000 communication is "/PA=1".

/IT 0 − 60000 20 Interval timeout (msec)Defined as the maximum time that can pass between receiving two consecutivecharacters. The NET2000 protocol uses this time to recognize the end of a receivedframe.Example: "/IT=40"

For additional parameters, see NET2000 protocol parameters.

Connection description example:

CD="/IF=com2 /BD=115200 /RS=485"

RS232 Vs. RS485:

When using several PLCs, the RS232 single connection (n device objects, each with one station object) offers ahigher overall transfer speed when compared with an RS485 network connection (one device object with nstation objects). The reason for this is that only one PLC can be accessed at a time (request/responseoperation) over an RS485 network connection. Communication with RS232 single connections is carried outsimultaneously. However, the disadvantage of RS232 single connections is the more complex hardware andwiring systems required.

1.6.3.5.2 Modem device

The following table shows all device parameters which can be defined for modem communication in the deviceobject's connection description.

Par. Value Default Description

/IF modem1 ...modemX

None Modem deviceExample: "/IF=modem1"

/MO Modemname

None Name of the modem, as it appears in the Setup dialog box(Control Panel −> Modems). The string must be enclosed insingle quotation marks. If single quotes are to be used in thestring, then the whole expression needs to be enclosed byanother set of single quotes (e.g. m'56k is specified as/MO='m''56k' ).Example: "/MO='MicroLink 56k'"

/TN Telephonenumber

None Telephone number. Telephone number to be dialed accordingto the "ITU−T Recommendation E.123" format, e.g.+43(7748)6586. The entire telephone number should alwaysbe specified (with country code). Conversions to the actualnumber are done automatically. This string must be written in

PVI base system

124 1.6.3.5 NET2000 device objects

Page 131: PviBase

single quotation marks. If a call is being waited for, an emptystring should be entered (/TN='').Example: "/TN='+43(7748)6586'"

/MR 0 − INFINITE INFINITE Maximum number of unsuccessful dialing attempts. Specifieshow often it should be attempted to re−establish a brokenconnection. If "INFINITE" is specified, redialing continuesindefinitely. A value 0 means that no attempts at redialing aremade.The parameter /MR is only relevant when /TN is not empty.Example: "/MR=50", "/MR=INFINITE"

/RI 0 − 3600 60 Time interval between dialing attempts in seconds. If a dialingattempt fails, then this time interval is always observed beforeanother attempt is made. The Parameter /RI is only relevantwhen /TN is not empty.Example: "/RI=120"

/IT 0 − 60000 40 Interval timeout (msec)Defined as the maximum time that can pass betweenreceiving two consecutive characters. The NET2000 protocoluses this time to recognize the end of a received frame.Example: "/IT=100"

For additional parameters, see NET2000 protocol parameters.

The /MO and /TN parameters must always be specified along with the /IF parameter.

The operating system automatically reads the serial interface. This function is carried out using a buffer wherethe data received is stored. The operating system stops reading if one of the following situations occurs:

The buffer is full.1. A time span longer than the interval timeout has passed since the last character was received.2.

Because of this, setting the /IT parameter for the interval timeout is extremely important. If the interval timeout istoo small, NET2000 frames can be lost. This would cause the connection to be broken. If it is too big, datathroughput is reduced because the interval timeout passes before the PC detects a received frame. The presetvalue of 40 ms has been selected due to measurements that show that a modem (using internal buffering) caninsert breaks of approx. 35 ms into byte flow. Normally, it is not necessary to choose another value. However,increasing the timeout value may be necessary e.g. when using other types of modems or when line quality ispoor (modems have their own transfer security with automatic send retry).

Connection description example:

CD="/IF=modem1 /MO='ZyXEL MODEM Omni 288S' /TN='+43(7748)999'"

1.6.3.5.3 LS251 device

The following table shows all device parameters which can be defined for LS251 communication in the deviceobject's connection description.

Par. Value Default Description

/IF ls251_1 ...ls251_9

None LS251 deviceExample: "/IF=ls251_1"

For additional parameters, see NET2000 protocol parameters.

Connection description example:

CD="/IF=ls251_1"

PVI base system

1.6.3.5 NET2000 device objects 125

Page 132: PviBase

1.6.3.5.4 NET2000 protocol parameters

The following table shows the adjustable NET2000 protocol parameters for the device object.

Par. Value Default Description

/SA 1 − 254 1 Node number for the NET2000 masterExample: "/SA=2"

/RC 0 − 255,0 = none

3 Retry counter for errorsExample: "/RC=0"

/TE 100 − 60000 3000 Timeout for identification requests (ms)Example: "/TE=1000"

/TT 100 − 60000 500 Timeout for read/write requests (ms)Example: "/TT=100"

/TQ 100 − 60000 3000 Timeout for cross talk (ms)Example: "/TQ=2000"

/SR 0 − 3 0 Suppress identification retry depending on the error. See the following table.Example: "/SR=2"

Suppressing identification retries:

In NET2000, PVI has to identify all variables on the PLC (Get OV Service) before they can be addressed (read /write variable data). If an error occurs during identification, PVI retries the identification procedure until the errorsituation is corrected. For certain system configurations, it is possible that the error status is desired. Forexample, a PVI application (e.g. visualization) can use variables which will only be created on the PLC in a latersystem expansion. In this case, the identification of these variables would be repeated continuously and greatlyslow down NET2000 communication. Make sure that the PLC identification requests are handled in the idletime. If there is not very much idle time available on the PLC, this will cause additional delays in the NET2000protocol. The "/SR" parameter can help. With this parameter, identification retries can be suppressed for certainerrors.

"/SR=0" No suppression (default setting)

"/SR=1" Suppresses error 12601 (variable does not exist on the PLC)

"/SR=2" Suppresses all errors from the PLC (12600 to 12699)

"/SR=3" Suppresses all NET2000 errors except for the communication timeout (error 12510)

The "/SR=3" setting should only be used sparingly since this could also include errors which could be caused bytemporary disturbances on the cable connection. If an error occurs with "/SR" selected, PVI switches thecorresponding process object to a continuous error status. This can only be corrected by changing theconnection description (CD=...) or by deleting and re−creating the affected process object.

Procedure for setting parameters:

The /RC parameter (retry counter) should first be set to zero ("/RC=0) to set the optimum values of thecommunication parameters. The parameters for baud rate (/BD parameter) and timeouts (/TE and /TTparameters) are then trimmed. The following basic rule applies: Highest possible baud rate, lowest possibletimeout times. The lowest allowed value for timeouts results from the following: Maximum PLC response time +maximum transfer time for 512 bytes + 10 ms (reserve). The /RC parameter (retry counter) can only be set to ahigher value when the communication can function without disturbances.

The /TE parameter is only effective when identifying variables (initialization phase) and reading external datatypes. Variable identification is carried out on the PLC during idle time. As a result, it is important to ensure thatthere is enough idle time available. If there is not, the /TE parameter has to be increased.

The /TT parameter is effective when reading and writing variable data. On the PLC, read/write services are notexecuted during idle time, but in a defined task class (NET2000.task_class). In this way, response time can beinfluenced by the task class being used.

Example of a connection description in good communication conditions:

CD="/IF=com1 /BD=115200 /RC=2 /TE=500 /TT=100 /SR=1"

PVI base system

126 1.6.3.5 NET2000 device objects

Page 133: PviBase

Example of a connection description in bad communication conditions:

CD="/IF=com2 /BD=38400 /IT=40 /RC=3 /TE=2500 /TT=500 /SR=1"

1.6.3.6 NET2000 Station Objects

The NET2000 station object defines a NET2000 station (PLC) in a network.

The station number of the NET2000 station must be specified in the connection description. Values of 1 through254 are possible as station numbers.

Connection description syntax:

/CN=<StationNumber>

or

<StationNumber>

If the station number is defined as the /CN parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/CN=127"

CD=200

1.6.3.7 NET2000 Task Objects

The NET2000 task object represents a PLC task.

The name of the task must be specified in the connection description. Task names are case sensitive.

Connection description syntax:

/RO=<TaskName>

or

<TaskName>

If the task name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=Task1"

CD=Task2

1.6.3.8 NET2000 Variable Objects

The NET2000 variable object represents a PLC variable. A NET2000 variable object can be created at twodifferent positions in the PVI object structure. If the variable object is created under a station object, then aglobal PLC variable is addressed. If the variable object is created under an NET2000 task object, then a localPLC variable (task variable) is addressed.

The name of the PLC variable must be specified in the connection description. These names are case sensitive.

Please note:NET2000 can only address variables up to 502 bytes in size.

PVI base system

1.6.3.6 NET2000 Station Objects 127

Page 134: PviBase

The NET2000 line supports PLC event variables (see also the AT parameter). Monitoring for changes in theprocess data is already being carried out on the PLC. PVI Manager doesn't need to carry out any cyclic readrequests. If the data in a PLC variables is not changed very often (at least not as often as the refresh time), thenoperating as a PLC event variable can reduce the data coming up in NET2000 communication. However, onedisadvantage of this is an increased need for computing time on the PLC. It needs to be noted that specifyingthe refresh time (RF parameter) also has an effect on PLC event variables. Only single variables can beoperated as event variables.

Please note:Sine NET2000 can only transfer data from PLC event variables with read or write requests, pay attention that atleast one variable is read cyclically (polled) per station. A refresh rate should be defined for these variableswhich is less than or equal to the smallest PLC event variable refresh rate.

The data format of the variable object is given by the NET2000 line and corresponds to that of the PLC variableor an element of the PLC variable. An alignment of 2 is used for structure variables.

Connection description syntax:

Single variables, array variables, and structure variables:

/RO=<VariableName>

or

<VariableName>

Element of an array variable:

/RO=<VariableName>[<Index>]

or

<VariableName>[<Index>]

Element of a structure variable:

/RO=<VariableName>.<ElementName>

or

<VariableName>.<ElementName>

Dynamic variables must begin with the "*" character.

If the variable name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=TempValue"

Singe variable "TempValue" is addressed.

CD=TempField[2]

The 3rd element (index begins with 0) of an array variable is addressed.

CD=Vert.Stat.TempField[0]

The 1st element of an array variable inside the "Stat" structure and the "Vert" structure is addressed.

CD="*ViewBf"

PVI base system

128 1.6.3.6 NET2000 Station Objects

Page 135: PviBase

Pointer to the dynamic variable "ViewBf" is addressed.

Example of object description:

AT=rwe CD="/RO=TempValue"

Single variable "TempValue" is addressed and operated as a PLC event variable.

1.6.4 MININET line

The MININET line uses the MININET protocol and is primarily intended for communication with B&RMULTI/MIDI/MINI and compact (SG2) controllers. In principle, it is also possible to communication with SG3 andSG4 controllers (System 2000) using Mininet. However, the NET2000 or INA2000 line is more suitable for this.

The following topics are covered in this section:

MININET process objects• MININET access types• MININET events• MININET communication•

1.6.4.1 MININET process objects

A line object, a device object, and a station object are all needed to establish a communication connection to aMININET station.

Process objects of the MININET line:

Name Type Connection Usage

Line object Line "LNMINI" MININET line

Device object Device Device parameter Represents the communication device being used

Station object Station Station number Represents a MININET station (PLC) in a network

CPU object CPU Can be specified, but not required

Module object Module Can be specified, but not required

Task object Task Can be specified, but not required

Variable object Pvar Variable name Represents a variable on the PLC

Object structure for MININET process objects:

PVI base system

1.6.4 MININET line 129

Page 136: PviBase

1.6.4.2 MININET access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Access type" column indicates which access types in the MININETline can be used with which process object types.

Access types Type Special features

POBJ_ACC_VERSION LineDevice

Line object: Version of the line DLLDevice object: Version of the INA frame DLL

POBJ_ACC_LIST_EXTERN Line List of all installed MININET devices

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS Not supported

POBJ_ACC_TYPE_EXTERN Not supported

POBJ_ACC_UPLOAD Not supported

POBJ_ACC_DOWNLOAD Not supported

POBJ_ACC_DATE_TIME Not supported

POBJ_ACC_MEM_DELETE Not supported

POBJ_ACC_MEM_INFO Not supported

POBJ_ACC_MOD_TYPE Not supported

POBJ_ACC_UPLOAD_STM Not supported

POBJ_ACC_DOWNLOAD_STM Not supported

POBJ_ACC_LIST_STATION Not supported

POBJ_ACC_LIST_CPU Not supported

POBJ_ACC_LIST_MODULE Not supported

POBJ_ACC_LIST_TASK Not supported

POBJ_ACC_LIST_PVAR Not supported

POBJ_ACC_CPU_INFO Not supported

1.6.4.3 MININET events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special features

POBJ_EVENT_STATUS Not supported

POBJ_EVENT_PROCEEDING Not supported

1.6.4.4 MININET Communication

MININET communication is only supported on serial devices. Serial communication can be operated as apoint−to−point connection (RS232) or as a network connection (RS485).

MININET is a master/slave protocol where the PVI MININET line carries out the functions of the master. Amultimaster function is not possible via the MININET protocol.

PC Requirements:

All necessary components are installed with PVI Setup.

The MININET line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me −

Windows NT/2000/XP −

Windows CE Not possible

PVI base system

130 1.6.4.2 MININET access types

Page 137: PviBase

Requirements for SG2 controllers (MULTI/MIDI/MINI and Compact):

B&R standard software (model number: SWSPSCOM01−0 for 3.5")

Function blocks:

PLC mode Hardware Max. baudrate

DFMN.MSL NETWORK ADAPTER MININET V0.01

DPMN.PRG Mininet Driver NP02 / PP40 Network p. NP02 19200

DTMN.TAB Configuration Table for DFMN

NDSA.MSL MININET − SLAVE DRIVER A V2.40 PIFA/PIF1/PIF3 7200

NDSB.MSL MININET − SLAVE DRIVER B V2.15 PP40/CP31/.. 19200

NDSC.MSL MININET − SLAVE DRIVER C V2.40 CP63/CP80/PP60 19200

NDSD.MSL MININET − SLAVE DRIVER D V0.00 PRTS without FIFO 19200

NDSE.MSL MININET − SLAVE DRIVER E V0.00 PRTS with FIFO 19200

NPLS.MSL MININET − SLAVE PLC V2.04

MDSA.MSL MININET/PLC − SLAVE A V2.30 PIFA/PIF1/PIF3 =NDSA + NPLS 7200

MDSB.MSL MININET/PLC − SLAVE B V2.15 PP40/CP31/.. =NDSB + NPLS 19200

MDSC.MSL MININET/PLC − SLAVE C V2.50 CP63/CP80/PP60 =NDSC + NPLS 19200

SPOIO mode Hardware Max.Baud Rate

NDSA.MSL MININET − SLAVE DRIVER A V2.40 PIFA/PIF1/PIF3 7200

NDSB.MSL MININET − SLAVE DRIVER B V2.15 PP40/CP31/.. 19200

NDSC.MSL MININET − SLAVE DRIVER C V2.40 CP63/CP80/PP60 19200

NDSD.MSL MININET − SLAVE DRIVER D V0.00 PRTS without FIFO 19200

NDSE.MSL MININET − SLAVE DRIVER E V0.00 PRTS with FIFO 19200

NSPO.MSL MININET − SLAVE SPOIO PLC V2.04

MSSA.MSL MININET/SPOIO − SLAVE A V2.41 PIFA/PIF1/PIF3 =NDSA + NSPO 7200

MSSB.MSL MININET/SPOIO − SLAVE B V2.21 PP40/CP31/.. =NDSB + NSPO 19200

MSSC.MSL MININET/SPOIO − SLAVE C V2.60 CP63/CP80/PP60 =NDSC + NSPO 19200

Requirements for SG3/SG4 controllers (System 2000):

PLC operating system starting from V1.91

dvframe.br starting from V3.30 (included starting with PG2000 V2.39 / model no. 1A2000.01)drv_mn.slb starting from V1.30 (model number: 1A2224.01)

RS485 network:

A maximum of 32 stations can be connected to a bus.

Executed as an RS485 twisted pair cable, shielded. Cross−section: min. 0.5 mm². Wave impedance: 120 ohms.Terminating resistance: 120 ohms on both ends. Length: maximum 1,200 meters. Maximum line resistance: 50ohms per wire.

PVI base system

1.6.4.2 MININET access types 131

Page 138: PviBase

The cabling for the RS485 network can only be made using a bus structure. The bus connection can be madeeither directly or using a maximum 0.25 m long branch line.

1.6.4.5 MININET device objects

The communication device being used is determined with the MININET device object. The communicationdevice with the necessary device parameters and MININET protocol parameters are defined in the connectiondescription of the device object. Within the connection description, individual parameters are differentiatedbetween using parameter identifiers. These parameter identifiers always begin with the "/" character.

Connection description syntax:

/IF=<DeviceName> [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

Device names are not case sensitive, and at least one space character must be between each parameterspecification.

The connection description must always be specified in quotation marks ("...") in the object description.

The following table shows all parameters which can be defined in a device object's connection description.

Par. Value Default Description

/IF com1 ...comX

None By default: COM1 to COM4. With some serial interface cards oradapters, it is possible to have more than COM4.Example: "/IF=com1"

/BD 1200,1800,2400,3600,4800,7200,9600,19200

57600 Baud rate in bits per secondExample: "/BD=19200"

/RS −1, 0,232,422,485

232 Sets the RS232 or RS422 protocol.Example: "/RS=485"

This parameter sets the flow control of the CTS (clear to send) andRTS (request to send) lines of the serial interface.Possible parameter values:= −1: PVI doesn't modify the current setting (see the interfacedevice properties) of the CTS/RTS flow control.= 0: Always shut off the RTS line (disables RTS flow control).= 232: Use RTS handshake.= 422: Always turn on the RTS line.= 485: Turn on the RTS line at the beginning of a transfer or duringthe transfer.CTS flow control is disabled whenever the parameter value >= 0.

Many USB/serial adapters (USB to serial interface) do not handleCTS/RTS flow control correctly. The parameter "/RS=0" must bespecified to establish an RS232 connection using these adapters.

/PA 0 − 4 1 Parity setting0=NOPARITY1=ODDPARITY2=EVENPARITY3=MARKPARITY4=SPACEPARITY

Default setting for MININET communication is "/PA=0".

/IT 0 − 60000 20 Interval timeout (msec)Defined as the maximum time that can pass between receiving two

PVI base system

132 1.6.4.5 MININET device objects

Page 139: PviBase

consecutive characters. The MININET protocol uses this time torecognize the end of a received frame.Example: "/IT=40"

/TT 0 − 60000 3000 Timeout for requests (ms)This value must correspond at least to the maximum response timeof the controller + the transfer time of 256 characters (depends onthe baud rate).Example: "/TT=512"

/RETRY 1 − 255 3 Retry counter for errorsAfter a request is sent, a valid response must be received with thetime /TT. Otherwise, the procedure is repeated. The maximumnumber of retries can be modified with /RETRY. An error is onlyreported after the last retry takes place.Example: "/RETRY=2"

Connection description example:

CD="/IF=com1 /RS=485 /BD=19200 /PA=0 /IT=20 /TT=500 /RETRY=2"

1.6.4.6 MININET Station Objects

The MININET station object defines a MININET station (controller) in a network.

The station number of the MININET station (controller) must be specified in the connection description. It is alsopossible to set the SPOIO protocol type.

The values 17 − 31, 33 − 47, and 49 − 63 are allowed as station numbers.

Connection description syntax:

/CN=<StationNumber> [/MODE=<ProtocolType>]

or

<StationNumber> [/MODE=<ProtocolType>]

Par. Value Default Example Description

/MODE SPS,SPOIO

SPS "/MODE=SPOIO" Protocol type used on the controllerThe SPOIO protocol type allows simultaneous read and write datatransfer of several data blocks in a frame. In contrast, only onerequest can be transferred in a frame with the SPS protocol type.

If at least one parameter is defined, the connection description must always be specified in quotation marks("...") in the object description.

Connection description examples:

CD="/CN=17 /MODE=SPOIO"

CD=17

1.6.4.7 MININET Variable Objects

The data format of the variable object is not given by the MININET line. It has to be defined by the user. Thetotal length of the process variable cannot exceed the maximum length of a MININET frame (240 bytes).

A counter (register) or flag is defined for the controller in the connection description.

Connection description syntax:

/RO=<Connection>

PVI base system

1.6.4.6 MININET Station Objects 133

Page 140: PviBase

or

<Connection>

Memory type Connection Min. offset Max. offset Example

Counter C<Offset> or R<Offset> 0000 7095 "C1000"

Flag *) M<Offset> or F<Offset> 000 799 "M137"

*) Can only be used in SPOIO mode.

If the connection is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Example of object description:

CD="/RO=C926" VT=i16

CD=C926 VT=i16

The memory range beginning with Counter 926 is read and written as a 2−byte integer value.

1.6.5 DCAN line

It is possible to send and receive CAN messages to and from a CAN bus using the DCAN (direct CAN) line(message exchange according to the producer/consumer principle). The DCAN line also supports RTR (RemoteTransmission Request) objects.

Unlike INA2000 communication via CAN, the contents of the CAN messages are not interpreted. This allowscommunication with CAN slaves to be established for example.

The following topics are covered in this section:

DCAN process objects• DCAN access types• DCAN events• DCAN communication•

1.6.5.1 DCAN process objects

A line object, a device object, a station object, and a variable object are all necessary to send or receive CANmessages with a certain CAN ID.

Process objects of the DCAN line:

Name Type Connection Usage

Line object Line "LNDCAN" DCAN Line

Device object Device Device parameter DCAN device

Station object Station Station parameters Virtual station

CPU object CPU Can be specified, but not required

Module object Module Can be specified, but not required

Task object Task Can be specified, but not required

Variable object Pvar CAN ID Represents a CAN object

Allowed object structure for DCAN process objects:

PVI base system

134 1.6.5 DCAN line

Page 141: PviBase

1.6.5.2 DCAN access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Type" column indicates which access types in the DCAN line can beused with which process object types.

Access types Type Special features

POBJ_ACC_VERSION LineDevice

Line object: Version of the line DLLDevice object: Version of the INA frame DLL and device DLL

POBJ_ACC_LIST_EXTERN Line Lists entry for DCAN device if installed (PVI Setup)

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS Not supported

POBJ_ACC_TYPE_EXTERN Not supported

POBJ_ACC_UPLOAD Not supported

POBJ_ACC_DOWNLOAD Not supported

POBJ_ACC_DATE_TIME Not supported

POBJ_ACC_MEM_DELETE Not supported

POBJ_ACC_MEM_INFO Not supported

POBJ_ACC_MOD_TYPE Not supported

POBJ_ACC_UPLOAD_STM Not supported

POBJ_ACC_DOWNLOAD_STM Not supported

POBJ_ACC_LIST_STATION Not supported

POBJ_ACC_LIST_CPU Not supported

POBJ_ACC_LIST_MODULE Not supported

POBJ_ACC_LIST_TASK Not supported

POBJ_ACC_LIST_PVAR Not supported

POBJ_ACC_CPU_INFO Not supported

1.6.5.3 DCAN events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special features

POBJ_EVENT_STATUS Not supported

POBJ_EVENT_PROCEEDING Not supported

PVI base system

1.6.5.2 DCAN access types 135

Page 142: PviBase

1.6.5.4 DCAN Communication

A particular communication device is used for DCAN (direct CAN) communication. "CAN" needs to be selectedas an additional interface in PVI Setup.

PC Requirements:

The DCAN line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me Cannot use RTR objects

Windows NT/2000/XP −

Windows CE Cannot use RTR objects

The description of the B&R CAN device driver can be used to find out which CAN cards can be used with whichWindows platforms.

1.6.5.5 DCAN Device Objects

The communication device being used is determined with the DCAN device object. To address the DCANdevice, it first has to be set up as a CAN device with the B&R CAN device configurator. Configuring CANdevices is done via the "CAN Devices" menu item in the Control Panel. The device list in the configurator showsall CAN devices which have already been set up. The device number must also be specified in the PVI devicename. The CAN1 device corresponds to the PVI device name DCAN1. CAN2 corresponds to DCAN2, etc. theB&R CAN device configurator is also used to set device resources (IRQs, port addresses, etc.).

The communication device with the necessary device parameters is defined in the connection description of thedevice object. Within the connection description, individual parameters are differentiated between usingparameter identifiers. These parameter identifiers always begin with the "/" character.

Connection description syntax:

/IF=<DeviceName> [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

Device names are not case sensitive, and at least one space character must be between each parameterspecification.

The connection description must always be specified in quotation marks ("...") in the object description.

The following table shows all parameters which can be defined for DCAN communication in the device object'sconnection description.

Par. Value Default Description

/IF dcan1 ...dcanX

None CAN device. The device being used has to be entered in the device list of the B&RCAN device configurator.Example: "/IF=dcan1"

/CNO 0, 1 0 CAN controller number (channel).2 CAN controllers are available on the LS172 card. The desired controller isselected with the /CNO parameter. No value other than 0 (zero) may be specifiedfor the default CAN controller.Example for LS172 card:CAN bus 1: "/IF=dcan2 /CNO=0"CAN bus 2: "/IF=dcan2 /CNO=1"

/BD 10000,20000,50000,100000,125000,150000,250000,

*) Baud rate (data rate) on the CAN bus in bits per second. This parameter can alsobe specified in kBits per second.Example: "/BD=250000" or "/BD=250"

PVI base system

136 1.6.5.4 DCAN Communication

Page 143: PviBase

500000,800000,1000000

/CMODE 11, 29 *) CAN communication with 29−bit identifiers (extended frames) or 11−bit identifiers(standard frames).If 29−bit CAN identifiers (extended frames) are used, then 11−bit identifiers cannotbe sent or received.Example: "/CMODE=29"

/CT >= 1,0 = off

*) Cycle time (in ms) within which the specified number (maximum) of CANmessages are sent (/MC parameter).Values < 20 ms don't make sense.Example: "/CT=20"

/MC >= 1 *) Maximum number of CAN messages sent within the specified cycle time (/CTparameter).Example: "/MC=15"

*) The /BD, /CMODE, /CT, and /MC parameters can also be set using the B&R CAN device configurator. Ifthese parameters are not specified in the connection description (the recommended method), then thevalues set in the configurator are used instead. If one of these parameters is specified in the connectiondescription, then the corresponding configurator setting is overwritten.

The /CT and /MC parameters are used to limit messages. These allow the number of sent CAN messages to berestricted per cycle. This can reduce the load from the PC to the CAN bus. This could be important if otherstations on the bus can only process a certain number of received CAN messages with the set baud rate, or iftheir interrupt load in general should be reduced. However, the disadvantage of limiting frames is slower CANcommunication.

Connection description example:

CD="/IF=dcan3 /CNO=1"

1.6.5.6 DCAN Station Objects

A station object describes a virtual DCAN station (CAN connection). If more than one DCAN station is used,then a unique virtual name has to be assigned to each station object. Each DCAN station has its own FIFO tobuffer received CAN messages. The size of the FIFO buffer and the corresponding timeouts are set with stationparameters. On a DCAN station, bus nodes with different designs can be grouped together and operated withdifferent settings (Receive FIFO, Timeouts).

The user can determine the distribution in DCAN stations according to his requirements. However, note thateach station requires Windows resources (RAM, path objects, threads, etc.). Therefore, the number of stationsshould be kept within limits.

The virtual station name and station parameters are defined in the station object's connection description. Withinthe connection description, individual parameters are differentiated between using parameter identifiers. Theseparameter identifiers always begin with the "/" character. At least one blank space needs to be betweenindividual parameter entries.

Connection description syntax:

[/CN=<Name>] [/<Identifier1>=<ParameterValue> [/<Identifier2>=<ParameterValue> ... ]]

The following table shows all parameters which can be defined for DCAN communication in the station object'sconnection description.

Par. Value Default Description

/CN Name "DefStation" Virtual station nameOnly alphanumeric characters and the "_" (underscore) character maybe included in names. Names may only be up to 31 characters long.Names are also case sensitive.Example: "/CN=Main".

PVI base system

1.6.5.6 DCAN Station Objects 137

Page 144: PviBase

In an eariler version, the virtual station name was defined using the/DA paramter. This parameter can continue to be used in place of the/CN parameter. However, new applications should always use the /CNparameter.

/FS 1 − 65535 100 Size of the receive buffer (FIFO) in the CAN driverThe value specifies the number of CAN messages. Only CANmessages whose IDs are enabled using an assigned variable object(read object) are written to the receive buffer. The necessary buffersize is therefore arranged only according to the frequency with whichenabled CAN messages can occur on the CAN bus.Example: "/FS=200"

/TR 1 − 60000 1000 Timeout for RTR read request in msAfter an RTR read request, the response from the opposite stationneeds to be received within the set time. If this doesn't happen, thenTimeout Error 14987 is reported. This parameter is only significant ifused in connection with RTR read objects.Example: "/TR=100"

/TW 1 − 2000 250 Write procedure timeout in msecIf the write request cannot be executed within the set time (e.g. CANbus is occupied by CAN messages with higher priority), then the writeprocedure is cancelled and Timeout Error 14986 is reported. Internalwrite procedures (such as registering or deregistering RTR objects)can also report Error 13036.Example: "/TW=50"

/RW 1 100000=none

*) Write request delay time in msecAlong with the delay time for write requests, a defined delay time isadhered to between the most recently received CAN message and thenext CAN message to be sent.Example: "/RW=0"

/CF 0, 1 0 "/CF=0": Do not empty receive buffer (FIFO) before the writeprocedure (default setting)."/CF=1": Empty receive buffer (FIFO) before each write procedure(deletes).

*) The /RW parameter can also be set with the B&R CAN device configurator. If this parameter is notspecified in the connection description, then the value set in the configurator is used. If this parameter isspecified in the connection description, then the corresponding configurator setting is overwritten.

Connection description example:

CD="/CN=ExtIO /FS=250 /TW=100"

1.6.5.7 DCAN Variable Objects

A DCAN variable object represents a CAN object on the CAN bus. A CAN object is defined using the CAN ID.All CAN messages are assigned to the CAN object using this CAN ID.

Please note:Message doubling can occur when using CAN in a malfunctioning environment (see CiA "CAN Data LinkLayer"). In this case, the same CAN message is received twice.For this reason, the following points need to be taken into consideration in a malfunctioning environment:− No "Toggle" messages or counted messages may be evaluated− No messages with relative data (such as increments) may be sent− Data segments may only be transferred with a protected protocol or with sequence numbers.

CAN objects can hold a maximum of 8 data bytes. The data format of the variable object can either be set by theuser or by the DCAN line.

DCAN Variable objects can be defined for either send or receive operation within a station object. This definitiontakes place with the object attribute property (AT parameter). "AT=w" is specified for send operations, "AT=e" forreceive operations. Send and receive operation on the same CAN object is not possible. In receive operation,

PVI base system

138 1.6.5.7 DCAN Variable Objects

Page 145: PviBase

CAN data is transferred as an object event to the application (POBJ_EVENT_DATA event type). Specifying therefresh time (RF parameter) has no significance.

CAN variable objects can also be operated as CAN RTR objects. An RTR object can be defined either as asend ("AT=w") or receive ("AT=r") object. RTR (Remote Transmission Request) is a method standardized forCAN where a station (Producer) sends a CAN message (data frame − RTR bit not set) only after a read request(remote frame − RTR is set) from another station (Consumer). The read request and response have the sameCAN ID and are only differentiated by the RTR bit.

If a DCAN line variable object is created as an RTR receive object (Consumer, "AT=r"), then a RTR readrequest is sent to the CAN bus with the specified refresh time. As with "normal" PLC variables from other lines,data acquisition can also be controlled here by the PVICOM application. For this, the Value − 1 is set as therefresh time. The application itself determines when the read request is carried out by calling thePviReadRequest or PviXReadRequest and using access type POBJ_ACC_DATA. RTR receive objects workwith timeout monitoring. After an RTR read request, the response from the opposite station needs to be receivedwithin the given time. If this doesn't happen, then Timeout Error 14987 is reported. The maximum response timecan be defined using the /TR parameter in the connection description of the station object.

DCAN line variable objects can also be created as RTR send objects (Producer, "AT=w"). The send object issupplied with data by calling the PviWriteRequest or PviXWriteRequest function. However, the maximumnumber of send objects is limited and depends on the CAN card being used. A maximum of 12 can be used withthe B&R standard CAN interface. Up to 256 send objects can be used with the LS172 card. With the LS172card, RTR send objects can only be used with an ID less than or equal to 2047 even when using extendedframes (29−bit identifiers).

Received data for a CAN object is normally monitored for changes. That means the application is only informedof changes to CAN data. Monitoring for changes can be disabled (specification "AT=de") with the variableattribute "d" (direct). This transfers all received CAN data to the application.

Please note:With the "d" object attribute, all received CAN data occupy application memory in PVI until it is read by theapplication. Therefore, the "d" attribute should be used with extreme care and only when absolutely necessary.

When transferring data, the DCAN line does not carry out byte swapping since CAN data is already in Intelformat anyway (least significant byte first).

The CAN object ID must be entered in the connection description. Code letters can be used to determine howthe CAN objects function.

Connection description syntax:

/RO=[L][R]<CAN ID>

or

[L][R]<CAN ID>

These code letters are not case sensitive. These code letters can be combined in any way.

Code letter "L" Description

Not specified The user can set any data format (e.g. a structure). Note that CAN objects can onlytransfer a maximum of 8 data bytes. The total length of the set data format determinesthe length of the data to be transferred in the write direction (sending). In the readdirection (receiving), the data is copied dependent on its length. For example, the userdefined "i32" (4−byte integer) as a data format. If a CAN message with 2 bytes of datais received, then only the first 2 bytes of the integer value are copied. All other bytesremain undefined.If a data format is not defined when creating the DCAN variable object, then the lineautomatically uses "VT=u8 VN=8" (byte array with 8 byte length).

This variant is especially suitable for CAN objects with a fixed data length. The userhas the option of setting the format of a structure, array, or signal variable using the

PVI base system

1.6.5.7 DCAN Variable Objects 139

Page 146: PviBase

CAN data. This allows PVI functions like type casting, variable addressing, eventhysteresis, or data functions to be used.

Specified Regardless of the user setting, a data format of "VT=u8 VN=9" (byte array with 9 bytelength) is set by the DCAN line. The length of the CAN object data to be sent orreceived is passed in the first byte. Bytes 2−9 are used to pass the data. When writing,the user has to enter the length of the data in the first byte. Values between 0 (zero)and 8 are valid for the data length.

This variant is intended for CAN objects with differing data lengths but can also (ofcourse) be used for CAN objects with a fixed data length.

Code letter "R" Description

Not specified Standard CAN object for send or receive operationThis definition takes place with the object attribute property (AT parameter). "AT=w" isspecified for send operations, "AT=e" for receive operations.

Specified RTR send or receive objectThis definition takes place with the object attribute property (AT parameter). "AT=w" isspecified for the send object, "AT=r" is specified for the receive object. The refresh timeproperty is also evaluated for receive objects.

Example of object description:

CD="/RO=1597" VT=i32 AT=e

After receiving a CAN message with CAN ID 1597, data is mapped to a 4−byte integer.

CD="/RO=L1597" AT=e

After receiving a CAN message with CAN ID 1597, the data length and the data in the CAN message aremapped to a 9−byte array.

CD=1597 VT=i32 AT=w

With the write access to the variable object, the 4−byte integer data is sent together with the CAN ID 1597 as aCAN message.

CD=LR1597 AT=r RF=500

RTR read object for CAN ID 1597. A read request is sent every 500 ms.

CD=R1597 VT=i16 AT=w

RTR write object for CAN ID 1597. 2−byte integer data is sent after an external read request.

1.6.6 MTC line

The MTC line provides Maintenance Controller (MTC) functions for B&R Provit 5000 Industrial PCs (IPCs) (seealso the "Provit 5000 User's Manual", model number MAPRV5000−0).

The MTC is responsible for the following tasks and components:

AT PS/2 keyboard• Panelware keypad modules• Operating data acquisition (controller and display unit)• Temperature monitoring with fan regulation• Battery state evaluation (good/bad)•

Note:MTC functions for configuring keys and key LEDs on the display unit and Panelware modules as well asfunctions for reading key scan codes are not supported. This can all be taken care of using B&R MKEY utilities.

The following topics are covered in this section:

PVI base system

140 1.6.6 MTC line

Page 147: PviBase

MTC process objects• MTC access types• MTC events• MTC communication•

1.6.6.1 MTC process objects

A line object, a device object, and a variable object are all needed to access an MTC variable.

Process objects of the MTC line:

Name Type Connection Usage

Line object Line "LNMTC" MTC line

Device object Device Device parameter MTC device

Station object Station Can be specified, but not required

CPU object CPU Can be specified, but not required

Module object Module Can be specified, but not required

Task object Task Can be specified, but not required

Variable object Pvar Variable name MTC variable

Allowed object structure for MTC process objects:

1.6.6.2 MTC access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Access type" column indicates which access types in the MTC linecan be used with which process object types.

Access types Type Special features

POBJ_ACC_VERSION LineDevice

Line object: Version of the line DLLDevice object: MTC version

POBJ_ACC_LIST_EXTERN Line MTC device

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS Pvar

POBJ_ACC_TYPE_EXTERN Pvar

POBJ_ACC_UPLOAD Not supported

POBJ_ACC_DOWNLOAD Not supported

POBJ_ACC_DATE_TIME Not supported

POBJ_ACC_MEM_DELETE Not supported

POBJ_ACC_MEM_INFO Not supported

POBJ_ACC_MOD_TYPE Not supported

PVI base system

1.6.6.1 MTC process objects 141

Page 148: PviBase

POBJ_ACC_UPLOAD_STM Not supported

POBJ_ACC_DOWNLOAD_STM Not supported

POBJ_ACC_LIST_STATION LineDevice

POBJ_ACC_LIST_CPU LineDevice

POBJ_ACC_LIST_MODULE LineDevice

POBJ_ACC_LIST_TASK LineDevice

POBJ_ACC_LIST_PVAR LineDevice

POBJ_ACC_CPU_INFO Not supported

1.6.6.3 MTC events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special features

POBJ_EVENT_STATUS Not supported

POBJ_EVENT_PROCEEDING Not supported

1.6.6.4 MTC Communication

"MTC" needs to be selected as an additional interface in PVI Setup.

PC Requirements:

The MTC line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me −

Windows NT/2000/XP −

Windows CE Not possible

B&R MTC Utilities (starting from Version 1.09) must be installed on the PC. These are included on the "ProvitDriver & Utilities" CD (model number 5S0000.01−090).

At least BIOS Version 00.25 is needed for MTC communication (see also "Provit 5000 MTC Utilities 32−BitUser's Manual"). Otherwise, the MTC driver cannot be loaded.

The "WatchdogTime", "Watchdog", "MkeyLedMatrix", and "KeySwitches" variables are only supported startingfrom MTC Version 00.10 and are rejected with errors by the MTC line if used in older versions.

1.6.6.5 MTC Device Objects

The communication device is determined with the MTC device object.

Connection description syntax:

/IF=mtc [/TO=<Timeout>]

Device names are not case sensitive, and at least one space character must be between each parameterspecification.

The following table shows all parameters which can be defined in a device object's connection description.

PVI base system

142 1.6.6.3 MTC events

Page 149: PviBase

Param. Value Default Description

/IF mtc None MTC deviceSpecification: "/IF=mtc"

/TO 0 − 60000 100 Timeout for MTC requests (ms)The MTC line controls the MTC using asynchronous calls. The timeout specifieshow long it must wait before necessary data can be accessed when an MTCrequest is called.Example: "/TO=250"

Connection description example:

CD="/IF=mtc /TO=1000"

1.6.6.6 MTC Variable Objects

A MTC variable object represents an object in the MTC. The connection name of the variable objectcorresponds to the name of the MTC variable. The MTC line supports predefined variable names. These are notcase sensitive.

The data format of the variable object is given by the MTC line and cannot be influenced by the user.

Connection description syntax:

Single and array variables:

/RO=<VariableName>

or

<VariableName>

Element of an array variable:

/RO=<VariableName>[<Index>]

or

<VariableName>[<Index>]

If the variable name is defined as the /RO parameter, the connection description must always be specified inquotation marks ("...") in the object description.

Connection description examples:

CD="/RO=MkeyLedMatrix"

CD=MkeyLedMatrix[12]

1.6.6.6.1 Predefined Variable Names:

The MTC line supports the following MTC variables:

Variable name Data Format I/O Value Description

DriverVersion VT=string VL=80 R ASCII string with max. 79characters

Version of the MTC driver.

Example: "MTC Driver1.11 1998−09−25"

This string is also returnedwith the MTC DLL versionfor the device object andaccess type VERSION.

PVI base system

1.6.6.6 MTC Variable Objects 143

Page 150: PviBase

MtcVersion VT=string VL=80 R ASCII string with max. 79characters

MTC version

Example: "MTC BIOS 1.100−04−04"

IpcVersion VT=string VL=80 R ASCII string with max. 79characters

IPC version

Example: "IPC5000CBernecker + RainerIndustrie−ElektronikV1.14"

MkeyLevel VT=u8 R/W 0 − 3 Number of key levels.

Key levels have an effecton the "MkeyLeds","MkeyLedMatrix","Mkeys", and"MkeyMatrix" variables.

WARNING: If a key levelis set to value other than0, then theMkeyLevelMode variablemust be set to 1 (toggle)or 2 (one−shot)!

MkeyLevelMode 1)

VT=u8 R/W 0 = default1 = toggle2 = one−shot

Key level operating mode.

Shift keys for key levelscan be defined with B&RMKEY Utilities.

MkeyLeds VT=u8 VN=128 R/W 1 element per LED:

0 = off1 = normal blinking2 = fast blinking3 = on

State of key LEDs for thecurrent key level.

Note: Only the individualelements (LEDs) of thearray can be addressed,not the entire array.

ScanCodesStateRom 1)

VT=boolean R Scan codes are:

0 = undefined1 = OK

State of scan codes inROM for the current keylevel.

ScanCodesStateRam VT=boolean R Scan codes are:

0 = undefined1 = OK

State of scan codes inRAM for the current keylevel.

IpcOperatingHours VT=u16 R 0 − 65535 Number of operatinghours for the IPC.

IpcPowerOnCycles VT=u16 R 0 − 65535 Number of power−ons forthe IPC.

"Resets" are alsocounted.

IpcOverTempHours VT=u16 R 0 − 65535 Number ofover−temperatureoperating hours for theIPC.

IpcFanHours VT=u16 R 0 − 65535 Number of operatinghours for the fan.

CpuAlarm 1) 2)

VT=boolean R 0 = normal1 = alarm

CPU over−temperaturealarm.

PVI base system

144 1.6.6.6 MTC Variable Objects

Page 151: PviBase

IoAlarm 1)

VT=boolean R 0 = normal1 = alarm

Over−temperature alarmin the in the I/O area ofthe IPC.

FpdAlarm VT=boolean R 0 = normal1 = alarm

Display over−temperaturealarm.

BatteryState VT=boolean R 0 = normal1 = empty, broken, or notpresent

Status of the CMOSbattery in the IPC.

CpuTemperature 1) 3)

VT=u8 R 0 − 127 Current CPU temperaturein degrees Celsius.

IoTemperature 1)

VT=u8 R 0 − 127 Current temperature in theI/O area of the IPC indegrees Celsius.

FpdNumber VT=u16 R 0 = no display connected,other values aredisplay−dependent

ID of the display unit.

FpdName VT=string VL=9 R ASCII string with max. 8characters

Name of the display unit.

IpcMkeyRegisters VT=u8 R 0 − 16 Number of registers forIPC keys.

IpcMkeyLedRegisters VT=u8 R 0 − 16 Number of registers forIPC key LEDs.

HardwareDefines VT=u8 R Reserved for B&R.

Jumpers VT=u8 VN=2 R Reserved for B&R.

Key scan codes must be defined for the following variables (see the ScanCodesStatesRom variable).

Mkeys 1)

VT=booleanVN=128

R 1 element per key:

0 = pressed1 = not pressed

State of the keys in thecurrent key level.

WARNING: Pressing keysfor just a very short timemay not be detected.

MkeyMatrix 1)

VT=u8 VN=16 R 1 bit per key:

0 = pressed1 = not pressed

State of the keys in thecurrent key level in"packed" form:

byte 0, bit 0 = 1st keybyte 0, bit 1 = 2nd key...byte 1, bit 0 = 9th key...

WARNING: Pressing keysfor just a very short timemay not be detected.

A display unit has to be connected for the following variables:

FpdOperatingHours VT=u16 R 0 − 65535 Number of operatinghours for the display unit.

FpdPowerOnCycles VT=u16 R 0 − 65535 Number of power−ons forthe display unit.

FpdOverTempHours VT=u16 R 0 − 65535 Number ofover−temperatureoperating hours for thedisplay unit.

FpdTemperature 1)

VT=u8 R 0 − 127 Current display unittemperature in degreesCelsius.

FpdContrast VT=u8 W 0 − 100 Contrast setting for the

PVI base system

1.6.6.6 MTC Variable Objects 145

Page 152: PviBase

display unit in percent.

This variable is initializedby the MTC line withFpdDefaultContrast.

FpdBrightness VT=u8 W 0 − 100 Brightness setting for thedisplay unit in percent.

This variable is initializedby the MTC line withFpdDefaultBrightness.

FpdDefaultContrast VT=u8 R/W 0 − 100 Default value for thedisplay unit's contrastgiven in percent.

FpdDefaultBrightness VT=u8 R/W 0 − 100 Default value for thedisplay unit's brightness(background lighting)given in percent.

FpdMkeyRegisters 1)

VT=u8 R 0 − 16 Number of registers fordisplay unit keys.

FpdMkeyLedRegisters 1)

VT=u8 R 0 − 16 Number of registers fordisplay unit key LEDs.

The following variables are supported beginning with MTC Version 00.10:

UserLed VT=boolean R/W 0 = off1 = on

State of the user LED(one of the status LEDs)on the IPC.

MkeyLedMatrix VT=u8 VN=32 W 2 bits per LED:

00 = off01 = normal blinking10 = fast blinking11 = on

State of the key LEDs inthe current key level in"packed" form:

byte 0, bit 0+1 = 1st LEDbyte 0, bit 2+3 = 2nd LED...byte 1, bit 0+1 = 5th LED...

KeySwitches 1)

VT=u8 R 1 bit per contact:

0 = closed1 = opened

State of the key switches.

Only those bits can beevaluated for which a keyswitch has also beendefined. The state of allother bits is undefined andcan therefore be either 0or 1.

Note: A key switch canalso occupy several bits.

KeySwitchesOffset VT=u8 R 0 − 127 Offset of the key switches.

WatchdogTime VT=u32 W 0 = off1 − 1310700

Watchdog timeout in ms.

If the timeout expireswithout the Watchdogvariable having beendefined, then the IPCresets.

WARNING:Windowsrequires the system to beshut down properly. This

PVI base system

146 1.6.6.6 MTC Variable Objects

Page 153: PviBase

doesn't happen if a resetoccurs. This can lead todata loss which can leavethe system or application"paralyzed".

Watchdog VT=u8 W (Irrelevant − is notevaluated)

Variable foracknowledging thewatchdog.

The watchdog is resetwhen this variable iswritten to.

WARNING:Before thisvariable is "removed" withPviUnlink or PviDelete,the watchdog must bedisabled by writing 0 tothe WatchdogTimevariable!

The following variables are only supported on an IPC500C/5600C: 1)

CpuAlarmIntern VT=boolean R 0 = normal1 = alarm

Internal CPUover−temperature alarm.

CpuAlarmSocket VT=boolean R 0 = normal1 = alarm

CPU socketover−temperature alarm.

CpuAlarmFan VT=boolean R 0 = normal1 = alarm

CPU fan alarm (fan notrunning).

CpuTemperatureIntern VT=u8 R 0 − 127 Current internal CPUtemperature in degreesCelsius.

CpuTemperatureSocket VT=u8 R 0 − 127 Current CPU socket areatemperature in degreesCelsius.

IpcFanRpm VT=u16 VN=2 R 0 − 65535 Number of IPC fanrevolutions per minute.

IpcVoltage2_5 VT=f32 R 2.5V IPC voltage in volts.

IpcVoltage3_3 VT=f32 R 3.3V IPC voltage in volts.

IpcVoltage5 VT=f32 R 5V IPC voltage in volts.

IpcVoltage12 VT=f32 R 12V IPC voltage in volts.

IpcVoltageCore VT=f32 R IPC core voltage in volts.

IpcVoltageBattery VT=f32 R IPC battery voltage involts.

1) Direct Access Mode is used to access this variable on a IPC5000C/5600C. Because of this, ashorter access time is used.

2) On an IPC5000C/5600C, the "CpuAlarm" variables is formed from the "CpuAlarmIntern","CpuAlarmSocket", and "CpuAlarmFan" variables.

3) The "CpuTemperature" variable corresponds to the "CpuTemperatureSocket" variable on anIPC5000C/5600C.

1.6.6.6.1.1 Access Time

Reading and writing variables may take a relatively long time (depending on MTC communication) if anIPC5000C or IPC5600C is not being used. These devices support MTC communication using a FIFO buffer andDirect Access Mode.

Note:If an IPC5000 (or older IPC5000C/5600C without FIFO) is used, MTC communication can be "sped up" in the

PVI base system

1.6.6.6 MTC Variable Objects 147

Page 154: PviBase

following way: The "PollingRate" parameter for the MTC driver must be set to a higher value (e.g. 10) in theregistry (see also the "Provit MTC Utilities User's Manual").

Note:If many variables should be read, then short refresh rates (RF) for these variables should be specified which canreact quickly to data changes (e.g. keys). All other variables should be read with high refresh rates.

1.6.6.6.1.2 Key Level Operating Mode

A key level is only active in "Default" mode as long as the corresponding level key is pressed. The level keymust be pressed together with the desired key (corresponds to the function of a SHIFT key).

In "Toggle" mode, a key level can be turned on or off using the level key defined. That means each time this keyis pressed, the level is toggled between level 0 and the respective level.

In "One−Shot" mode, pressing the level key only has an effect on the key pressed immediately afterwards. Oncethe action is complete, it switches back to level 0.

1.6.6.6.1.3 Keys

Note:If many keys should be read, this can be done more effectively by reading the entire key array. For this, only oneaccess to the MTC driver has to be made for all keys. However, the PVI application itself then has to evaluatethe necessary keys (= array elements for the Mkeys variable or bits for the MkeyMatrix variable).

Please note:Only the current key states are provided by MTC and not, as with a standard keyboard, the sequence of thekeys pressed. This means that pressing keys for only a short duration may not be detected depending on thescan times of the MTC driver, the MTC line, and the PVI application. The MTC line scan time is influenced bythe number and refresh rates of the registered variables. Task states should therefore only be read fordiagnostic purposes!

1.6.6.6.1.4 Key Switches

Key switches can be defined B&R MKEY utilities.

1.6.6.6.1.5 Operating Hours

Operating hours are only updated every full hour. In other words, if a power failure occurs after 55 minutes, thenthe value of the counter is not raised by an hour.

1.6.6.6.1.6 Temperature Alarms

When an alarm occurs, the temperature LED lights up on the IPC or the display unit (if connected).

Temperature values which trigger an alarm are described in the "Provit 5000 User's Manual".

Temperature alarms depend on the display unit being used.

1.6.6.6.1.7 Contrast and Brightness

Values for contrast and brightness are not absolute values. Instead, they are relative to the technically allowedminimum and maximum values. Contrast and brightness settings are lost when the device is switched off.

Contrast and brightness must be set together depending on the MTC interface. For this reason, writing toFpdContrast or FpdBrightness always sends the values of both variables to the MTC. If a variable has not beenset by the user, then the corresponding default value is sent in its place.

Default values for contrast and brightness are permanently saved and are not lost when the device is turned off.

Contrast can only be set for LCD displays.

Please note:Default values are only set by the display unit when the system is restarted and "FPD Contrast" and "FPD

PVI base system

148 1.6.6.6 MTC Variable Objects

Page 155: PviBase

Brightness" are set to "AUTO" under "Additional Peripherals" in BIOS.

1.6.6.6.1.8 Registers

A register has a width of 8 bits = 8 LEDs or keys. The number of registers specifies the max. number of possibleLEDs or keys which may exist. The actual existing amount depends on the connected keypad modules or thedisplay unit being used.

1.6.7 OS9NET line

The OS9NET line communicates with one or more OS−9/Net stations (SG2) over ARCNET (OS9NETcommunication).

The following topics are covered in this section:

OS9NET process objects• OS9NET access types• OS9NET events• OS9NET communication•

1.6.7.1 OS9NET process objects

A line object, a device object, and a station object are all needed to establish a communication connection to anOS9/Net station.

Process objects in the OS9NET line:

Name Type Connection Usage

Line object Line "OS9NET" OS9NET line

Device object Device "ARCNET" ARCNET device

Station object Station OS9/Net station name Represents a OS9/Net station (PLC) in an ARCNET network

CPU object CPU Can be specified, but not required

Module object Module Can be specified, but not required

Task object Task Can be specified, but not required

Variable object Pvar Variable name Represents a variable on the PLC

Object structure for OS9/Net process objects:

PVI base system

1.6.6.6 MTC Variable Objects 149

Page 156: PviBase

1.6.7.2 OS9NET access types

The following table shows an overview of all access types which are regulated via a line. All access types notlisted here as well as access types to the PVI base object are executed by PVI Manager and therefore workindependently of the line being used. The "Type" column indicates which access types in the OS9/Net line canbe used with which process object types.

Access types Type Special features

POBJ_ACC_VERSION LineDevice

Line object: Version of the line DLLDevice object: Version of the OS9Arc DLL

POBJ_ACC_LIST_EXTERN Line ARCNET device

POBJ_ACC_DATA Pvar

POBJ_ACC_STATUS Not supported

POBJ_ACC_TYPE_EXTERN Not supported

POBJ_ACC_UPLOAD Not supported

POBJ_ACC_DOWNLOAD Not supported

POBJ_ACC_DATE_TIME Not supported

POBJ_ACC_MEM_DELETE Not supported

POBJ_ACC_MEM_INFO Not supported

POBJ_ACC_MOD_TYPE Not supported

POBJ_ACC_UPLOAD_STM Not supported

POBJ_ACC_DOWNLOAD_STM Not supported

POBJ_ACC_LIST_STATION Not supported

POBJ_ACC_LIST_CPU Not supported

POBJ_ACC_LIST_MODULE Not supported

POBJ_ACC_LIST_TASK Not supported

POBJ_ACC_LIST_PVAR Not supported

POBJ_ACC_CPU_INFO Not supported

1.6.7.3 OS9NET events

The following table shows an overview of all event types which can be generated from a line. All event typeswhich are not listed are generated by PVI Manager and therefore work independently of the line being used.

Event types Special features

POBJ_EVENT_STATUS Not supported

POBJ_EVENT_PROCEEDING Not supported

1.6.7.4 OS9NET Communication

OS9NET communication takes place over ARCNET.

PC Requirements:

"ARCNET OS−9/Net" needs to be selected as an additional interface in PVI Setup.

The OS9/Net line can be operated on the following platforms:

Windows platform Limitations

Windows 9x/Me Not possible

Windows NT/2000/XP Only possible in Windows NT/2000

Windows CE Not possible

The OS9NET line is comprised of the PVI components "LnOs9Net.dll" (line server) and "Os9Arc.dll" (OS−9/Netcommunication). In addition, the "Packet.sys" driver (OS−9/Net communication) and "Ntndis40.sys" (COM20020network card) files are required.

PVI base system

150 1.6.7.2 OS9NET access types

Page 157: PviBase

The installation of the protocol driver PACKET.SYS and the network driver NTNDIS40.SYS is required foroperation.

Installation procedure:

Start −> Settings −> Control Panel −> Network1. Register network card2. Add −> Diskette3. Specify path for OEMSETUP.INF file (e.g. "\BR_Automation\PVI\Drivers\Com20020")4. Register protocol5. Add −> Diskette6. Specify path for OEMSETUP.INF file (e.g. "\BR_Automation\PVI\Drivers\Arcos9")7. Reboot computer8.

1.6.7.5 OS9NET Device Objects

The OS9/Net line only supports one device object The device name "ARCNET" must be specified in theconnection description.

Connection description syntax:

/IF=arcnet

or

arcnet

Device names are not case sensitive.

Connection description examples:

CD="/IF=arcnet"

CD=arcnet

1.6.7.6 OS9NET Station Objects

The OS9/Net station object defines a OS9/Net station (controller) in an ARCNET network.

The name of the OS9/Net station must be specified in the connection description.

Connection description syntax:

/CN=<StationName>

or

<StationName>

Connection description examples:

CD="/CN=CP60"

CD=CP70

1.6.7.7 OS9NET Variable Objects

The data format of the variable object is not given by the OS9/Net line. It has to be defined by the user.

A counter (register), flag, input, or output is defined for the controller in the connection description.

Connection description syntax:

PVI base system

1.6.7.5 OS9NET Device Objects 151

Page 158: PviBase

/RO=<Connection>

or

<Connection>

Memory type Connection Min. offset Max. offset Example

Counter (register) R<DecimalOffset> 0000 7095 "R1234"

Flag F<DecimalOffset> 000 799 "F156"

Input I<B&R−HexOffset> 000 3FN "I0FN"

Output O<B&R−HexOffset> 000 3FN "O0FA"

Example of object description:

CD="/RO=R926" VT=i16

The memory range beginning with Counter 926 is read and written as a 2−byte integer value.

1.7 Diagnostics

PVI supports the following diagnostic procedures:

Procedure Description

Data Logger Diagnoses sequences in individual PVI components

Snapshot Diagnoses operating states of PVI objects from PVIManager

1.7.1 Snapshot Files

The Snapshot function is a useful tool for diagnosing the operational state of PVI Manager PVI objects. TheSnapshot function writes a list of PVI objects (link objects, process objects, and service objects) along with theirstatus and a list of all registered clients as text (ASCII) to a file. The Snapshot function can be triggered via PVIMonitor or from a PVI application (access type POBJ_ACC_SNAPSHOT).

Snapshot information is divided into 5 sections:

General PVI information1. List of all registered communication instances (clients)2. List of link objects3. List of process objects4. List of service objects5.

Snapshot information is divided into lines. Depending on the first character in the line, the rest of the line isinterpreted as follows:

Character Description

'*' Comment line with general PVI information

'>' Time stamp (date and time) of the Snapshotinformation

':' Indicates the start of a list entry

' ' A space character indicates a following line of a listentry

At the beginning of each list entry is a code with an identification number (ID) directly after the ":" character. ThisID number is unique within a list and is displayed as a hex number.

ID Description

CId Entry for registered communication instance

PVI base system

152 1.7 Diagnostics

Page 159: PviBase

(client)

C Entry for a link object

P Entry for a process object

S Entry for a service object

The assignment of individual objects is also displayed with the ID number. Several process objects can beassigned to one service object, and several link objects can be assigned to one process object. The followingimage shows the codes which are responsible for object assignment.

The ID numbers used in the Snapshot file and the ID numbers used in the PVI Data Logger by the maincomponents are identical.

The list of all registered communication instances, the list of link objects, and the list of process objects are all ofparticular significance to the user.

General PVI information:

Comment lines containing general PVI information are output at the beginning of the Snapshot file. The first linecontains information about the operating system platform and the system operating mode of PVI Manager. Thesecond line displays the file version and product version of PVI Manager. The next few lines contain informationabout how PVI Manager properties are set, provided they are different from the default settings.

Communication instance (client) entry:

Syntax:

:CId=<ID> Name="<Name>" ComType=<Num> ProcID=<Num> PriorClass=<Num> [Platform=<Platform>]TC=<Sec> TR=<Sec> PT=<Sec> LM=<Cnt>

Parameters:

ID Description

CId ID number of the communication instance (client)

name Name of the application process

ComType Communication type: 0 ... Local, 1 ... Remote

ProcID ID of the user process in hex format

PriorClass Priority class of the user process

Platform Platform where the user processes are running

TC Setting being used for the communication timeout in seconds ("Timeout" argument in thePviInitialize or PviXInitialize function)

TR Setting being used for the retry time for PVICOM user messages in seconds ("RetryTime"argument in the PviInitialize or PviXInitialize function)

PVI base system

1.7 Diagnostics 153

Page 160: PviBase

PT Setting being used for the process timeout in seconds (PT initialization parameter in thePviInitialize or PviXInitialize function)

LM Setting being used for limiting user messages (LM initialization parameter in the PviInitializeor PviXInitialize function)

Example:

:CId=599a0005 Name="PviDemo.exe" ComType=0 ProcID=fff2e8ab PriorClass=32 TC=10 TR=0 PT=0 LM=1

Link object entry:

Syntax:

:C=<ID> P=<ID> CId=<ID> Desc: <LinkObjectDescription> State: <Act/Idl> Msg=(<Msg>) [E=<Code>] [LastE=<Code>] Ctr=<State> DCond=<State>

Parameters:

ID Description

C ID number of the link object

P ID number of the assigned process object

CId ID number of the communication instance (client) which created the link object

Desc: Code for lines with the current link object property settings. The parameters output here correspond tothose of the link object description.

State: Code for lines with a link object status

<Act/Idl> Current active status: "Act": active, "Idl": inactive (idle)

Msg User message assigned to the link object to signal event dataWindows message: W:<WindowHandle>,<MessageNumber>,<MessageParameter>Callback with data: CBD:<CallbackPointer>,< MessageParameter>Callback without data: CB:<CallbackPointer>,<MessageParameter>Asynchronous callback: CBA:<CallbackPointer>,<MessageParameter>"Msg=(NULL)" is output if no user message is defined.

ELastE

If the link object is in an error state, then the error code is output with "E=<Code>". "LastE=<Code>"shows the last occurring error. The link object is no longer in an error state here.

CtrDCond

This displays additional internal operating modes for the link object. These operating modes cannot beinterpreted by the user.

Example:

:C=0091 P=00e11f60 CId=599a0005Desc: EV=de LT=prc VT=string VL=80 VN=1State: Act Msg=(W:000009a0,1026,1001) LastE=0 Ctr=12 DCond=20

Process object entry:

Syntax:

:P=<ID>(<HID>) S=<ID> Pn=<PathName> OT=<Type> Desc: <ProcessObjectDescription> State: <Act/Idl>,<WState>[,Temp] [E=<Code>] Ctr=<State> DCond=<State>

Parameters:

ID Description

P ID number of the process object. The ID number of the higher−level process object in theobject structure is output in parentheses.

S ID number of the assigned service object. If no service objects are assigned to the processobject (e.g. for internal process objects), then ID number 0 (zero) is output.

PVI base system

154 1.7 Diagnostics

Page 161: PviBase

Pn Path name of the process object

OT Object type of the process object

Desc: Code for lines with the current process object property settings. The parameters output herecorrespond to those of the process object description.

State: ID for lines with specifications regarding the process object status.

<Act/Idl> Current active status: "Act": active, "Idl": inactive (idle)

<WState> Current operating state: "NotRdy": not ready, "Rdy": ready, "Err": error. The following value inparentheses shows the operating state in binary format.

Temp This displays a temporary process object.

E If the process object is in an error state, then the error code is output with "E=<Code>".

CtrDCond

This displays additional internal operating modes for the process object. These operatingmodes cannot be interpreted by the user.

Example:

:P=00e11f60(00e10180) S=0082 Pn=@Pvi/LNINA2/COM2/CPU/Pvar1 OT=PvarDesc: CD="PV1" AT=rw RF=250 VT=i32 VL=4 VN=1State: Act,Rdy(1),Temp Ctr=03 DCond=21

Service object entry:

Syntax:

:S=<ID>(<HID>) L=<ID> Pn=<PathName> OT=<Type> State: <Act/Idl>,<WState> [E=<Code>] [AT=<Mask>] [RF=<Num>] [Ev=<Mask>] [CdP=<ID>] [FrP=<ID>][HyP=<ID>] Ctr=<State> PrL=<State> StL=<State>

Parameters:

ID Description

S ID number of the service object. The ID number of the higher−level service object in the objectstructure is output in parentheses.

L Identification number of the assigned object within the line This ID number is used in the PVI loggeroutput for the line.

Pn Path name of the service object. Unlike the process object, the path name is formed from theconnection name here.

OT Object type of the service object

State: ID for lines with specifications regarding the service object status

<Act/Idl> Current active status: "Act": active, "Idl": inactive (idle)

<WState>Current operating state: "NotRdy": not ready, "Rdy": ready, "Err": error. The following value inparentheses shows the operating state in binary format.

E If the service object is in an error state, then the error code is output with "E=<Code>".

AT Shows the object attributes for the service object (only for variable objects)."r": Allows read access"w": Allows write access"e": PLC event operation

RF The refresh time in ms being used for the service object (only for variable objects)

Ev Enabling mask for object events in the line

CdP Identification number of the process object for the connection description

FrP Identification number of the process object for the data format (only for variable objects)

HyP Identification number of the process object for the hysteresis (only for variable objects)

CtrPrLStL

This displays additional internal operating modes for the service object. These operating modescannot be interpreted by the user.

Example:

PVI base system

1.7 Diagnostics 155

Page 162: PviBase

:S=0082(0081) L=016b0360 Pn=lnina2/com2/null/test/PV1 OT=Pvar State: Act,Rdy(1) AT=rw RF=250 CdP=00e11f60 FrP=00e11f60 Ctr=9e PrL=07 StL=02

1.7.2 Data logger

The PVI Data Logger is a useful tool for diagnosing sequences in PVI components. Unlike the Snapshotfunction, the Data Logger records the timing of processes in the individual PVI layers. The logging output of PVIcomponents are primarily intended for B&R to analyze problems. However, the outputs of some componentscan also provide users with useful information.

PVI components use the Data Logger to write text (ASCII) information to a file during runtime. This file ishandled as a ring buffer, i.e. if the end of the file is reached when writing, then the write pointer is set to zero andoutput continues at the beginning of the file. The size of the ring buffer corresponds to the adjustable file size.Each PVI component uses its own logger file. A time stamp given with each logger entry provides a timeoverview of entries in the various files.

Please note:Logger output requires quite a bit of computing time. Depending on the amount of information being output, theData Logger can greatly affect the timing of PVI components. Because of this, a warning appears on the screenwhen PVI Manager is started and the Data Logger is enabled. This warning cannot be turned off.

The PVI Data Logger is controlled via the Windows registry database and can be configured using thePVIMonitor. The approach to and effects of logger parameters are described in the Setting up the Data Loggersection. By default, the Data Logger is disabled for all components.

A component key can be created for each PVI component with logger output under the"HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\DataLogger" key. The name of a component keyis comprised of the process context, the component's filename, and an optional section. The logger settings forthe components are stored here in these individual keys.

The PVI components that support logger output can be found in the "PVI components with logger output" table.

The following is an overview of all registry entries of the PVI Data Logger.

DataLogger−−> Mode ... global logging mode−−> Time ... global time stamp format−−> Verbose ... global verbose mode−−> <Component> ... Key: Logging component −−> Mode ... logging mode (0/1) −−> Time ... time stamp format −−> Verbose ... verbose mode (0/1) −−> LogPath ... path name of the log file −−> LogSize ... size of the log file in bytes −−> LineLen ... maximum length of a text line (in characters) −−> LogBackup ... number of backup log files −−> BreakMode ... break function (0/1) −−> BreakTime ... break delay −−> BreakStr ... break expression

Current logger settings can be saved in a registry file using the Windows Registry Editor:

Start the "Regedit.exe" program1. Select the HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\DataLogger key2. Click on the "File −> Export..." menu item3.

Example of a registry file:

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\DataLogger]"Mode"=dword:00000000"Time"=dword:00000001"Verbose"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\DataLogger\PviDemo.exe/PviCom.dll/Client]"Mode"=dword:00000002"Time"=dword:00000002"Verbose"=dword:00000001

PVI base system

156 1.7.2 Data logger

Page 163: PviBase

"LineLen"=dword:00000200"LogPath"="C:\\BrAutomation\\Pvi\\Log\\PviDemo_Cl.log""LogSize"=dword:000a0000"LogBackup"=dword:00000001"BreakMode"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\DataLogger\PviMan.exe]"Mode"=dword:00000003"Time"=dword:00000002"Verbose"=dword:00000001"LineLen"=dword:00000200"LogPath"="C:\\BrAutomation\\Pvi\\Log\\PviMan.log""LogSize"=dword:00100000"LogBackup"=dword:00000000"BreakMode"=dword:00000001"BreakTime"=dword:000003e8"BreakStr"="Ty=11"

1.7.2.1 PVI components with logger output

The most important PVI components with Data Logger support are listed in the following table. Along with theverbose mode, the logging mode determines the extent of logger output.

Component Description

<Prog>/PviCom.dll/Client Logger output for the PVICOM user interface:Logging mode "Log Error": All occurring system errors and errorsreported to the application are logged.Logging mode "Log Main": Logs all function calls from the PVICOMuser interface and user messages which are triggered. In addition, a hexdump of all data is output with the verbose mode.Logging mode "Log Details": The communication with PVI Manager islogged from the point of view of the client.

The complete file name of the application process is used for <Prog>. Thename of registered PVI applications can be also be taken from the list ofcommunication instances in the Snapshot file.

PviMan.exe Default logger output of PVI Manager:Logging mode "Log Error": All system errors which occur whenrequests are executed are logged along with errors reported to theapplication.Logging mode "Log Main": All requests, responses, and events fromand to PVI applications are logged. In addition, a hex dump of all data isoutput with the verbose mode.Logging mode "Log Details": Communication with the connected line islogged from the point of view of PVI Manager.

PviMan.exe/System System logger output of PVI Manager:Logging mode "Log Error": All system errors which occur in operatingsystem functions of PVI Manager are logged.Logging mode "Log Main": Logging of the program flow of operatingsystem functions during initialization or deinitialization as well as inoperation as an NT service. Logging of installation and deinstallation as aWindows NT service.

PviMan.exe/LnNet2.dll Logger output of the NET2000 line:Logging mode "Log Details": Variable identification (GetOV) logged.

PviMan.exe/Net2000.dll Logger output of the NET2000 line (state machine):Logging mode "Log Error": Errors reported by the NET2000 statemachine are logged.Logging mode "Log Details": Function calls from the state machine arelogged. In addition, a hex dump of reference data is output with theverbose mode.

PviMan.exe/LnIna2.dll Logger output of the INA2000 line:Logging mode "Log Details": The internal program flow is logged. Inaddition, a hex dump of all data transferred to and from the ICOMM is

PVI base system

1.7.2.1 PVI components with logger output 157

Page 164: PviBase

output with the verbose mode.

PviMan.exe/IComm.dll Logger output of the INA2000 line (ICOMM):Logging mode "Log Details": The internal program flow is logged.

PviMan.exe/InaFrms.dll/<Dev> Logger output of the INA frame library:Logging mode "Log Error": All system and communication errors whichoccur are logged.Logging mode "Log Main": All function calls of the frame interface arelogged. In addition, a hex dump of all frame data is output with theverbose mode.

The INA frame library is used to transport log data from the NET2000,INA2000, Direct CAN, and MININET lines. The corresponding devicename is used for <Dev> (e.g. COM1, INACAN3, TCPIP, etc.). If the"/CNO" parameter with a value not equal to 0 (zero) is used in connectionwith the INACAN or DCAN devices, then the '.' character (period) and thevalue of the device name have to be connected (e.g. "/IF=INACAN2/CNO=1" results in <Dev>: "INACAN2.1").

PviMan.exe/DvTcpIp.dll/<Dev> Logger output of the INA frame TCP/IP device library:Logging mode "Log Error": All system and communication errors whichoccur are logged.Logging mode "Log Main": All function calls of the frame interface arelogged.Logging mode "Log Details": Network communication is logged. Inaddition, a hex dump of sent and received frames is output with theverbose mode.

The INA frame TCP/IP device library is a part of the INA frame library(InaFrms). The corresponding TCP/IP device name is used for <Dev>(see description for the INA frame library).

PviMan.exe/DvInaCan.dll/<Dev> Logger output of the INA frame INACAN device library:Logging mode "Log Error": All system and communication errors whichoccur are logged.Logging mode "Log Main": All function calls of the frame interface arelogged.Logging mode "Log Details": CAN communication is logged. In addition,a hex dump of all sent and received CAN messages is output with theverbose mode.

The INA frame INACAN device library is a part of the INA frame library(InaFrms). The corresponding INACAN device name is used for <Dev>(see description for the INA frame library).

PviMan.exe/DvDCan.dll/<Dev> Logger output of the INA frame DCAN device library:Logging mode "Log Error": All system and communication errors whichoccur are logged.Logging mode "Log Main": All function calls of the frame interface arelogged.

The INA frame DCAN device library is a part of the INA frame library(InaFrms). The corresponding DCAN device name is used for <Dev> (seedescription for the INA frame library).

PviDDE.exe Logger output of the DDE server:Logging mode "Log Main": The DDE interface is logged.

PviOPC.exe Logger output of the OPC server:Logging mode "Log Error": All occurring system errors and errorsreported by PVI are logged.Logging mode "Log Main": Program flow of the OPC server. In addition,a hex dump of data is output with the verbose mode.Logging mode "Log Details": PVI communication is logged.

Note that "Log Main" also activates "Log Error", and that "Log Details" activates both "Log Main" and "Log

PVI base system

158 1.7.2.1 PVI components with logger output

Page 165: PviBase

Error".

The PVI Data Logger is primarily intended for B&R to analyze problems. For this reason, much of the loggeroutput refers to internal program sequences or internal PVI component states. However, some logger output canbe interpreted by the user. In this way, the "PviMan.exe" component (logging mode ("Log Main") and the"<Prog>/PviCom.dll/Client" component (logging mode "Log Main") can be used by the user to analyze problemswhich arise in connection the the PVICOM interface. The component "PviMan.exe/InaFrms.dll/<Dev>" (loggingmode "Log Error") can be used to analyze problems in connection with PLC communication.

Logger output of the components "<Prog>/PviCom.dll/Client" and "PviMan.exe", as well as the PVI line, definePVI objects with clear identification numbers. The Snapshot function can be used to coordinate the assignmentbetween identification numbers and object names. It should be noted that giving the identification number takesplace when the object is set up. If this object is released and then set up again, then the identification numbercan also be changed.

1.7.2.2 Logger output format

Each log entry begins on a new line and one of the following markings:

">" Output in "Log Error" logging mode

">>" Output in "Log Main" logging mode

">>>" Output in "Log Detail" logging mode

A space and the time stamp always follow the marking. The actual log information is output next after anadditional space.

Changes in logging states are identified with the sequence "###" followed by a corresponding text and name ofthe component:

### start trace Logger output was started while the component was running (online)

### change trace Logger mode was changed while the component was running

### stop trace Logger output was stopped while the component was running

### begin trace Logger output was started with the component

### end trace Logger output was ended with the component

### break trace Logger output was automatically stopped with the cancel function

The "### start trace" and "### begin trace" logger entries define when logger recording begins. However, theData Logger handles the logger file like a ring buffer. If recording takes a long time, the beginning of the loggerrecord may be overwritten. The "### stop trace", "### end trace" and "### break trace" logger entries definewhen logger recording ends. One of these labels is almost always present. However, the Data Logger cannotoutput any of these "end markings" if the program crashes. In this case, the time stamp must be used todetermine the last logger entry.

Example:

>> 10:36:26.560 ### begin trace PVIDEMO.EXE/PviCom.dll/Client...>> 10:39:42.920 ### end trace PVIDEMO.EXE/PviCom.dll/Client

Logger output of PVI Manager and the PVICOM interface:

Object properties are represented by the parameters in the object description. Separate parameters are used forother information. Some of these parameters (e.g. identification numbers) are also output in the Snapshot file.

The following table shows the most important logger parameters:

Parameter Description

C=<ID> Identification number (ID) for the link object

P=<ID> Identification number (ID) for the process object

S=<ID> Identification number (ID) for the service object

PVI base system

1.7.2.2 Logger output format 159

Page 166: PviBase

CId=<ID> Identification number (ID) for the registered communication instance (client)

RId=<ID> Identification number (ID) for request and response data

L=<ID> Identification number (ID) of the assigned object within the line

Pn=<PathName> Path name of the process or service object

E=<Code> PVI error code. A "no error" status can also be signaled with "E=0".

SysE=<Code> System error code (general Windows error code)

SockE=<Code> Windows socket error code

Ty=<Type> PVI access type (numeric)

Md=<Mode> PVI function mode, numeric or string ("WR" − Write, "RD" − Read)

Dl=<Length> Data length of PVI request, response, or event data

Ih=<Handle> Handle of the PVICOM communication instance

Ot=<Type> PVI process object type as a numeric value

OT=<Type> PVI process object type as a string (Pvi, Line, Device, Station, Cpu, Module, Task, Pvar)

St=<Status> PVI status flags (bits) of response or event data (RESPONSE_INFO structure)

Msg=(<Msg>) User message for signaling response or event dataWindows message: W:<WindowHandle>,<MessageNumber>,<MessageParameter>Callback with data: CBD:<CallbackPointer>,< MessageParameter>Callback without data: CB:<CallbackPointer>,<MessageParameter>Asynchronous callback: CBA:<CallbackPointer>,<MessageParameter>"Msg=(NULL)" is output if no user message is defined.

CDesc=(<Par>) Specifies the link object description

PDesc=(<Par>) Specifies the process object description

Len=<Num> Length (general)

Offs=<Num> Offset (general)

Ev=<Flags> Enabling mask for object events in the line

Svc=<Mode> Line service ("RD", "WR", "IDENT", "INFO")

CdP=<ID> Identification number of the process object for the connection description

FrP=<ID> Identification number of the process object for the data format (only for variable objects)

HyP=<ID> Identification number of the process object for the hysteresis (only for variable objects)

PVI Manager log entries ("PviMan.exe" component) which begin with the "Comm" label indicate thecommunication between the PVI Manager (server) and the PVICOM communication instance (clients).

"Comm.Event" Sends event data

"Comm.ReadRequ" Receives request data for read request

"Comm.ReadResp" Sends response data for read request

"Comm.WriteRequ" Receives request data for write request

"Comm.WriteResp" Sends response data for write request

"Comm.CreateRequ" Receives request data for "Set up process object" request

"Comm.CreateResp" Sends response data for "Set up process object" request

"Comm.LinkRequ" Receives request data for "Set up link object" request

"Comm.LinkResp" Sends response data for "Set up link object" request

"Comm.ChgLinkRequ" Receives request data for "Change user message" request

"Comm.ChgLinkResp" Sends response data for "Change user message" request

"Comm.UnlinkRequ" Receives request data for "Release link object" request

"Comm.UnlinkResp" Sends response data for "Release link object" request

"Comm.UnlinkAllRequ" Receives request data for "Release all link objects" request

"Comm.UnlinkAllResp" Sends response data for "Release all link objects" request

"Comm.DeleteRequ" Receives request data for "Delete process object" request

"Comm.DeleteResp" Sends response data for "Delete process object" request

"Comm.ClientAttach" Registers a communication instance

"Comm.ClientDetach" Deregisters a communication instance

PVI base system

160 1.7.2.2 Logger output format

Page 167: PviBase

Request and response data can be assigned with the "CId" or "C" parameters together with the "RId" parameter.

Examples:

>> 12:00:14.340 Comm.WriteRequ Ty=11 C=0010 RId=80000018 Dl=2>> 12:00:14.390 Comm.WriteResp Ty=11 C=0010 RId=80000018 Dl=0

>> 12:00:15.040 Comm.CreateRequ CId=2d370003 RId=80000003 Name='@Pvi/LNINA2' OT=Line>> 12:00:15.040 Comm.CreateResp C=000b CId=2d370003 RId=80000003

The "DI" parameter specifies the number of transferred bytes when request and response data is written orread.

The PVICOM interface ("<Prog>/PviCom.dll/Client" component) logs all user function calls.

"Initialize" PviInitialize or PviXInitialize function call

"Deinitialize" PviDeinitialize or PviXDeinitialize function call

"SetGlobEventMsg" PviSetGlobEventMsg or PviXSetGlobEventMsg function call

"CreateRequest" PviCreateRequest or PviXCreateRequest function call

"CreateResponse" PviCreateResponseor PviXCreateResponse function call

"DeleteRequest" PviDeleteRequest or PviXDeleteRequest function call

"DeleteResponse" PviDeleteResponse or PviXDeleteResponse function call

"LinkRequest" Calls the PviLinkRequest or PviXLinkRequest function

"LinkResponse" PviLinkResponse or PviXLinkResponse function call

"UnlinkRequest" PviUnlinkRequest or PviXUnlinkRequest function call

"UnlinkResponse" PviUnlinkResponse or PviXUnlinkResponse function call

"ChgLinkRequest" PviChgLinkRequest or PviXChgLinkRequest function call

"ChgLinkResponse" PviChgLinkResponse or PviXChgLinkResponse function call

"UnlinkALL" PviUnlinkAll or PviXUnlinkAll function call

"ReadRequest" PviReadRequest, PviXReadRequest, PviReadArgumentRequest, orPviXReadArgumentRequest function call

"ReadResponse" PviReadResponse or PviXReadResponse function call

"WriteRequest" PviWriteRequest or PviXWriteRequest function call

"WriteResponse" PviWriteResponse, PviXWriteResponse, PviWriteResultResponse, orPviXWriteResultResponse function call

"GetResponseInfo" PviGetResponseInfo or PviXGetResponseInfo function call

With user functions, a log entry is output after entering the function and before leaving it. Synchronous functionvariants are represented by each matching request or response function.

User message execution is also logged.

"Call" Before calling a callback user function

"Return" After returning from a callback user function

"Send" Windows message has been sent

Example for writing:

>> 12:00:14.340 WriteRequest Ih=0 C=0010 Ty=11 Dl=2>> 12:00:14.340 WriteRequest OK...>> 12:00:14.390 Send W:00000974,1027,1001 RId=80000018>> 12:00:14.420 WriteResponse Ih=0 RId=80000018>> 12:00:14.420 WriteResponse OK C=0010 Ty=11 E=0 Dl=0

Example for event data:

>> 12:00:14.365 Send W:00000974,1026,1007 RId=8000005a>> 12:00:14.378 ReadResponse Ih=0 RId=8000005a

PVI base system

1.7.2.2 Logger output format 161

Page 168: PviBase

>> 12:00:14.378 ReadResponse OK C=0013 Ty=11 E=0 Dl=7

1.8 Appendix

1.8.1 Appendix A − Definitions

List of access types:

Access types No. Description

POBJ_ACC_OBJECT #1 Reads object type

POBJ_ACC_VERSION #2 Reads version of PVI components or corresponding PLC object

POBJ_ACC_ERROR #3 Reads error code of the most recent error

POBJ_ACC_EVMASK #5 Reads/Sets enabling mask for object events

POBJ_ACC_LIST #6 Reads list of all setup process objects

POBJ_ACC_LIST_EXTERN #7 Reads list of all possible process objects

POBJ_ACC_CONNECT #10 Reads/Writes connection description

POBJ_ACC_DATA #11 Reads/Writes process data

POBJ_ACC_STATUS #12 Reads/Sets PLC object status

POBJ_ACC_TYPE #13 Reads/Writes object attributes, mode for type conversion, and/or dataformat

POBJ_ACC_TYPE_EXTERN #14 Reads object attributes and data format as well as structure definitionand element names of a PLC variable

POBJ_ACC_REFRESH #15 Reads/Writes refresh rate

POBJ_ACC_HYSTERESE #16 Reads/Writes the event hysteresis of a variable object

POBJ_ACC_DEFAULT #17 Reads preset value for a variable object. The value is returned in stringformat.

POBJ_ACC_FUNCTION #18 Reads/Writes the data function of a variable object

POBJ_ACC_UPLOAD #20 Reads BR module from PLC and saves it to a file

POBJ_ACC_DOWNLOAD #21 Reads BR module from file and transfers it to PLC

POBJ_ACC_DATE_TIME #22 Reads/Sets date and time

POBJ_ACC_MEM_DELETE #23 Deletes specified data memory on the PLC

POBJ_ACC_MEM_INFO #24 Reads information about existing PLC data memory

POBJ_ACC_MOD_TYPE #25 Reads information about a PLC module

POBJ_ACC_UPLOAD_STM #26 Reads BR module from PLC and transfers it as binary user data

POBJ_ACC_DOWNLOAD_STM #27 Transfers BR module from binary user data to PLC

POBJ_ACC_LIST_LINE #30 Reads list of all possible line objects

POBJ_ACC_LIST_DEVICE #31 Reads list of all possible device objects

POBJ_ACC_LIST_STATION #32 Reads list of all possible station objects

POBJ_ACC_LIST_CPU #33 Reads list of all possible CPU objects

POBJ_ACC_LIST_MODULE #34 Reads list of all possible module objects

POBJ_ACC_LIST_TASK #35 Reads list of all possible task objects

POBJ_ACC_LIST_PVAR #36 Reads list of all possible variable objects

POBJ_ACC_CPU_INFO #50 Reads CPU information

POBJ_ACC_CANCEL #128 Cancels sent PVI instruction

POBJ_ACC_USERTAG #129 Reads / configures user tag

POBJ_ACC_INFO_LICENCE #200 Reads PVI Manager license information

POBJ_ACC_LIST_CLIENTS #210 Reads list of all clients registered with PVI Manager

POBJ_ACC_SNAPSHOT #240 Executes snapshot function

List of event types and global event types:

Event types No. Description

PVI base system

162 1.8 Appendix

Page 169: PviBase

POBJ_EVENT_ERROR #3 Change in error state or error code

POBJ_EVENT_CONNECT #10 Change in connection definition

POBJ_EVENT_DATA #11 Change in process data

POBJ_EVENT_STATUS #12 Change in status

POBJ_EVENT_DATAFORM #13 Change in data format

POBJ_EVENT_PROCEEDING #128 Progress information

POBJ_EVENT_USERTAG #129 User tag modification

POBJ_EVENT_PVI_CONNECT #240 Connection made to PVI Manager

POBJ_EVENT_PVI_DISCONN #241 Connection to PVI Manager lost

POBJ_EVENT_PVI_ARRANGE #242 New registration on PVI Manager

Parameters for object definition:

Par. Definition Description

CD KWDESC_CONNECT Connection definition

EV KWDESC_EVMASK Enabling mask for object event

LT KWDESC_LINKTYPE Link type

AT KWDESC_ATTRIBUTE Object attributes

RF KWDESC_REFRESH Refresh time

VT KWDESC_PVTYPE Variable type (data format)

VL KWDESC_PVLEN Variable length (data format)

VN KWDESC_PVCNT Number of elements (data format)

{...} PVICHR_SUB_ON,PVICHR_SUB_OFF

Definition of structure elements (data format)

AL KWDESC_ALIGNMENT Structure alignment (data format)

CM KWDESC_CASTMODE Mode for type conversion

VA KWDESC_PVADDR Variable addressing

DV KWDESC_DEFAULT Default value

HY KWDESC_HYSTERESE Event hysteresis

FS KWDESC_FUNCTION Data function

UT KWDESC_USERTAG User tag

Parameters for initialization parameters:

Par. Definition Description

AS KWINIT_AUTOSTART PVI Manager auto−start

LM KWINIT_MSG_LIMIT Limit on user messages.

PT KWINIT_PRC_TIMEOUT Process timeout (not suitable for standard applications)

IP KWINIT_IPADDR TCP/IP address or host name for remote communication type

PN KWINIT_IPPORT TCP/IP port number.

Parameters for object services:

Par. Definition Description

Pieces KWDESC_PVELEM Additional information for structure elements

VO KWDESC_PVOFFS Offset for structure elements

OT KWDESC_OBJTYPE Object type

SC KWDESC_SCOPE Scope

SN KWDESC_SNAME Structure name

LD KWDESC_LOADTYPE Load type / memory type

IM KWDESC_INSTMODE Installation mode

MN KWDESC_MODNAME Module name

PVI base system

1.8 Appendix 163

Page 170: PviBase

ST KWDESC_STATUS Status

FC KWDESC_FORCESTATE Force state

IO KWDESC_IOTYPE I/O type (attribute: r/w)

MT KWDESC_MODTYPE Module type

ML KWDESC_MODLEN Module length in bytes

SL KWDESC_MEMLEN Memory length in bytes

SF KWDESC_MEMFREELEN Available memory length in bytes

SB KWDESC_MEMBLOCKLEN Largest available memory area

List of process object types:

Object type definition Product ID

Binary String

POBJ_PVI #0 KWOBJTYPE_PVI Pvi Base object

POBJ_LINE #1 KWOBJTYPE_LINE Line Line object

POBJ_DEVICE #2 KWOBJTYPE_DEVICE Device Device object

POBJ_STATION #3 KWOBJTYPE_STATION Station Station object

POBJ_CPU #4 KWOBJTYPE_CPU CPU CPU object

POBJ_MODULE #5 KWOBJTYPE_MODULE Module Module object

POBJ_TASK #6 KWOBJTYPE_TASK Task Task object

POBJ_PVAR #7 KWOBJTYPE_PVAR Pvar Variable object

Keywords for load state / memory type:

Keyword Definition Description

SysRam KWLOADTYPE_SYS_RAM System RAM

RAM KWLOADTYPE_RAM User RAM

SysRom KWLOADTYPE_SYS_ROM System Flash (ROM)

Rom KWLOADTYPE_ROM User Flash (ROM)

MemCard KWLOADTYPE_MEMCARD Memory Card

FixRam KWLOADTYPE_FIX_RAM Fix RAM

DRam KWLOADTYPE_DRAM DRAM

PerMem KWLOADTYPE_PER_MEM Permanent memory

Delete KWLOADTYPE_DELETE Deletes module (access type POBJ_ACC_STATUS)

Installation mode keywords for cyclic tasks:

Keyword Definition Description

Overload KWINSTMODE_OVERLOAD Default mechanism

Copy KWINSTMODE_COPY Exchange in several cycles

OneCycle KWINSTMODE_ONECYCLE Exchange in one cycle

1.8.2 Appendix B − Base Components

The following tables shows the components that make up the PVI base system:

Component Directory Platform Description

PviMan.exe Bin NT/9x/CE PVI Manager

PviFcLin.dll Bin NT/9x/CE PVI data function LIN

PviMon.exe Bin NT/9x/CE PVI Monitor

PviCom.dll System NT/9x/CE PVICOM interface

PviLog.dll System NT/9x/CE PVI Data Logger

Vsauthd.vxd System 9x Driver for B&R security key (LPT port)

PVI base system

164 1.8.2 Appendix B − Base Components

Page 171: PviBase

Ds1410d.sys System PS Driver for B&R security key (LPT port)

Ds2490.sys System 2K/XP, 98/Me Driver for B&R security key (USB port)

Ibfs32.dll System NT/9x Library for B&R security key

Ib90usb.dll System 2K/XP, 98/Me Library for B&R security key (USB port)

Ib10e32.dll System NT/9x Library for B&R security key (LPT port)

BrSecChk.exe Tools NT/9x Program to check B&R security key

LnIna2.dll Bin NT/9x/CE INA2000 line (line server)

iComm.dll Bin NT/9x/CE INA2000 line (communication)

BrBase.dll Bin NT/9x/CE INA2000 line (sub−component)

BrMod102.dll Bin NT/9x INA2000 line (sub−component)

BrModCE.dll − CE INA2000 line (sub−component)

InaFrm.dll Bin NT/9x/CE INA2000 line (sub−component)

BrPgVm32.dll Bin NT/9x INA2000 line (sub−component)

BrBrMgen.dll Bin NT/9x Compilation library for binary modules

LnNet2.dll Bin NT/9x/CE NET2000 line (line server)

Net2000.dll Bin NT/9x/CE NET2000 line (NET2000 state machine)

LnMini.dll Bin NT/9x MININET line (line server)

LnOs9Net.dll Bin PS OS9NET line (line server)

Os9Arc.dll Bin PS OS9NET line (OS9/Net communication)

LnDCan.dll Bin NT/9x/CE Direct CAN linie (line server)

LnMtc.dll Bin NT/9x MTC line (line server)

InaFrms.dll Bin NT/9x/CE INA frame library (communication)

Serial.vxd System 95 Driver for RS485 communication in Windows 95

DvInaCan.dll Bin NT/9x/CE INACAN device DLL for the INA frame library

DvDCan.dll Bin NT/9x/CE DCAN device DLL for the INA frame library

InaCan.vxd System 9x Driver for B&R CAN devices

InaCan.sys System PS Driver for B&R CAN devices

CanDrv.dll − CE Driver for B&R CAN devices

CanDvCfg.cpl System NT/9x/CE B&R CAN device configurator

DvTcpIp.dll Bin NT/9x/CE TCP/IP device DLL for the INA frame library

DvModem.dll Bin NT/9x Modem device DLL for the INA frame library

DvPBusFDL.dll Bin NT/9x PBUSFDL device DLL for the INA frame library

PBus.vxd System 9x Driver for shared memory communication

PBus.sys System PS Driver for shared memory communication

DvLs251.dll Bin PS LS251 device DLL for the INA frame library

Ls251Drv.vxd System 9x Driver for LS251 communication

Ls251Drv.sys System PS Driver for LS251 communication

DvAr000.dll Bin PS AR000 device DLL for the INA frame library

NT stands for Windows NT/2000/XP.

9x stands for Windows 95/98/ME.

CE stands for Windows CE.

1.8.3 Appendix C − Registration

PVI Setup sets up all necessary Windows registry entries for the PVI base system. This appendix is intended forusers who carry out separate installation programs and need to replicate PVI base system registrationthemselves.

The PVI base system uses the Windows registry to store installation information, operating parameters, andsystem entries. PVI entries are divided among the following keys:

PVI base system

1.8.3 Appendix C − Registration 165

Page 172: PviBase

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App_Paths\PviMan.exe":This key holds the system entry for starting PVI Manager.

1.

"HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi":Installation information and operating parameters are stored under this key.

2.

"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet":This key contains PVI Setup driver information.

3.

"...\SOFTWARE\Microsoft\Windows\CurrentVersion\App_Paths\PviMan.exe" key:

The following is an overview of the registry entries for PVI Manager.

PviMan.exe −−> (default) ... Complete path name for the PVI Manager−−> Path ... Path name for the PVI Manager directory

Example from the registry file:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Pviman.exe]@="C:\\BrAutomation\\Pvi\\Bin\\Pviman.exe""Path"="C:\\BrAutomation\\Pvi\\Bin"

"...\SOFTWARE\BR_Automation\Pvi" key:

The following is an overview of the registry entries evaluated by the PVI base system.

Pvi−−> ProgrDate 2) ... Installation date−−> ProgrVersion 2) ... Installed version−−> ProgrLangName 2) ... Installed language (string)−−> ProgrLangID 2) ... Installed language (ID)−−> SockUse 3) ... Remote/Local communication type−−> SockPort 3) ... Port number (remote)−−> ManDispTrial 3) ... Warning message for security mode (0/1)−−> ManSysTray 3) ... Display in the taskbar (0/1)−−> ManPriority 3) ... Priority of PVI Manager−−> ManAutoExit 3) ... Automatic exit (0/1)−−> HelpFile 2) ... Path name for online help−−> SnapshotFile 3) ... Pathname for snapshot files−−> PviFunc 1) ... Key: List of data functions: −−> <Function> 1) ... Key: Data Functions −−> Path 1) ... Path for the function DLL −−> Name 1) ... Name of the function DLL−−> PviDevice 1) ... Key: List of devices −−> <Device> 1) ... Key: Device −−> Path 1) ... Path for the device DLL −−> Name 1) ... Name of the device DLL−−> PviLine 1) ... Key: List of lines −−> <Line> 1) ... Key: Line −−> Path 1) ... Path for the line DLL −−> Name 1) ... Name of the line DLL −−> Devices 1) ... Supported devices −−> DlgName ... Name of the line dialog box DLL −−> BR_TypeTranslation 1) ... Key: List of translation libraries −−> <Translation> 1) ... Key: Translation library −−> FileName 1) ... Path name of the translation DLL−−> PviMon 3) ... Key for PVI Monitor −−> RemoteAddr 3) ... IP address for remote connection −−> RemotePort 3) ... Port number for remote connection −−> Reconnect 3) ... Reconnection after startup (0/1) −−> ViewStyle 3) ... Display style for monitor dialog box−−> PviCfg 1) ... Key for PVI configuration files −−> Path 1) ... Path name for PVI configuration directory−−> DataLogger 3) ... Key for the PVI Data Logger

1) These registry entries are setup during the installation of the PVI base system and are not changedafterwards. They indicate the installed components of the PVI base system. These entries affect functionsof the PVI base system and should therefore always be present.

2) These registry entries are setup during the installation of the PVI base system and are not changedafterwards. They only serve to indicate the version or other subordinate functions. These entries are notabsolutely necessary to operate the PVI base system.

PVI base system

166 1.8.3 Appendix C − Registration

Page 173: PviBase

3) These registry entries are setup or changed by the PVI base system itself (e.g. PVI Monitor dialog boxes).When installing, these entries can be setup with preset values.

The registry entry "...\PviLine\<Line>\DlgName" is created with PVI Setup but is not evaluated by the PVI basesystem. It serves other PVI components when calling the dialog box DLL for setting communication parameters.

Key entry Description

<Function> Other additional key entries for all installed data functions are setup under the "...\PviFunc" key.The name of the key corresponds to the name of the data function. The location and name of thefunction DLL is defined with the "Path" and "Name" entries.

<Device> Other additional key entries for all installed communication devices are setup under the"...\PviDevice" key. The key name corresponds to the name of the device. For devices which havea device index, the smallest possible index is always listed in the key name (e.g. COM1, AR000_1,etc.). The "Path" and "Name" entries are options and define the corresponding device DLL for theINA frame library "InaFrms.dll".

<Line> Other additional key entries for all installed PVI lines are setup under the "...\PviLine" key. The keyname corresponds to the name of the line. The location and name of the line DLL is defined withthe "Path" and "Name" entries.The "Devices" entry shows all devices which are fundamentally supported by this line. Togetherwith the key entries for the installed communication devices (<Device>), it can be determinedwhich devices can be used for this line.

<Translation>The "BR_TypeTranslation" key is installed in the appropriate registry entry for PVI lines whichsupport the translation library in connection with the upload/download functions. Other additionalkey entries for all installed translation libraries are setup under this key. The path name of the DLLis defined with the "FileName" entry.

Example from the registry file:

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi]"ProgrDate"="19.02.2003""ProgrVersion"="2.3.0""ProgrLangName"="English""ProgrLangID"="001""SockUse"=dword:00000000"SockPort"=dword:00004e20"ManDispTrial"=dword:00000001"ManSysTray"=dword:00000001"ManPriority"="normal""ManAutoExit"=dword:00000000"HelpFile"="C:\\BrAutomation\\Pvi\\Help\\Pvi.chm""SnapshotFile"="C:\\BrAutomation\\Log\\PviMan.pvisnp"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviFunc]

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviFunc\LIN]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="PviFcLin.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice]

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice\COM1]

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice\MODEM1]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="DvModem.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice\TCPIP]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="DvTcpIp.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice\DCAN1]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="DvDCan.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviDevice\INACAN1]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="DvInaCan.dll"

PVI base system

1.8.3 Appendix C − Registration 167

Page 174: PviBase

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine]

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNINA2]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="LnIna2.dll""Devices"="COM1,INACAN1,LS251_1,MODEM1,PBUSFDL1,TCPIP,AR000_1""DlgName"="LnIna2Dlg"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNINA2\BR_TypeTranslation]

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNINA2\BR_TypeTranslation\BRT]"FileName"="C:\\BrAutomation\\Pvi\\Bin\\BrBrMgen.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNINA2\BR_TypeTranslation\NC_]"FileName"="C:\\BrAutomation\\Pvi\\Bin\\McModGen.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNNET2]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="LnNet2.dll""Devices"="COM1,LS251_1,MODEM1""DlgName"="LnNet2Dlg"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNMINI]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="LnMini.dll""Devices"="COM1""DlgName"="LnMiniDlg"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviLine\LNDCAN]"Path"="C:\\BrAutomation\\Pvi\\Bin""Name"="LnDCan.dll""Devices"="DCAN1"

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\PVI\PviMon]"RemoteAddr"="10.43.70.58""RemotePort"=dword:00004e20"Reconnect"=dword:00000000"ViewStyle"=hex:01,10,00,00,35,01,a2,00,67,00,5c,00,00,00,00,00,00,00,00,00,00,\00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\DataLogger]

"...\SOFTWARE\BR_Automation\BrAuthorization" key:

Entry for the B&R security key (dongle).

BrAuthorization−−> DsConfig ... Configuration for the B&R security key (dword) Bit 0 −> look for the security key on the LPT port Bit 2 −> look for the security key on the USB port

"...\SYSTEM\CurrentControlSet" key:

The following is an overview of the registry entries for B&R drivers.

Registration for CAN drivers in Windows NT/2000/XP:Services−−> InaCan ... Key for CAN driver −−> DisplayName = "B&R CAN Driver" −−> Type = 1 (dword) −−> Start = 2 (dword) −−> ErrorControl = 1 (dword) −−> Group = "BuR_Drivers" −−> Devices ... Key for CAN devices (device configurator) −−> ...−−> Eventlog −−> System −−> InaCan ... Key for CAN driver −−> EventMessageFile ... Entry for system log file −−> TypesSupported = 7

Entry for system log file:

PVI base system

168 1.8.3 Appendix C − Registration

Page 175: PviBase

"%SystemRoot%\System32\Drivers\InaCan.sys;%SystemRoot%\System32\IoLogMsg.dll"

Registration for CAN drivers in Windows 95/98/ME:Services−−> InaCan ... Key for CAN driver −−> Devices ... Key for CAN devices (device configurator) −−> ...

Registration for LS251 drivers in Windows NT/2000/XP:Services−−> Ls251drv ... Key for LS251 driver −−> DisplayName = "B&R LS251 Driver" −−> Type = 1 (dword) −−> Start = 2 (dword) −−> ErrorControl = 1 (dword) −−> Group = "BuR_Drivers" −−> Tag = 32 (dword) −−> Parameters −−> NmiOnShutDown = 0 (dword) −−> ServeMTC = 0 (dword) −−> CycleTimeMTC = 60 (dword) −−> NmiOnShutDown = 0 (dword) −−> DeviceNameMTC = "\Device\brMtcDevice0"Control−−> GroupOrderList −−> BuR_Drivers = 0x02,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00

Registration for LS251 drivers in Windows 95/98/ME:Services−−> VXD −−> Ls251drv ... Key for LS251 driver −−> Devices −−> 0 −−> Parameters −−> NmiOnShutDown = 0 (dword)

Registration for Profibus drivers in Windows NT/2000/XP:Services−−> PBUS ... Key for Profibus driver −−> Type = 1 (dword) −−> Start = 2 (dword) −−> ErrorControl = 1 (dword) −−> Group = "Extended base"

Registration for SD1410D drivers (dongle check) in Windows NT/2000/XP:Services−−> DS1410D ... Key for DS1410D driver −−> Type = 1 (dword) −−> Start = 2 (dword) −−> ErrorControl = 1 (dword) −−> Group = "Extended base" −−> Tag = 2 (dword)

PVI base system

1.8.3 Appendix C − Registration 169

Page 176: PviBase

PVI base system

170 1.8.3 Appendix C − Registration