0% found this document useful (0 votes)
1K views176 pages

Pvi Base

B&R PVI tutorial

Uploaded by

satish734
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views176 pages

Pvi Base

B&R PVI tutorial

Uploaded by

satish734
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 176

PVI base system

PVI base system

Contents (4.4.2006)
1 PVI base system.................................................................................................................................................1 1.1 Overview..............................................................................................................................................1 1.2 Terms...................................................................................................................................................2 1.3 PVI Manager........................................................................................................................................3 1.4 PVI Monitor ...........................................................................................................................................4 1.4.1 Setting PVI Manager properties ..................................................................................................6 1.4.2 Snapshot Function......................................................................................................................7 1.4.3 Snapshot Viewer .........................................................................................................................7 1.4.4 Configuring the Data Logger for PVI Components...................................................................10 1.5 PVICOM Interface..............................................................................................................................14 1.5.1 User Guidelines.......................................................................................................................14 1.5.2 Client/Server Communication...................................................................................................17 1.5.2.1 Communication Instances...............................................................................................18 1.5.2.2 Communication Type......................................................................................................18 1.5.3 Global Events...........................................................................................................................19 1.5.4 Objects ......................................................................................................................................20 1.5.4.1 Process Objects..............................................................................................................21 1.5.4.2 Link Objects .....................................................................................................................23 1.5.4.3 Service Objects...............................................................................................................23 1.5.5 Object Names and Connection Descriptions............................................................................23 1.5.5.1 Object Names with Path Specification............................................................................24 1.5.5.2 Unique Object Names.....................................................................................................25 1.5.6 Object descriptions...................................................................................................................25 1.5.7 User messages.........................................................................................................................27 1.5.7.1 User message operation.................................................................................................27 1.5.7.2 User messages as window messages............................................................................28 1.5.7.3 User messages as callback functions with data..............................................................29 1.5.7.4 User messages as callback functions without data.........................................................31 1.5.7.5 User messages as asynchronous callback functions......................................................32 1.5.8 Requests and Responses ........................................................................................................33 1.5.8.1 Sending Requests and Receiving Responses................................................................34 1.5.8.2 Order of Request Execution............................................................................................35 1.5.9 Access types .............................................................................................................................35 1.5.9.1 POBJ_ACC_DATA access type......................................................................................42 1.5.9.2 POBJ_ACC_STATUS access type.................................................................................42 1.5.9.3 POBJ_ACC_TYPE access type......................................................................................43 1.5.9.4 POBJ_ACC_TYPE_EXTERN access type.....................................................................43 1.5.9.5 POBJ_ACC_UPLOAD and POBJ_ACC_UPLOAD_STM access types.........................43 1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types .............45 1.5.9.7 POBJ_ACC_MOD_DATA access type...........................................................................47 1.5.10 Object Events.........................................................................................................................50 1.5.11 Event types.............................................................................................................................51 1.5.11.1 POBJ_EVENT_ERROR Event Type.............................................................................52 1.5.11.2 POBJ_EVENT_DATA Event Type................................................................................52 1.5.11.3 POBJ_EVENT_DATAFORM Event Type ......................................................................53 1.5.12 Process Data..........................................................................................................................53 1.5.12.1 Type casting..................................................................................................................54 1.5.12.2 Variable Addressing......................................................................................................57 1.5.13 Process Data Properties........................................................................................................58 1.5.13.1 Object Attributes............................................................................................................58 1.5.13.2 Refresh Time.................................................................................................................59 1.5.13.3 Data Format..................................................................................................................59 1.5.14 Process Data Functions ..........................................................................................................62 1.5.14.1 Event Hysteresis...........................................................................................................63 1.5.14.2 Data Functions..............................................................................................................63 1.5.15 PVICOM functions..................................................................................................................66 1.5.15.1 Functions with or without an instance handle ................................................................67 1.5.15.2 Asynchronous and synchronous functions....................................................................67 1.5.15.3 PviInitialize, PviXInitialize Functions.............................................................................68 1.5.15.4 PviDeinitialize, PviXDeinitialize Functions .....................................................................70
i

PVI base system

Contents (4.4.2006)
1 PVI base system 1.5.15.5 PviSetGlobEventMsg, PviXSetGlobEventMsg functions ...............................................71 1.5.15.6 PviCreateRequest, PviXCreateRequest Functions.......................................................73 1.5.15.7 PviCreateResponse, PviXCreateResponse Functions.................................................76 1.5.15.8 PviCreate, PviXCreate Functions..................................................................................76 1.5.15.9 PviDeleteRequest, PviXDeleteRequest Functions........................................................77 1.5.15.10 PviDeleteResponse, PviXDeleteResponse Functions................................................78 1.5.15.11 PviDelete, PviXDelete Functions .................................................................................79 1.5.15.12 PviLinkRequest, PviXLinkRequest Functions.............................................................79 1.5.15.13 PviLinkResponse, PviXLinkResponse Functions........................................................81 1.5.15.14 PviLink, PviXLink Functions........................................................................................82 1.5.15.15 PviUnlinkRequest, PviXUnlinkRequest Functions .......................................................83 1.5.15.16 PviUnlinkResponse, PviXUnlinkResponse Functions.................................................84 1.5.15.17 PviUnlink, PviXUnlink functions ...................................................................................84 1.5.15.18 PviChgLinkRequest, PviXChgLinkRequest Functions................................................85 1.5.15.19 PviChgLinkResponse, PviXChgLinkResponse Functions ...........................................86 1.5.15.20 PviChgLink, PviXChgLink Functions...........................................................................87 1.5.15.21 PviUnlinkAll, PviXUnlinkAll Functions.........................................................................87 1.5.15.22 PviReadRequest, PviXReadRequest Functions.........................................................88 1.5.15.23 PviReadArgumentRequest, PviXReadArgumentRequest Functions..........................89 1.5.15.24 PviReadResponse, PviXReadResponse Functions....................................................90 1.5.15.25 PviRead, PviXRead functions.....................................................................................90 1.5.15.26 PviWriteRequest, PviXWriteRequest Functions..........................................................91 1.5.15.27 PviWriteResponse, PviXWriteResponse Functions....................................................92 1.5.15.28 PviWriteResultResponse, PviXWriteResultResponse functions.................................93 1.5.15.29 PviWrite, PviXWrite functions......................................................................................93 1.5.15.30 PviGetResponseInfo, PviXGetResponseInfo Functions.............................................94 1.5.15.31 PviGetVersion Function ...............................................................................................95 1.5.16 PVICOM Structures................................................................................................................95 1.5.16.1 PROCEEDING_INFO Structure....................................................................................96 1.5.16.2 RESPONSE_INFO Structure........................................................................................96 1.6 PVI lines.............................................................................................................................................97 1.6.1 Line object................................................................................................................................98 1.6.2 INA2000 line.............................................................................................................................98 1.6.2.1 INA2000 process objects................................................................................................98 1.6.2.2 INA2000 access types .....................................................................................................99 1.6.2.3 INA2000 events.............................................................................................................100 1.6.2.4 INA2000 Communication..............................................................................................100 1.6.2.5 INA2000 device objects .................................................................................................103 1.6.2.6 INA2000 CPU objects...................................................................................................108 1.6.2.7 INA2000 Module Objects..............................................................................................114 1.6.2.8 INA2000 Task Objects..................................................................................................114 1.6.2.9 INA2000 variable objects..............................................................................................115 1.6.2.10 Translating BR Modules..............................................................................................117 1.6.2.11 Link node variables.....................................................................................................118 1.6.3 NET2000 line..........................................................................................................................119 1.6.3.1 NET2000 process objects.............................................................................................120 1.6.3.2 NET2000 access types.................................................................................................120 1.6.3.3 NET2000 events ............................................................................................................121 1.6.3.4 NET2000 Communication.............................................................................................121 1.6.3.5 NET2000 device objects...............................................................................................123 1.6.3.6 NET2000 Station Objects..............................................................................................127 1.6.3.7 NET2000 Task Objects.................................................................................................127 1.6.3.8 NET2000 Variable Objects............................................................................................127 1.6.4 MININET line..........................................................................................................................129 1.6.4.1 MININET process objects ..............................................................................................129 1.6.4.2 MININET access types..................................................................................................130 1.6.4.3 MININET events............................................................................................................130 1.6.4.4 MININET Communication ..............................................................................................130 1.6.4.5 MININET device objects................................................................................................132
ii

PVI base system

Contents (4.4.2006)
1 PVI base system 1.6.4.6 MININET Station Objects..............................................................................................133 1.6.4.7 MININET Variable Objects............................................................................................133 1.6.5 DCAN line...............................................................................................................................134 1.6.5.1 DCAN process objects..................................................................................................134 1.6.5.2 DCAN access types......................................................................................................135 1.6.5.3 DCAN events .................................................................................................................135 1.6.5.4 DCAN Communication..................................................................................................136 1.6.5.5 DCAN Device Objects...................................................................................................136 1.6.5.6 DCAN Station Objects...................................................................................................137 1.6.5.7 DCAN Variable Objects.................................................................................................138 1.6.6 MTC line.................................................................................................................................140 1.6.6.1 MTC process objects .....................................................................................................141 1.6.6.2 MTC access types.........................................................................................................141 1.6.6.3 MTC events...................................................................................................................142 1.6.6.4 MTC Communication .....................................................................................................142 1.6.6.5 MTC Device Objects.....................................................................................................142 1.6.6.6 MTC Variable Objects...................................................................................................143 1.6.7 OS9NET line...........................................................................................................................149 1.6.7.1 OS9NET process objects..............................................................................................149 1.6.7.2 OS9NET access types..................................................................................................150 1.6.7.3 OS9NET events............................................................................................................150 1.6.7.4 OS9NET Communication..............................................................................................150 1.6.7.5 OS9NET Device Objects...............................................................................................151 1.6.7.6 OS9NET Station Objects ...............................................................................................151 1.6.7.7 OS9NET Variable Objects .............................................................................................151 1.7 Diagnostics .......................................................................................................................................152 1.7.1 Snapshot Files........................................................................................................................152 1.7.2 Data logger.............................................................................................................................156 1.7.2.1 PVI components with logger output ...............................................................................157 1.7.2.2 Logger output format.....................................................................................................159 1.8 Appendix..........................................................................................................................................162 1.8.1 Appendix A Definitions .........................................................................................................162 1.8.2 Appendix B Base Components ............................................................................................164 1.8.3 Appendix C Registration......................................................................................................165

iii

PVI base system

iv

1 PVI base system


The PVI (Process Visualization Interface) base system is the central means to access B&R Automation Net in Windows 95/98/ME, NT/2000/XP and CE. PVI forms a common interface to the world of the B&R industrial PCs for all Windowsbased software packages. Each station communicating on the network can exchange and process 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 from simple process variables to lists and program/data objects. PVI Manager organizes process data with regard to both timing and direction. PVI Monitor is an auxiliary tool which displays operating states, versions of active PVI components, and PLC operating systems. In addition, PVI Monitor is used to configure PVI Manager and PVI Data Logger properties and 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 all other Windowsbased 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 for communicating 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 which process data is collected. Since process data in a control system must often be obtained asynchronously over slow serial data lines or other bus systems before being passed on, it is necessary to store the data in a process image. In PVI, the process image consists of a number of variable objects containing data which is updated either cyclically or at specific time points. Variable objects are special types of process objects. Other process objects are used to handle services such as module downloading/uploading, reading PLC information, or defining the PLC connection, etc. Process objects are managed in an object structure within PVI Manager. Connecting process objects with external objects (e.g. objects on a PLC) takes place with one or more PVI lines (line servers). They also take over 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 and PVICOM applications are the clients. Servers and clients can be on the same machine (local communication type) or on different computers (remote communication type). Using additional servers, it is also possible to link architectures like DDE (Dynamic Data Exchange), OPC (OLE for process control) or HTML (Web) to PVI. These servers are components of PVI and delivered in the PVI standard package. The following image gives an overview of the most important PVI components:

1 PVI base system

PVI base system

1.2 Terms
Term Connection description Description A connection description consists of the connection name and optional connection parameters. 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 the service object. Depending on the process object type being used, the connection name defines 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 PVICOM communication instance to the PVI application. Response data Response data is received from the application with a PVICOM response. This also includes 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 global event). This also includes any error codes and status flags in addition to the actual data. Communication The communication type defines the type of the connection between the PVICOM type application and PVI Manager. Communication The communication between a PVICOM application and PVI Manager is handled via a instance communication instance. Line A PVI line establishes the connection between a subset of process objects and the environment outside of PVI. Depending on the line being used, this "outside world" can consist of PLC objects (INA2000 line) or PC objects (MTC line). A line is also called a line server. Object attributes Object attributes control how process data is acquired and handled for a process object (variable object).
2 1.2 Terms

PVI base system

Object name Object path

The object name is the name of a process object in PVI Manager. The object path consists of one or more object names and determines the position of a process 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 data necessary to regulate a visualization process. Process object Process objects represent the process image in PVI Manager. Process object The process object state describes the actual condition of a process object. The process state object 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 is updated. Service objects A service object assigns an external object to a process object. External object can be in the 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 into the data format of the link object and vice versa. Link object A link object establishes a connection from the application to a PVI Manager process object. 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 all types from simple process variables to lists and program/data objects. PVI Manager organizes process data for both timing and direction. That means PVI Manager uses the specifications from the application to determine which data is transferred via which device and medium from or to a certain station. Special attention has been given to asynchronous task handling in order to e.g. be able to use network delays for other tasks or to fit in coordinated event processing between different tasks. PVI Manager must be started to use PVI (PVICOM interface). The manager is automatically started when using the local communication type (PVICOM function PviInitialize or PviXInitialize). The manager has to be started by the 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 can either be operated as a process or as a service. Functions to install and uninstall the PVI Manager service are integrated into PVI Manager. To install the PVI Manager service, PVI Manager just needs to be called with the program argument "/install". The next time the program is started (without any program arguments), PVI Manager will be operated as a service. Uninstalling takes place with the program argument "/deinstall". PVI Manager 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 be started and ended, just like process. In addition, as a service, the program is shown in the list of local services and 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 can be turned off in the PVI Manager properties. Icon Description PVI Manager is being operated as a process

1.3 PVI Manager

PVI base system

PVI Manager is being operated as a service Doubleclicking 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 diagnostics functions and global properties for the PVI Manager. PVI Monitor is started by doubleclicking on the PVI Manager icon in the system tray or using the "PVI Monitor" entry in the Start menu. The PVI Monitor status window 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 runs for 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 number of process objects with errors The number of service objects present in PVI Manager, number of active service objects, and number of service 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 counter display, PVI Monitor tracks its own calls and subtracts them from the status counters. Closing the PVI Monitor and then restarting it immediately may therefore cause the status counters to increase erratically. The cyclic PVI Monitor information requests can be turned on and off with the "Options > Stop Cyclic Refresh" menu item. PVI Monitors operations and functions:

1.4 PVI Monitor

PVI base system

Menu File > Connect

Function Establishes the communication connection to PVI Manager (only in Remote communication mode). File > Disconnect Ctrl+S Removes the communication connection to PVI Manager (only in Remote communication mode). File > Start Manager Ctrl+Alt+O Starts PVI Manager (only in Local communication mode). File > Stop Manager Ctrl+Alt+S Ends PVI Manager (only in Local communication mode). Options > Manager Properties Alt+F7 Configures PVI Manager properties. Options > PVI Diagnostics Alt+F8 Configures the PVI Data Logger for generating PVI log files. Triggers the Snapshot function for generating a PVI snapshot file. Options > PVI Snapshot Viewer Alt+F9 Snapshot viewer for displaying PVI snapshot files. Options > Topmost Determines whether PVI Monitor should also be in the foreground on the screen. Options > Show Toolbar Shows/Hides the toolbar. Options > Stop Cyclic Refresh Ctrl+F5 Turns the PVI Manager cyclic information request on/off. Help > Documentation F1 Opens the PVI base documentation (only if installed). Help > Component Versions Displays the versions of all currently active PVI Manager PVI components. Help > PCC System Versions Shows the operating system versions of all PLCs currently connected to PVI Manager.

Key Ctrl+O

PVI Monitor communication type: Communication with PVI Manger can be done either locally (Monitor and Manager running on the same computer) or remotely (Monitor and Manager not running on the same computer). The type of communication used is determined by the "/Remote" program argument when PVI Monitor is started and can no longer be changed at runtime. The PVI entry in the Start Menu provides both types of communication (menu entries "PVI Monitor" and "PVI Monitor (Remote)"). The remote connection is not supported in the Windows CE version of PVI Monitors. However, a remote connection can be made to the Windows CE version of PVI Manager under Win32.
> 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" input field. The "Number of Port" input field needs to contain the port number assigned to PVI Manager (Setting PVI Manager Properties).

1.4 PVI Monitor

PVI base system

1.4.1 Setting PVI Manager properties


The dialog box for setting PVI Manager properties is done by running "Options > Manager Properties" in PVI Monitor. For the Windows CE version, click on the "Properties" button in PVI Monitor. Regardless of the PVI Monitor communication type being used (remote or local), the PVI Manager properties are always configured on the 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 administrator rights.

Use TCP/IP Communication: If this field is selected, them PVI Manager is started as a TCP/IP server (remote communication type). A unique port number has to be assigned in the "Number of Port" field. Any value between 1024 and 65535 can be defined as a port number. The default value for PVI is 20000. The port number has to be unique within the local computer, 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, unnecessary resources 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 has not 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. PVI Manager 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 communication instance (client) is deregistered. However, there can be no static process objects which were created earlier still available (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.

1.4.1 Setting PVI Manager properties

PVI base system

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 with their status and a list of all registered clients as text (ASCII) in the specified Snapshot file. The contents of the snapshot 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 is triggered. All other functions in PVI Manager are blocked while the Snapshot function is carried out. This secures the consistency of the Snapshot data, but can also lead to immense timing variations when there are large 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 > PVI Diagnostics".

Clicking on the "Snapshot" button triggers a snapshot function. The Snapshot information is written to the file specified in the "Path" input field. The path specification for the Snapshot file refers to PVI Manager. If PVI Manager and PVI Monitor are not on the same computer (remote communication type), this needs to be taken into consideration. The Snapshot function cannot be used with the Windows CE version of PVI Monitor. However, a standard version of PVI Monitor is able to use the PVI Manager Snapshot function on Windows CE computers over a remote 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 objects and service objects. Selecting an entry in the tree view shows all of the sublevel 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
1.4.2 Snapshot Function 7

PVI base system

of the objects assigned. In addition to the object name, the list view also displays the object ID, object status, and the object description for the PVI object. The object type is indicated by its icon. Snapshot Viewer operations and functions: Menu File > Open Snapshot File File > Make Topical Snapshot Function Opens and displays a snapshot file. Triggers a temporary snapshot to PVI Manager and displays it is the 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 the snapshot function, current PVI settings, and the version of PVI and 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 the Search 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 list view on/off. Options > Display Colored Objects Turns the colored object display for highlighting the object status on/off. Help > Documentation F1 Opens the PVI base documentation (only if installed). Key Ctrl+O F5

Object status: The object status is output in the "State" column in the list view and shows the status of the PVI objects at the point the snapshot is taken. Status display Act Idl NotRdy Rdy Err External Internal Temp Static Local Remote Description Link, process, or service object is in an active state. Link, process, or service object is in an inactive state (idle). Link, process, or service object is in an undefined state. Link, process, or service object is in a ready state. Link, process, or service object is in an error state. External process object. Internal process object. Process object set up as a temporary process object. Process object set up as a static process object. Communication instance with a local communication type. Communication instance with a remote communication type.

Displaying the object status can be highlighted using a colored object display (Options > Display Colored Objects): Color Green Blue Red
8

Object status Object is active. Object is inactive. Object is active and in an error state.
1.4.2 Snapshot Function

PVI base system

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) the current object description at the point the snapshot was taken. Communication instances show the parameters specified 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 opened using 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 also the default after the Snapshot Viewer is run. The settings made in the image above would only display active objects. Higherlevel 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 for searching 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
1.4.2 Snapshot Function 9

PVI base system

in the main list view. If you want to continue the search, you can either reopen the search dialog box and click on 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) is specified when PVI Monitor is started, then only the Snapshot Viewer is opened. The snapshot file provided is read 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 a standalone 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 Logger included 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 > PVI Diagnostics".

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 the component list. The names of all components set up are displayed when the dialog box is expanded. To set up a new component, doubleclick 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 logger properties of a component which has already been set up, doubleclick on the respective entry in the component list. To delete a component from the list, first select it and then press the "Delete" key on the keyboard. 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 point on, any settings made become effective. Restarting the components is not necessary. Changes require administrator rights. Component dialog box for defining components and setting logger properties:

10

1.4.4 Configuring the Data Logger for PVI Components

PVI base system

Standard procedure for switching on the Data Logger: 1. Select the PVI Monitor menu "Options > PVI Diagnostics" to open the main dialog box 2. Set the "Global Mode" to "Log Details" 3. Enable the "Global Verbose" checkbox and set the "Global Time Stamp" to "Time+Date" 4. Click on "Details" to enlarge the dialog box 5. Create and define all necessary components if they are not already in the component list 6. Remove any unnecessary components from the component list or change their "Mode" to "Off" in the component dialog box 7. Make desired logger settings in the component dialog box for all required components 8. Click on "Apply" 9. Click on "Exit" to exit from the main dialog box Standard procedure for switching off the Data Logger: 1. Select the PVI Monitor menu "Options > PVI Diagnostics" to open the main dialog box 2. Set the "Global Mode" to "Off" 3. Click on "Apply" 4. Click on "Exit" to exit from the main dialog box Defining components: The name of the desired PVI component is defined in the "Component" input field. This name consists of a maximum of three segments. Each of these segments is separated using a forwardslash ('/') character. Component names are not case sensitive. <Program>[/<Module>][/<Section>] Section <Program> <Module> Description File name for the program where the component is being used in a process context. This program name needs to be specified completely. If the desired component is a module (e.g. DLL), then the complete module file name needs to be specified here. If the desired component is a program, then this segment does not need to be specified. Some PVI components divide logger output into several sections. The desired section is selected by specifying a section name.

<Section>

An overview of the most important PVI components with logger output has been put together in the PVI Components with Logger Output section.
1.4.4 Configuring the Data Logger for PVI Components 11

PVI base system

Setting the logging mode and verbose: Setting the logging mode is crucial for logger output. Logging mode "Off" "Log Errors" "Log Mains" Description

Logger output is turned off Logger output at Level 1 (PVILOG_ERROR): Only errors are logs. Logger output at Level 2 (PVILOG_MAIN): Errors as well as sequences at the interfaces (from externally controlled program flow) are logged. "Log Details" Logger output at Level 3 (PVILOG_DETAIL): In addition to "Log Mains", internal function processes are output (internal program flow). The logging mode can be defined for each component in the "Mode" selection box. This selection is also displayed in the "Mode" column in the main dialog box's component list. In addition, the logging mode can be set in the "Global Mode" field in the main dialog box. This setting works globally and limits the logging mode of all components. If "Global Mode" is switched "Off", then logger output is turned off for all components. If "Global Mode" is set to "Log Details", then logger information is output according to the logging mode of the individual components. Additional logger output is enabled by switching on Verbose mode. Some PVI components carry out a hexdump output 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 on for 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 with Verbose mode. Note, however, that logger output consumes a relatively large amount of computing time. In practice, all logger information is not usually necessary. In addition, changes in timing should be kept to a minimum as much as possible. Setting the logging mode and Verbose mode should therefore always be adapted 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 output starts. Path specifications always refer to the component itself. If the component and PVI Monitor are not on the same computer (remote connection), this needs to be taken into consideration. Each component is assigned a separate 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 defined in the "File Size" field. The file size is specified in KB. The default value for the file size if 1024 KB (1 MB). If a larger 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 time stamp can be set. Format "No" "Time" "Time+Date" Description Instead of a time stamp, values in increasing order are output. Outputs the current time 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 stamp format can also be set in the "Global Time Stamp" field in the main dialog box. This setting takes effect globally and limits the time stamp format for all components. The default setting for the format is "Time". If logging should take place over a period of several days, then the "Time+Date" setting may be more appropriate.

12

1.4.4 Configuring the Data Logger for PVI Components

PVI base system

The "Line Length" input field defines the maximum length of a text line in characters. Basically, each logger entry begins on a new line. However, if the maximum line length is reached when writing, then output continues on a new line. The maximum line length is not meant to limit logger information; instead, it serves for better logger 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 a logger file with the defined name is automatically created. If a file already exists with the same name, then it deleted beforehand. By specifying a value greater than 0 (zero) in the "Backup Level" field in the component's dialog box, this can be prevented. This value defines the maximum number of levels for backup files (maximum 20). To prevent an existing logger file from being overwritten, the old logger file is renamed as a backup file each time it is opened. This new file name is also listed with a number. If the maximum number of backup file levels is reached, 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 of information (e.g. error situation or a program's initialization phase) should remain in the file, then the logger output needs to stopped in time. This can be done manually by ending the program or setting the logging mode to "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 be defined using one or more text expressions. These text expressions may not contain blank characters. Individual text expressions are linked together using the logical operators "&" (AND), "|" (OR), and "!" (NOT). At least one space needs to be entered between the text expression and the operator. If an operator is not defined between two text expressions, then the "&" (AND) operator is used. A maximum of 32 text expressions can be specified for 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 at least one expression matches, then the result becomes 1 (TRUE). Otherwise, the result is 0 (FALSE). Case is not taken into account when comparing text expressions (not casesensitive). Then all section results are linked with the specified operators. The following is the order in which the operations are carried out: NOT, AND, OR. If the 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 break expression in the "Expression" field. A certain time can optionally be defined between the break detection (break condition is met) and carrying out the break (stopping logger output). This break time is specified in the "Break Time" field in milliseconds. What happens when the break occurs can be selected in the component's dialog box: Selection "Break component logging" Description 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. "Turnoff global logging mode" Logger output is stopped for all components. This automatically switches the global logging mode to "Off". To turn logger output back on again, the logging mode 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.

1.4.4 Configuring the Data Logger for PVI Components

13

PVI base system

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 all other Windowsbased 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. If applications use functions of a DLL, then the DLL has to be loaded explicitly with functions being declared, or the static library "PviCom.lib" has to be bundled to the program (loaded implicitly). The procedure can be found in 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 PviCom.lib PviCom.h PviCom.bas PviCom.pas PVI communication library Static library for Visual C Definition file (include file) for Visual C Definition file (include file) for Visual Basic 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, Automation Studio, or a PVI server (PVI OPC, PVI DDE, PVI controls, etc.). This requires a certain amount of complexity when using functions and their options. This section here is meant to provide PVICOM users with preliminary help 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. This communication instance establishes a connection between the PVICOM application and PVI Manager. The PVICOM function PviInitialize or PviXInitialize must be called to set up a communication instance. This also sets up the communication type "local" (application and PVI Manager on the same computer) or "remote" (application and PVI Manager on different computers) as well as the timeout for life sign monitoring (communication timeout).

14

1.5 PVICOM Interface

PVI base system

Unlike the function "PviInitialize", "PviXInitialize" can be called more than once. Each call sets up a new communication instance. This allows a PVICOM application to be able to communicate with several PVI Managers on different computers. If a communication instance is set up with PviXInitialize, then PVICOM functions 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 or PviXDeinitialize 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 PVI Manager 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, as well as the communication instance's temporary process objects in PVI Manager, are lost. After the manager is restarted 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 either reestablish the last existing object state in PVI Manager (set up PVI objects and set to active or inactive) or prepare 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 is represented using the object structure. Object structures consist of individual process objects arranged in the form of a tree structure. Because of this, it is also called the process object tree. When setting up the process object, the application also has to assign an object name. The user can select any name for this process object name. Putting together the process object name with the object path can be done to ascertain an individual process 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, CPU objects, module objects, task objects, and variable objects. Each object type has a certain task in the object structure. The base object is the highestlevel process object in the object structure. This object is always present and doesn't need to be set up. The line object determines the PVI line being used. Normally, device objects, station objects, and CPU objects are used to establish the communication connection to the PLC and address a PLC in the network. Module objects, task objects, and variable objects represent a corresponding PLC 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 name has 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), online services 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 can take place using a modem, LS251, or serial RS232 or RS422 connection, as well as over a serial RS485 network. When using the serial RS232 or RS422 for communication (one or several pointtopoint connections), the NET2000 line offers a higher data throughput as the INA2000 line. However, NET2000 protocol parameters have to have the right settings. The INA2000 line is better suited for network connections to more than one PLC.

1.5 PVICOM Interface

15

PVI base system

The MININET line is intended for B&R SG2 controllers (MULTI / MIDI / MINI and Compact). MININET communication 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 link object. The application then uses this link object to access process data, object properties or object states of the process object, or to carry out special services. Link objects are set up with the PVICOM function PviLinkRequest or PviXLinkRequest and released with PviUnlinkRequest 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 or PviXCreateRequest). A static process object is only set up once and remains throughout the entire runtime of PVI 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, the temporary process object is also freed up. A newly set up link object with a line connection triggers a process for either establishing a connection (station objects, CPU objects) or for PLC object identification (module objects, task objects, variable objects). Depending on the line being used, this process can take some time to complete. If the process object is released and then freshly set up again, then this process has to be repeated. It is therefore an advantage if PVICOM applications only 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 of process objects The object structure should be managed centrally. At the start (e.g. Windows startup), a generator or configurator (as the PVICOM application) sets up all required process objects. To do so, information about the object structure can be read from an ASCII text file or database. Then the application can be ended again. An interface server which remains active during the entire PVI Manager runtime and provides information about the necessary object structure right after being started. In principle, interface servers can 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 process objects 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 type POBJ_ACC_CONNECT), then it and all subordinate objects should be set up as temporary process objects. The points mentioned above are only intended as decision guidance. The type of process object used by the PVICOM application needs to be decided according to requirements. However, if in doubt, temporary process objects 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. In principle, PVICOM applications should only keep process objects in an active state if they are needed at that moment. 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 during runtime:
16 1.5 PVICOM Interface

PVI base system

1. 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. Then the 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 more picture are enabled at the same time, then there are two or more link objects present for each process object used together. The advantage of this method is that each picture only has to be aware of its own process objects. Event data is automatically distributed to the individual pictures via the link objects. A picturecomprehensive management of process object states and event data is therefore not necessary. 2. 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 the application sets all of the process objects in the picture to the desired active or inactive state using access type POBJ_ACC_EVMASK. However, this method requires a central management of process object states and event data. If several pictures use the same process objects, then the active and inactive states have to be coordinated with one another. The event data read has to be distributed to the active pictures. 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 variable object 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: 1. 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 refresh time determines the read cycle. Example for the process object description: "CD=var1 AT=rw RF=250". 2. Data is gotten through event variables: Event variables are set up on the PLC. They only send their process data to PVI when they have changed. The object attribute 'e' must be specified. The refresh time defines the PLCinternal read cycle here. Example for the process object description: "CD=var1 AT=erw RF=250". 3. 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 by calling the PviReadRequest or PviXReadRequest and using access type POBJ_ACC_DATA. With this method, process data can be received either as response data from the read instruction or as event data. It is not recommended to define a user message to occur for response data when the read instruction is given. The process data is then sent to the application as event data, like the other types of data 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".

1.5.2 Client/Server Communication


This section deals with the communication between a PVICOM application and the PVI Manager. The communication 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 the PVICOM applications are the clients. Servers and clients can be on the same machine (local) or on different computers (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 type of client/server connection. Each PVICOM client/server connection is handled using one communication instance. The PVICOM interface allows an application to set up several communication instances. In this way, an application can exchange data with several PVI Managers at the same time. Theoretically, up to 65,534 communication instances can be registered on one PVI Manager.

1.5.2 Client/Server Communication

17

PVI base system

1.5.2.1 Communication Instances To set up a PVICOM communication instance, an application must first call the PVICOM function PviInitialize or PviXInitialize. This will also determine the communication type (local or remote) and the timeout for the life sign monitoring (communication timeout). Setting up also initiates the communication instance (client) registration for the PVI Manager (server). If a communication instance is set up, PVICOM functions can send requests to the PVI Manager in addition to the definition of a user message. After the PVI Manager sends back an appropriate response, the user message defined with the request is carried out (Request and Respond). Using this method, the application is able to set up PVI connection and process objects, access dates, conditions, or properties, and free up PVI objects. When setting 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 the PviDeinitialize or PviXDeinitialize PVICOM function. This also deregisters 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 instance is deregistered from the PVI Manager, then all assigned link objects as well as temporary process objects are automatically freed up. Each PVICOM communication connection has life sign monitoring. This checks the function of the connection by way 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 deregisters the communication instance. The same thing happens when the PVI Manager is ended. However, the communication instance continues to exist on the side of the application (client). It keeps trying (cyclically) to register with the PVI Manager (server). If the registration is successful (e.g. network connection could be reestablished or PVI Manager 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 deregistered. These objects therefore have to be set up again by the PVICOM application after the communication connection is reestablished. The PVICOM interface uses global events (see also the PviSetGlobEventMsg or PviXSetGlobEventMsg function) to signal the application 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/server communication 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 exchanged using a shared memory area. Remote The PVI Manager and the PVICOM application can be located on separate computers. Data is exchanged over a TCP/IP network. The type of communication is defined by specifying the IP initialization parameter when the PviInitialize function is called. If the IP parameter is not specified, then the "local" communication type is used. The PVI Manager is also started automatically when the function is called using local communication (can be turned off with the AS initialization parameter). If the IP initialization parameter is specified, then the communication type is set to "remote" and client/server communication is handled over a TCP/IP network. The IP parameter specifies the IP address or the host name of the server computer (PVI Manager). The TCP/IP port number can be specified with the PN initialization parameter. If the host name of the server computer is specified, then the system must determine the corresponding IP address. The procedure is as follows:
18 1.5.2.1 Communication Instances

PVI base system

1. Host name of the local computer 2. Name entries in the HOSTS file 3. The DNS server is queried (if present) 4. NetBIOS With the local IP address "IP=127.0.0.1", communication can take place with a local PVI Manager even when the remote communication type is being used. However, since a local connection works faster than a remote connection, communication type "local" should always be used on a local PVI Manager. The following prerequisites are necessary for this communication type "remote": 1. Network connection between both controllers 2. TCP/IP protocol must be installed as network components on both controllers 3. A unique IP address must be specified on both computers 4. The Windows socket DLL wsock32.dll with a version >= 1.1 must be present on both computers 5. PVI must be installed on both computers, the same version if possible Basically however, only the communication library PviCom.dll and PviLog.dll are needed on the client computer (PVICOM application). 6. TCP/IP communication has to be enabled and an available port number assigned on the server computer (PVI Manager) using PVI Manager properties. No other TCP/IP server can use the same port number. The port number used here must also be set in the application with the PN initialization parameter. PVI Manager has to be restarted to apply any changes. 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 the connection 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 function PviSetGlobEventMsg or PviXSetGlobEventMsg. The following picture shows the basic sequence for global events.

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 the PVI Manager (server). POBJ_EVENT_PVI_DISCONN #241
1.5.3 Global Events 19

PVI base system

The connection between the communication instance (client) to the PVI Manager was interrupted (server). The corresponding error code is reported with the event data. The communication timeout plays the main role in recognizing the disruption in the client/server connection. The communication timeout is defined with the PviInitialize or PviXInitialize function. POBJ_EVENT_PVI_ARRANGE #242 This event signals that the communication instance has been newly registered with the PVI Manager. This event can only be triggered if there is a valid client/server connection. The global events POBJ_EVENT_PVI_CONNECT and POBJ_EVENT_PVI_DISCONN only signal the state of the client/server connection. In contrast, the POBJ_EVENT_PVI_ARRANGE event signals the application when link objects and temporary process objects have to be set up again. If there is a longer interruption in the client/server connection (doubled communication timeout), then the PVI Manager automatically deregisters the communication instance and releases all assigned link objects. If the connection is established later, then the PVICOM application has to set up all objects again. The POBJ_EVENT_PVI_ARRANGE event can be used to automatically control this procedure. As for object events, the PVICOM function PviReadResponse or PviXReadResponse has to be called to read event data and confirm when responses are received. Information about the event can be read beforehand with the PVICOM function PviGetResponseInfo or PviXGetResponseInfo. An exception is using the callback function of type PVICALLBACK_DATA as a user message. Since response data is passed along directly to the callback function, 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, the PVICOM application also has to assign an object name. Applications can then create link objects using the object 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 called external objects (e.g. PLC objects). A connection name is assigned to each service object. The connection name 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 same service object and all link objects with the same object name use the same process object. In this way, several process objects can be assigned to one service object, and several link objects can be assigned to one process object.

20

1.5.4 Objects

PVI base system

1.5.4.1 Process Objects Process objects are created with the PVICOM function PviCreateRequest or PviXCreateRequest. They are the central 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 or physical part of the communication connection or an object within the line or on the PLC. Object type Binary POBJ_PVI POBJ_LINE POBJ_DEVICE Description Usage

String #0 Pvi Base object PVI Manager base object #1 Line Line object Represents the PVI line being used (line server) #2 Device Device object Represents the physics of the network communication or a communication 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 (PLC object) POBJ_PVAR #7 Pvar Variable Represents a variable in a station, CPU, module, or task (PLC object task), or a PVIinternal variable

The order in which the object types are listed in the table corresponds to the object hierarchy. Starting from the PVI base object, each process object is assigned to another process object. However according to the object hierarchy, only objects with a higherlevel object type can be assigned. This means that a variable object can be assigned to all other process objects except a variable object. A line object can only be assigned to the PVI base object. These assignments lead to a tree structure with the PVI base object as the root. This process object tree is also called the object structure. An object name is assigned to each process object. The object path defines a process object contained within the object structure. The object name and names of the subordinate process objects are specified in the object path. Individual names are separated by a "/" character. Optionally, a process object type can also be specified to 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 Manager runtime. Applications don't need to set up or delete this object. The name of the base object is "Pvi".
1.5.4.1 Process Objects 21

PVI base system

The line object assigns a PVI line to a subset of the object structure. This automatically assigns all process objects to the line which are assigned to the line object. The object structure underneath the line object depends on 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 the line object and represent a component of the communication connection or an object in the line or on the PLC. A connection 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 have to be directly assigned to the PVI base object and have either no or an empty (null string) connection description. Because of this, a service object is also not assigned to an internal process object. All process objects in the object structure underneath an internal process object are also internal process objects automatically regardless of their connection description. Basically, process objects from each object type can be set as internal process objects. However, not all access types supported by the line can be used for internal process objects (e.g. upload, download, reading CPU status, 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 used as PVI constants or to exchange data between PVICOM applications. The DV parameter in the process object description 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 or POBJ_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 valid object identification is signaled by the PVI line. In the same way, an Error state signals a faulty PLC communication connection or an invalid object identification. The type of error is given by the error code. A process object's error state is passed down. In other words, all process objects in the object structure underneath the erroneous process object receive the same error condition. The RESP_STATUS_INHERIT_ERR flag is set with the POBJ_EVENT_ERROR object event in the status of the event 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 the process object with an enabled POBJ_EVENT_ERROR or POBJ_EVENT_DATA event, then the process object takes on an active state. Otherwise, it is inactive. Process objects with an active state are given priority when being identified by the PVI line. Active or inactive states control process data acquisition for variable objects. For inactive process objects, process data is not read and PLC communication is not burdened. PVICOM applications 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 the same 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. To establish a connection to a static process object, the PVICOM function PviLinkRequest or PviXLinkRequest has to be used. Static process objects remain throughout the entire runtime of PVI Manager. They also remain if the PVICOM application is ended. Error 12002 (Object name already exists) is reported if you try to create a process 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 configuration program. A temporary process object is always created together with a link object. The PVICOM function PviCreateRequest or PviXCreateRequest are used to do this. Unlike static process objects, calling the
22 1.5.4.1 Process Objects

PVI base system

PviLinkRequest function is not necessary. An error is not reported if you try to create a process object which already exists. Instead, a link object to the already existing process object is created. The process object description specified in the PviCreateRequest function is not applied in this case. Temporary process objects remain as long as one link object or one other process object is assigned to this process object. Releasing the last 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 (station objects, CPU objects) or for PLC object identification (module objects, task objects, variable objects). Depending on the line being used, this process can take some time to complete. If the process object is released and then freshly set up again, then this process has to be repeated. It is therefore an advantage if PVICOM applications only 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 PviCreateRequest or PviXCreateRequest. Releasing link objects takes place using the PVICOM function PviUnlinkRequest or PviXUnlinkRequest 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. The application then uses this link object to access process data, process object properties or states, or to carry out special 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 enabled POBJ_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 at runtime: 1. 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 is required that all process objects remain in use during runtime. Because of this, this method is primarily intended for static process objects. 2. 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 be activated (e.g. "EV=ed"). If the event data is no longer needed, then the enable mask needs to be deactivated "EV=". Since the link object remains in use, this method is especially suitable for temporary process objects. However, it can also be used for static process objects. 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 process object. Service objects are automatically managed by PVI Manager depending on the definition of the process object'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 the connection name as well as (usually) optional connection parameters. The connection name is the name of the service object being used in PVI Manager. The connection description is defined with the CD parameter in the process 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 PVI line. 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 a line object. The syntax of the connection description therefore depends on the line being used. Internal process objects either have no connection description or an empty connection description (null string) and are assigned directly to the PVI base object (process objects of type POBJ_PVI).
1.5.4.2 Link Objects 23

PVI base system

All ASCII characters except for the control characters (< code 32), the "/" character (slash), spaces, and the DEL character (code 127) can be used. If one of these prohibited characters is used in a name, then the name has to be surrounded by quotation marks ("...."). PVI then interprets all the characters between the quotation marks as the process object name. When specifying path names, note that syntactical characters ("/" or "@") and name parameters (OT parameter) are not a part of the actual process object name and therefore must remain outside of 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 process object 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. If additional process objects with unique object names have not been created, then the object path must always be 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, a variable object can be created under the "Task1" task object and a second variable object can be created with the same name under the "Task2" task object. A task object and a module object can also be created with the name 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 can differentiate between process objects which have the same name. The following object types can be specified: Object type Pvi Line Device Station Cpu Module Task Pvar Description PVI base object Line object Device object Station object CPU object Module object Task object Variable object

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 be created under the existing task object "Heater":
24 1.5.5.1 Object Names with Path Specification

PVI base system

Object Name: @Pvi/LNINA2 OT=Line/"DEVICE 1" OT=Device/CPU OT=Cpu/Heater OT=Task/HeaterTemp OT=Pvar Connection 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 same even 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 whole path 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 1 Connection 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 be created under the existing task object "Heater":
Object Name: HeaterTemp Connection description: CD=/Pvi/LNINA2/"DEVICE 1"/CPU/Heater/Temperature The 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 object description 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 as ASCII 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 blank space needs to be between individual parameter entries. The following table shows all parameters which can be defined in an object description. The "Obj." column indicates where (in which object description) the parameter can be specified. The letter "L" stands for the link object description and "P" stands for the process object description. Only the CD and EV parameters can be used for all process object types. All other parameters can only be defined in connection with link objects. The corresponding access type is indicated in the "Access type" column. Object properties can be set or modified at a later time using this access type. Par. Obj. Access types
1.5.5.2 Unique Object Names

Description
25

PVI base system

CD P

POBJ_ACC_CONNECT

EV C

POBJ_ACC_EVMASK

LT

AT P

POBJ_ACC_TYPE

RF P

POBJ_ACC_REFRESH

VT P+L POBJ_ACC_TYPE

VL P+L POBJ_ACC_TYPE

VN P+L POBJ_ACC_TYPE {...} P+L POBJ_ACC_TYPE

AL P+L POBJ_ACC_TYPE

CM P+L POBJ_ACC_TYPE

Connection description This parameter can be specified for all process object types (except for PVI base objects). 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 events Example: "EV=edfc" If no events should be enabled, then specify "EV=". Link type (see "Process Data Functions" section). Default: "LT=raw". "raw": Raw value "prc": Process value 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 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 Variable type (data format). Default in the process object: "VT=i32" "i8", "i16", "i32", "i64": 8 to 64bit signed integer "u8", "u16", "u32", "u64": 8 to 64bit unsigned integer "f32", "f64": 32/64bit floating point "boolean": Flag with element length of 1 byte "string": String with 8bit character size "struct": Structure "time": 32bit time in ms since midnight "dt": 32bit date and time in seconds since 1/1/1968 "data": General variable type with 1 byte element length Variable length in bytes (data format). This parameter can only be specified together with the VT parameter. For single variables, the variable length corresponds to the process data length. For array variables, the variable length is defined as the element length. This parameter does not need to be specified when used in conjunction with variable types which have a fixed variable length (e.g. VT=i32 always has a variable length of 4 bytes). Number of elements for array variables (data format). Default: VN=1. This parameter can only be specified together with the VT parameter. Definition of structure elements(data format) The definition of the structure element must be specified at the end of the object description. First the nesting depth is defined by a number of "."'s (periods) within each expression in parentheses. Then element variables are defined. 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. Mode for type casting (cast mode). Default: "CM=0". The mode is defined as a bit list and controls type casting between link and process objects. Bit 0: String variable for PG2000 or AS 1.3 Bit 1: String contents are interpreted as a decimal number Bit 2: Value range is monitored
1.5.5.2 Unique Object Names

26

PVI base system

Bit 3: Rounding takes place when type casting from a float to an integer Bit 4: Strings are always terminated with 0 (null). VA C Variable addressing. Default: No variable addressing Using variable addressing, link objects can address subsets from the process 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 process variable objects of type Integer, Floating Point, Boolean, or String. If this parameter is specified, then a data format also has to be defined in the object description. This default value is only written to the process image but is not transferred to the PLC. Examples: DV=123, DV=2.561e10, DV="string format" HY P+L POBJ_ACC_HYSTERESE Assigned event hysteresis. Default: No hysteresis Definition of event hysteresis for single variables or array variables of type Integer or Floating Point. Event hysteresis is specified as a hysteresis value. Examples: HY=10, HY=2.5 FS P+L POBJ_ACC_FUNCTION Assigned data function. Default: No function Definition of a data function for single variables or array variables of type Integer or Floating Point. The data function is specified as a function description. UT P POBJ_ACC_USERTAG With user tags, PVI applications can assign a private user code or specific user data to a process object (module, task, or variable object) in the form of a string. User tags are only managed by PVI, not evaluated.

1.5.7 User messages


PVI uses user messages to signal the existence of response or event data in the PVICOM communication instance to the PVI application. User messages can be controlled as a Windows message or as a callback function. Three different types of callback 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 the response function. Preferred variation for Visual C/C++ applications. Callback with data Signals using a callback function. Response or event data is transferred using the callback function. Preferred variation for Visual Basic applications. Callback without data Signals using a callback function. Response or event data is read using the response function. Asynchronous callback Signals using an asynchronous callback function. Response or event data is read using the response function. A PVICOM application can also use the different user message variants with one another. For example, event data can register to the application as a Windows message and response data as callback. A user message is defined using three parameters: 1. Message pointer/handle 2. Message number 3. Message parameter 1.5.7.1 User message operation If PVI Manager (server) sends response or event data to the PVICOM communication instance (client), then the data is stored in the client temporarily and the application is notified with a user message. The application must then react to the user message and call the corresponding PVICOM response function. Once that happens, the
1.5.7 User messages 27

PVI base system

data is read and the data memory area in the client is freed up. If the application "forgets" to call the response function, 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 are important for handling user messages in the PVICOM interface: 1. Initialization parameter LM (limit of PVICOM user messages) 2. "RetryTime" (retry type for PVICOM user messages) 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 they are distributed in time. A setting of "LM=100" means that the PVICOM sends a maximum of 100 user messages to the application. An additional user message is then only sent once the application has reacted to a user message which has already been sent and has called the corresponding PVICOM response function. With the setting "LM=1", each new user message is sent only when the previous user message has been processed. If the application "forgets" to call the response function, then an additional user message is not sent. This makes finding errors in a PVICOM application easier. For this reason, this is the setting used by default by the PVI interface. The disadvantage, however, is that user messages are delayed. Applications that can quickly and correctly process a user message (e.g. servers) should therefore have the limit disabled ("LM=0) or a higher limit 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 must therefore 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 message is not confirmed by calling the corresponding "Response" function, then the same user message is resent after the "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" so that the time sequence of response and event data can be adhered to. In principle, retrying user messages is only necessary when debugging Visual Basic applications (occurring with VB 5.0). If the application's execution is stopped by a breakpoint, then the callback function (user message) is not carried out. The user message therefore has to be resent 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 user message retries ("RetryTime=0"). The initialization parameter LM and the "RetryTime" parameter do not mean anything when using the callback function 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. The message number is defined as the window message number. A user parameter can be specified as a message parameter. This message parameter is not evaluated by the PVICOM interface but is passed through with the user 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 as follows: WinProc (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) Window procedure arguments: Argument nMsg wParam lParam Description Message number Reference to response or event data (for PVI response functions) Message parameter (4 bytes)

After the user message is received, the application can use the PviGetResponseInfo or PviXGetResponseInfo function to read information about the data assigned to the user message. The application receives the
28 1.5.7.2 User messages as window messages

PVI base system

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 or event data is not released. When possible, applications should use this variant for user messages. Applications in programming languages which 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's message handle. SET_PVICALLBACK_DATA (binary 0xfffffffe) must be specified as the message number. The message 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)

1.5.7.3 User messages as callback functions with data

29

PVI base system

Arguments of the callback function of type PVICALLBACK_DATA: Argument wParam lParam pData DataLen pInfo Description Always 0 (reserved for future expansions) Message parameter (4 bytes) Pointer to the response or event data. If NULL is transferred as a pointer, then no data exists. Length of response or event data in bytes Pointer to the RESPONSE_INFO structure for additional information

Response or event data is transferred directly to the callback function. Calling the corresponding response function is not necessary or even possible. Calling the callback function is handled within the PVICOM interface using the window procedure for an internal window. This allows the callback function to always be called in the context of the user thread. If an application is using asynchronous windows in different threads and the PVICOM functions in more than one of them, it can be determined where (in which thread context) the callback function is currently running. Asynchronous PVICOM functions are multithreadcapable. Calling these function is therefore not the problem; instead, it's accessing the internal application data buffer. In this case, the application has to be equipped with the appropriate mechanisms for access synchronization (e.g. critical sections). Within the callback function, unrestricted asynchronous PVICOM functions can be used, but synchronous PVICOM functions may not. In general, the callback function should be kept brief. Actions which may take longer 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); ... }

30

1.5.7.3 User messages as callback functions with data

PVI base system

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's message handle. SET_PVICALLBACK (binary 0xffffffff) must be specified as the message number. The message 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 to be read with PVICOM function, as with user messages as window messages. Example for Visual C++
#include <PviCom.h> #define PV_CNT 40 DWORD 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;
1.5.7.4 User messages as callback functions without data 31

PVI base system

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's message 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 functions of 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 but directly from the PVICOM thread of the communication instance. This means that the callback function call always takes place asynchronously to the user thread. The application itself must therefore provide the corresponding synchronization mechanisms. The callback function must be kept extremely short since data transfer (and therefore the lifesign monitoring of the PVICOM communication instance) is completely blocked during 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 and evaluate the user message in a separate thread. Under no circumstances may the PviInitialize, PviDeinitialize or any other synchronous PVICOM function be called within the callback function. Only PVICOM application which don't have processing routines for window messages (e.g. "windowless" servers) have to use this callback function variant. This callback function variant is not suitable for Visual Basic applications. 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)

32

1.5.7.5 User messages as asynchronous callback functions

PVI base system

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 type PVICALLBACK_ASYNC. The PVICOM function calls are carried out in the context of the user thread. Only the message 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 with the definition of a user message. After being processed by PVI Manager or the PVI line, the response is sent back and the assigned user message is executed. The response data is then read. The following picture shows the basic sequence.

1.5.8 Requests and Responses

33

PVI base system

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 carried out. The sequence in the picture assigns a PVI object to the request. This also applies in most cases. The only exceptions are requests for setting up and deleting PVI objects. In this case, the PVI object in the picture would be 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 used to read response data (e.g. PviLinkResponse, PviReadResponse, PviWriteResponse, etc.). An exception is using the callback function of type PVICALLBACK_DATA as a user message. Since response data is passed along 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 a request in PVI Manager or in the PVI line, then the response data includes the corresponding error code. If no errors 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 user message is specified when calling a request function ("hResMsg" argument not equal to zero), then a response is always sent to the application. If no user message is specified ("hResMsg" argument is zero), then a response is not sent to the application. Without a response, however, the application cannot determine whether the request 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. This cancel function can refer to either certain requests or all requests of a link object. For example, a timeintensive request (e.g. uploading or downloading modules) can be cancelled before it is completed. Error 12043 is reported in the response data of every cancelled request. The response data for a cancel request is always sent to 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 is always send to the application. There are only two situations where response data is not sent back for active requests: 1. When releasing a link object (PVICOM function PviUnlinkRequest / PviXUnlinkRequest or PviUnlinkAll), all requests assigned to it are cancelled and response data deleted. 2. When releasing a communication instance (PVICOM function PviDeinitialize or PviXDeinitialize), all
34 1.5.8.1 Sending Requests and Receiving Responses

PVI base system

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 data after the execution has been deleted. For example, a variable should be set back to 0 before the object is released. If the PviWriteRequest function is called directly before the PviUnlinkRequest function, then there is no guarantee that the write request is carried out. To ensure that the write request is executed, the PviUnlinkRequest 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 the interruption. If the interruption falls within the communication timeout period, then data transfer simply continues after the connection is reestablished. Unless there is a delay in processing the request, the PVICOM application doesn't notice the interruption. But if the interruption is longer than the communication timeout allows, then all outstanding 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 these requests are stored in the PVICOM communication instance, sent in blocks to PVI Manager and processed at the 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 very efficient since PVI components such as the PVICOM interface, PVI Manager, and the PVI line are used optimally 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 timeefficient way to do so would be to call the PVICOM function PviWriteRequest or PviXWriteRequest for all variable objects in a program loop. However, it should be noted that the order of calls does not have to match the order of the actual execution in PVI Manager and the response data being sent back. This also means that the order of PviWriteRequest calls and the order used to write data to PLC variables also do not have to match. This basically applies to all types of requests. Requests can be rearranged by PVI Manager of the PVI line to use time the most optimally when processing all outstanding requests. If several requests are directed to one process object, then the likely order of execution is also determined by the priority level of the request. Write requests to process data have the highest priority. Read requests to process data have an average priority. All other requests have the lowest priority. After a certain number of requests, a request with lower priority is executed 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 of calls corresponds to that of the execution. For example, a PVICOM application can assign the value 4 to a variable 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 priority levels of a process object, then the application may only send the next request once the response of the previous 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 process data, properties, states of process objects, and various services to be selected. Read requests are implemented with the PviReadRequest or PviXReadRequest function. The PviReadResponse or PviXReadResponse function is used to read response data. Write requests are implemented with the PviWriteRequest or PviXWriteRequest function. 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 and processed 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 are displayed in the "Par." column. The "Type" column lists which access types can be used with which process object types. Access types
1.5.8.2 Order of Request Execution

No.

Par. Type

Description
35

PVI base system

POBJ_ACC_OBJECT

#1

All

POBJ_ACC_VERSION

#2

Read access: Reads object type of the process object. The object type is returned in 4byte binary format (integer). Pvi Read access: Either the version of the PVI component Line or the version of the PLC object is read depending on Device the object type. This version information is returned in Station string format. Each version entry is terminated with a LF Cpu ("\n"). Module Task 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 Read access: Reads error code of the most recent error Write access: Definition of the enabling mask for the event 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 events Specifications here take place using string format. The sequence of letters doesn't really matter. If no events should be enabled, then specify an empty string. Read access: Reads the current setting Read access: List of all process objects which have been created in PVI Manager under this process object. This list is returned as a string. The list includes the PVI name and the type of process objects.

POBJ_ACC_ERROR POBJ_ACC_EVMASK

#3 #5 EV

All All

POBJ_ACC_LIST

#6

Pvi Line Device Station Cpu Module Task

POBJ_ACC_LIST_EXTERN

#7

Syntax of the process object list: <ObjectName> OT=<ObjectType> \t All object entries are separated by the \t character (tabulator). Pvi Read access: List of all process objects which can be Line created in PVI Manager under this process object. This Device list is returned as a string. The list includes the Station connection name and the type of process objects. Cpu Module Syntax of the process object list: Task <ConnectionName> OT=<ObjectType> \t All object entries are separated by the \t character (tabulator). Unlike POBJ_ACC_LIST, all process objects which can be created are shown in this list. This list is created by PVI Manager for process object types "Pvi" and "Line" and includes all lines or devices which were installed with PVI Setup. For all other process object types, this list is put together by the line being used. Which line for which process object type this access type supports can be found in the respective line description.

POBJ_ACC_CONNECT
36

#10

CD
1.5.8.2 Order of Request Execution

PVI base system

Line Device Station Cpu Module Task Pvar

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

POBJ_ACC_DATA POBJ_ACC_STATUS

#11 #12

POBJ_ACC_TYPE

#13

POBJ_ACC_TYPE_EXTERN

#14

AT VT CM AT VT RF

POBJ_ACC_REFRESH

#15

Read access: Reads the currently set connection description (string format). The object hierarchy is not listed when using unique object names. Pvar Write access / read access: Access to a variable object's data Cpu Write access / read access: Access to the status of a Module PLC object Task To delete a PLC module, carry out a write access with Pvar the string "LD=Delete". To delete PLC module reference data (only possible for BR log data modules), write access must be performed using the string "LD=Clear". Pvar Write access / read access: Reads and writes the object attributes property, the mode for type casting (cast mode) and/or data format of a variable object. Pvar Read access: Reads object attributes and data format as well as the name of the structure definition and elements of a PLC variable. 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 specified refresh rate Write access: Sets or modifies the refresh rate of the process object. The refresh rate is specified as a 4byte binary value (integer). Read access: Reads the currently set refresh time (4byte binary value) As with the HY parameter, event hysteresis is defined by a hysteresis value in string format. Unlike the object description however, the "HY=" parameter is left out here. Write access: Sets or modifies event hysteresis of the variable object (string format) Read access: Reads the currently set event hysteresis (string format) Read access: Reads the set default value (DV parameter) of the variable object. The value is returned in string format. As with the FS parameter, the data function is defined by a function description in string format. Unlike the object description however, the "FS=" parameter is left out here. Write access: Sets or modifies the data function of the variable object (string format)

POBJ_ACC_HYSTERESE

#16

HY

Pvar

POBJ_ACC_DEFAULT

#17

DV

Pvar

POBJ_ACC_FUNCTION

#18

FS

Pvar

1.5.8.2 Order of Request Execution

37

PVI base system

OBJ_ACC_UPLOAD

#20

POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME

#21 #22

Read access: Reads the currently set data function (string format) Module Read access:Reads BR module from PLC and saves it to a file The PVICOM function PviReadArgumentRequest or PviXReadArgumentRequest must be used for this access type. CPU Write access:Reads BR module from file and transfers it to PLC Pvi Reads and writes date and time. The data is transferred Cpu in binary form in the format of the "tm" structure. Date Module and time is defined as local time. Definition of the "tm" structure in C/C++ (32bit 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 of type CPU. This sets the data and time of the PLC. The last three structure elements are not evaluated. Read access: The mode of operation of the access depends on the process object type being used. With process object types Pvi or Cpu, current information about the date and time (local time zone) is read from the PC or PLC. With access via a process object of type Module, the date and time or creation or the last set date and time are read. Write access:Deletes specified data memory on the PLC The memory type is defined by the LD parameter in the description string. Syntax of the description string: LD=<MemoryType> <MemoryType>: Ram, SysRom, Rom, MemCard, FixRam, PerMem Read access: Reads information in string format about all existing PLC data memory. Syntax of the description string: { <Entry1> } { <Entry2> } ... { <EntryN> } Each <Entry> expression contains information for a certain 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)

POBJ_ACC_MEM_DELETE

#23

CPU

POBJ_ACC_MEM_INFO

#24

CPU

38

1.5.8.2 Order of Request Execution

PVI base system

POBJ_ACC_MOD_TYPE

#25

Example: "{ LD=Ram SL=65535 SF=16384 SB=4096 } { LD=FixRam ... }" Module Read access: Reads information about a module in string format. Syntax of the description string: MT=<ModuleType> ML=<ModuleLengthnge> [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 format The parameters DL and VI are only listed for BR log data modules. Module Read access: Reads a BR module from the PLC and transfers it to the application in the form of binary data. The PVICOM function PviReadArgumentRequest or PviXReadArgumentRequest must be used for this access type. CPU Write access:Transfers BR module from binary user data to PLC Module Read access: Reads reference data from a module. This access type can only be used in connection with BR log data modules. Pvi Read access: List of all list objects which can be created in PVI Manager under the PVI base object. This list is created by PVI Manager and includes all lines installed 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 Read access: List of all device object which can be created in PVI Manager under the line object. This list is created by PVI Manager and includes all device installed with PVI Setup for this line in string format.

POBJ_ACC_UPLOAD_STM

#26

POBJ_ACC_DOWNLOAD_STM #27 POBJ_ACC_MOD_DATA #28

POBJ_ACC_LIST_LINE

#30

POBJ_ACC_LIST_DEVICE

#31

Line

POBJ_ACC_LIST_STATION

#32

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 Line Read access: List of all station objects which can be Device created in PVI Manager under the corresponding process object. This list is created by the line being used. Which line for which process object type this access type supports can be found in the respective line description. Syntax of the station object list with station names specification: <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

1.5.8.2 Order of Request Execution

39

PVI base system

POBJ_ACC_LIST_CPU

#33

specification: <MinNumber> <MaxNumber> Line Read access: List of all CPU objects which can be Device created in PVI Manager under the corresponding Station process object. This list is created by the line being used. Which line for which process object type this access type supports can be found in the respective line description. 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 Line Read access: List of all module objects which can be Device created in PVI Manager under the corresponding Station process object. This list is created by the line being Cpu used. Which line for which process object type this access type supports can be found in the respective line description. Syntax of the module object list: <ModuleName1> \t <ModuleName2> ... All object entries are separated with the character \t (tabulator). <ModuleName>: Connection name (module object) Line Read access: List of all task objects which can be Device created in PVI Manager under the corresponding Station process object. This list is created by the line being Cpu used. Which line for which process object type this Module access type supports can be found in the respective line description. 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 Line Read access: List of all variable objects which can be Device created in PVI Manager under the corresponding Station process object. This list is created by the line being Cpu used. Which line for which process object type this Module access type supports can be found in the respective line Task description. 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 variable object <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 always local) <VariableType>: Specification of the data format of a variable on the PLC

POBJ_ACC_LIST_MODULE

#34

POBJ_ACC_LIST_TASK

#35

POBJ_ACC_LIST_PVAR

#36

40

1.5.8.2 Order of Request Execution

PVI base system

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 Write access: Cancels sent PVI request. Request data is made up of a 4byte integer value. A certain request or all requests can be cancelled depending on this integer value. =0: Cancel all requests. >0: Only cancel requests with the specified access type.

POBJ_ACC_CANCEL

#128

All

POBJ_ACC_USERTAG

#129

The POBJ_ACC_CANCEL write access and the request to be cancelled must be led via the same link object. See also the Request and Response section. UT Module With user tags, PVI applications can assign a private Task user code or specific user data to a process object Pvar (module, task, or variable object) in the form of a string (string terminated with 0) (see also event typePOBJ_EVENT_USERTAG). User tags are only managed by PVI, not evaluated. Write access / read access: Access to the user tag string Read access: Reads PVI Manager license information. License information is read in the format of the T_PVI_INFO_LICENCE structure. Read access: List of all clients logged onto the PVI Manager (module names of PVICOM applications). Syntax of the client list: <ClientModule1> \t <ClientModule2> ... All client entries are separated with the character \t (tab). Write access: Executes Snapshot function. When calling, the name of the snapshot file needs to be specified as a string. A path can also be specified. The Snapshot function writes a list of PVI objects (link objects, process objects, and service objects) along with their status and a list of all registered clients as text (ASCII) in the specified Snapshot file. The Snapshot function can be activated for any process object. Only the process object for which the Snapshot function was activated and all subordinate process objects (object hierarchy) 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 objects created underneath it are written to the Snapshot file. If information about all established objects in the PVI Manager should be written, then activation must take place using the global PVI object (base object "/Pvi"). All other functions in PVI Manager are blocked while the Snapshot function is carried out. This secures the consistency of the Snapshot data, but can also lead to immense timing variations when there are large

POBJ_ACC_INFO_LICENCE

#200

Pvi

POBJ_ACC_LIST_CLIENTS

#210

Pvi

POBJ_ACC_SNAPSHOT

#240

All

1.5.8.2 Order of Request Execution

41

PVI base system

quantities of data being handled by PVI Manager. Therefore, the Snapshot function should only be used sparingly. Read access: Path name of the last specified Snapshot file (string format). The POBJ_ACC_TYPE, POBJ_ACC_HYSTERESE and POBJ_ACC_FUNCTION can only be used to access the properties of the process object. They cannot be used to access the corresponding properties of the link object. 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 PLC then takes place when external variables are used. Termination of the write procedure is reported along with the response data. This also guarantees that the data has been transferred to the PLC. If the "h" object attribute is specified 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, it cannot 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 response data to the application. If the process data changes, then a POBJ_EVENT_DATA event is triggered along with the 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 status description in string format. Processing this status description is done in the line being used. Which line this access 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=Delete Deletes 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)

42

1.5.9.1 POBJ_ACC_DATA access type

PVI base system

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 type casting. This access type works with a description in string format. Like the object description, individual parameters 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 process object depending on the specifications in the description string. These properties can either be set individually or together with one another. For example, the "AT=r" string only sets the object attribute. Other properties remain unchanged. 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. Any attempt will be rejected with Error 12039. Read access: Reads the properties for object attribute, data format, and type casting mode set in the process object. 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 the object attribute and data format of a PLC variable. Processing the read request is done in the PVI line being used. 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 r w e Description Read access to the data in the variable is allowed Write access to the data in the variable is allowed PLC event control is possible for this variable

Still more information can be specified with the data format of the variable: Par. SN VO Pieces Description Name of the structure definition for structure variables Variable or structure element offset Element information used internally by the line

With structure variables, the names of structure elements can be specified with the description of their data format. {.<ElementName1>[.<ElementName2>] ... } Read access: Reads properties of object attributes and data format as well as the names of the structure definition and elements. Note: Access types POBJ_ACC_TYPE and POBJ_ACC_TYPE_EXTERN can also return different data formats. Note that only the POBJ_ACC_TYPE access type (or a POBJ_EVENT_DATAFORM event) can describe the format of 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 function PviReadArgumentRequest or PviXReadArgumentRequest needs to be used since the application also has to
1.5.9.3 POBJ_ACC_TYPE access type 43

PVI base system

define file names and module parameters with the read request. The application receives either a confirmation of the upload or an error with the response data (PviReadResponse or PviXReadResponse). An upload is always regulated via a PVI module object. The name of the module on the PLC is defined with the connection description of the process object. The module data is stored in the specified file with the POBJ_ACC_UPLOAD access type. Module data is transferred to the application with the response data as binary data with POBJ_ACC_UPLOAD_STM. In this case, 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 being read corresponds to the finished BR module on the PLC. If the module type is defined in the calling string (MT parameter specified), then the reference data is extracted from the specified BR module. The module data being read 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 being used. 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;

44

1.5.9.3 POBJ_ACC_TYPE access type

PVI base system

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 PVICOM function PviWriteRequest or PviXWriteRequest needs to be used. The application receives either a confirmation of the download or an error with the response data (PviWriteResponse or PviXWriteResponse). A download is always regulated via a PVI CPU object. Module data is read from the specified file with the POBJ_ACC_DOWNLOAD access type. The application must transfer the module data with the request data using POBJ_ACC_DOWNLOAD_STM. A data block must be created for this. This data block needs to include the calling string and the binary module data, and the request function (PviWriteRequest or PviXWriteRequest) must be transferred. The size of the data block in bytes is calculated from the length of the calling string + the size of the binary module data + 1. The calling string in ASCII format (character length is 1 byte) must always be at the beginning of the data block and terminated with a 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 needs to include a finished BR module. If the module type is defined in the calling string (MT parameter specified), then the module data is regarded as reference data from a BR module. PVI then generates a finished BR module from 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>]
1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types 45

PVI base system

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 PLC If this parameter is not specified, then the module name entered in the BR module is used. However, a module 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 being used. 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 mechanism Copy: Exchange is several cycles OneCycle: 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;
46 1.5.9.6 POBJ_ACC_DOWNLOAD and POBJ_ACC_DOWNLOAD_STM access types

PVI base system

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 with the PVICOM function PviReadArgumentRequest or PviXReadArgumentRequest. The argument parameters specified in the calling string define the log data to be read. If the read access should only be done with the default argument parameters, the PVICOM function PviReadRequest can also be used. The application receives either the requested log data or an error with the response data (PviReadResponse or PviXReadResponse). Each logbook entry in a BR log data module has a unique identification number (ID). The identification number is increased by one with each new log entry. Once the number counter is overrun, the identification numbers begin at zero again. If the identification number is used to find out a difference, this condition needs to be taken into consideration. Log entries can be read starting from a certain identification number or from the last (most current) logbook entry. The identification number of the most current log entry for a BR log data module can also be determined using the POBJ_ACC_STATUS access type or the POBJ_EVENT_STATUS event type.
1.5.9.7 POBJ_ACC_MOD_DATA access type 47

PVI base system

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 takes place 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. DN Description 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 general information about the logbook entry. Next comes the string with the message text (<ASCIILogData>) followed by a string with binary log data (<BinaryLogData>) in hex format. If there is no ASCII or binary log data, then an empty 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. TLEN BLEN TIME ID E INFO LEV TN Description Number of characters in the string for the message text (ASCII log data) without the null character. Number of characters in the string for the message text (ASCII log data) without the null character. Time stamp in seconds as a decimal number with decimal places. The number of positions after the decimal defines the resolution of the time stamp. Log entry identification number. Error number assigned to the log entry as a decimal number. Additional information as a decimal number. Level of the log entry as a decimal number. 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)
48 1.5.9.7 POBJ_ACC_MOD_DATA access type

PVI base system

{ 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,
1.5.9.7 POBJ_ACC_MOD_DATA access type 49

PVI base system

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 the PVI application. To receive object events, a PVI application must define a user message when creating the link object. Link objects are set up with the PVICOM functions PviCreateRequest / PviXCreateRequest or PviLinkRequest / PviXLinkRequest. The following picture shows the basic sequence for object events.

50

1.5.10 Object Events

PVI base system

All object events are guided with link objects. In addition to the user message, the link object also manages a release mask for events. The event mask is used to release or suppress certain event types. As with the user message, the release mask can be defined when setting up a link object. This is done with the EV parameter in the link object description. The release mask can also be modified at a later time with the POBJ_ACC_EVMASK access 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 when responses are received. Event information such as its type, length of the event data, and the RESPONSE_INFO structure can be read beforehand with the PviGetResponseInfo or PviXGetResponseInfo. One exception is using the callback function of type PVICALLBACK_DATA as a user message. Since response data is passed along 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 data is not transported and read by the PVI application with at least the same speed as which they occur, then event data piles up in memory until there is no more system memory available. Overwriting prevents everincreasing system memory needs. Only events from the same link object and event type are overwritten. The RESP_STATUS_OVERWRITE flag in the status of the event data (RESPONSE_INFO structure) is set if event data 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 types which 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 for enabling the event type (EV parameter). Event types POBJ_EVENT_ERROR POBJ_EVENT_CONNECT No. #3 #10 EV e c Description Signals a change in the error state or error code of a process object Signals a change in the connection description of a process object. The event data contains the connection description in the format of the POBJ_ACC_CONNECT access type. Signals a change in a variable object's process data or an end to a process object's error state
51

POBJ_EVENT_DATA

#11

1.5.11 Event types

PVI base system

POBJ_EVENT_STATUS

#12

POBJ_EVENT_DATAFORM POBJ_EVENT_PROCEEDING

#13 #128

f p

POBJ_EVENT_USERTAG

#129

(> 255)

Signals a status change in the process object. The event data contains the status in the format of the POBJ_ACC_STATUS access type. This event is generated by the line being used, not PVI Manager. Which line this status event supports can be found in the respective line description. Signals a change in a variable object's data format This event informs a PVICOM application about the progress of active requests. The POBJ_EVENT_PROCEEDING event is only sent to the application which made the request. This progress information is sent as a PROCEEDING_INFO structure. This event is generated by the line being used, not PVI Manager. Which line this progress event supports can be found in the respective line description. Signals a change in the user tag. The event data contains the user tag in string format (see also access type POBJ_ACC_USERTAG). Signals special line events. These events are generated by the line being used, not PVI Manager. Which PVI line these line events supports can be found in the respective line description.

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 given as a return value from the PviReadResponse or PviXReadResponse function. The end of the error state is signaled by error code 0 (zero). However, if the POBJ_EVENT_DATA event type is enabled, then the end of the error 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 in connection with other events or requests are reported with the corresponding event or response data and not by a 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 transferred as event data. The format of the data corresponds to the data format set in the process object. If a data format is defined 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 data length 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 in the variable object as well as overwriting POBJ_EVENT_DATA events. In this case, each individual POBJ_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 memory needs constantly increase. Therefore, the "d" attribute should be used with extreme care and only when absolutely necessary. The "d" attribute is intended e.g. for variables on the Direct CAN or MTC line if shortlived data changes in the PVI 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 shortlived data
52 1.5.11.1 POBJ_EVENT_ERROR Event Type

PVI base system

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 data cannot trigger this event. This event data contains a description of the data format in string format. Like the object description, individual parameters are differentiated in a string with parameter codes. The data format is defined 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 the process object with the POBJ_EVENT_DATA event. The POBJ_EVENT_DATAFORM event makes sure that the 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_DATAFORM event 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 this data, 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 data format property. The data format can be specified by the PVI application in the process object description when setting up the variable object. The POBJ_ACC_TYPE access type can be used to read or write the current setting for the data format property at runtime. You should be aware that the data format can be defined by the line being used for external variable objects. Which line defines the data formats of variables objects can be found in the corresponding section of PVI lines. A data format defined by the line can no longer be changed by the application. If a new process variable object is set up, then there is no process data present at first. Internal process objects do 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 can take a bit of time. The DV parameter can be used to provide variable objects with process data right when they are setup. However, this is only possible for single variables and Integer, Floating Point, Boolean, or String data formats. If the data format of variable objects is determined by the line, then the user does not have to specify a data format when creating the variable object. However, if the DV parameter is used, then a data format has to be defined in the process object description in this case. This data format is then overwritten later by the data format from the line. The application uses the link object to read and write data in the format of the variable object. A data format can also be defined in the link object though. In this case, data is read/written using the format of the link object. If the 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 be done by either reading cyclically or using event variables. The 'event variable' operating mode is selected with the object attribute 'e'. When reading cyclically, read requests are passed from the PVI Manager to the PVI line being used (line server). The line packs these instructions into a data frame and sends them to the connected PLC. It then sends the requested data back to the line in the form of a data frame. The line unpacks the data frame and passes the process data to the PVI Manager. The process data is then compared with the process image data of the respective variable object. When data changes, the process data is applied and a POBJ_EVENT_DATA event is triggered. This event is then sent to the appropriate PVICOM application via all assigned link objects with an enabled POBJ_EVENT_DATA event. For event variables, monitoring changes to the process data is carried out on the PLC (or in the line). Process data is only sent from the PLC to PVI if there are changes. Cyclic reading is omitted. When using this operating mode, data coming over the PLC communication connection can be considerably reduced. However, note that both the line server and PLC event variables must be supported.

1.5.11.3 POBJ_EVENT_DATAFORM Event Type

53

PVI base system

Basically, process data is only acquired from the line being used for process objects in an active state. In an inactive state, the process image is not updated for the affected variable. This also reduces data traffic with the PLC. Regardless of the type of data acquisition and the state (active or inactive), the application can also request data from external objects with a read instruction (access type POBJ_ACC_DATA). Data is read from the PLC and sent with the response data to the application. If process data is changed in the process image, then a POBJ_EVENT_DATA event (if enabled) is also triggered along with the response data via all existing link objects. When writing process data to an external variable object with access type POBJ_ACC_DATA, data is first written to the PLC. Once the write has been confirmed by the PLC, response data is sent to the application. If the 'r' object attribute is specified, then a read request is triggered for the affected object in connection with the write 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 to the data format has to always be carried out in both applications. In practice, this frequently leads to hidden errors. 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 the data format and output an error message if the format is not permitted, or it can manage the process data dynamically. Type conversion is another solution. During type conversion (cast function), a data format is predetermined by the PVICOM application. Process data in variable objects is then converted into the given data format when reading and writing, and vice versa. To be able to use type conversion, an application must define a data format when setting up a link object. Process data 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 combined as array variables or single variables. All other variable types cannot be combined. Error 12036 is reported when attempting to combine variable types not mentioned above.

54

1.5.12.1 Type casting

PVI base system

If a structure with structure elements is defined in the link object, then the number of structure elements must be identical with that of the process variable. The data in the individual structure elements is converted according to their data format. The same rules apply here as for single variables. In addition, structure data is oriented according 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 be used as well. If only the structure alignment should be set (AL parameter), but the format of the structure elements should be applied, then a structure without structure elements and variable length 0 (zero) need to be defined as the data format for the link object (data format "VT=struct VL=0"). This particular specification applies the structure elements from the data format of the variable objects. Together with a definition of the structure alignment (AL parameter) 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 works with structure alignment 4. Therefore, the size of the structure is 8 bytes in the application and 6 bytes in the PLC (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 end of 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:
1.5.12.1 Type casting 55

PVI base system

"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 a String ("VT=string") is type converted to type Boolean, than it will first be converted to an Integer before the value is checked as being unequal to zero. Data in floating point variables (f32, f64) can contain invalid values (infinity, notanumber) 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 i16 variable (2byte integer) should be type converted to an i8 (1byte integer). i8 variables can represent values from 128 to +127. The value "130" in the i16 variable is outside of the i8 value range and can therefore not be represented with the i8 variable. This causes a value range violation. Value range monitoring can be activated with 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 is truncated. 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 write instruction is not executed. Error 12014 is reported with the response data. The RESP_STATUS_CAST_OVERFLOW or RESP_STATUS_CAST_UNDERFLOW flag is 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 data format. This limit value can be read with the PVICOM function PviWriteResultResponse or PviXWriteResultResponse. If the value range is violated in the read direction (access type POBJ_ACC_DATA or event POBJ_EVENT_DATA), then the limit value is supplied with the response or event data. The limit value is the largest or smallest value which can be represented. The RESP_STATUS_CAST_OVERFLOW or RESP_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 occurs when 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=string VL=4". Type conversion modes of operation can be affected by the CM parameter. The parameter can be defined in the process object description for a process object and in the link object description for a link object. For type conversion, settings from both objects are always evaluated (OR function). The setting in the process object defines the mode of operation for all connections, while the specification in the link object only applies for that one 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 bits within the bit list. If a bit is set, then the corresponding function is activated: Bit
56

Value

Description
1.5.12.1 Type casting

PVI base system

#0

PG2000 or AS 1.3 string variable: If the variable object data format defines a i8 or u8 array (1 byte array), then the process data is regarded as a single variable of type String (VT=string) during type conversion. When reading the data format (access type POBJ_ACC_TYPE or 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 process object. If CM=1 is only specified in the link object, the corresponding type conversion is carried out, but the actual data format is returned when the data format is read. This conversion mode is intended for "old" PG2000 or AS 1.3 applications. New applications should not use this mode. Instead, a string variable should also be defined as a string variable in the PLC. Decimal mode: Defines how the string contents are interpreted when type converting from the String 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 interpreted in 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 always interpreted as decimal. Value range monitoring: If value range monitoring is enabled (CM=4), process data is checked whether it can be represented during type conversion. Value range violations are monitored. If one occurs, Error 12014 is reported when writing and the largest or smallest value that can be represented is returned when reading. 4/5 rounding mode: Determines how a Floating Point variable type should be converted to an Integer variable type. Without rounding mode, the positions to the right of the decimal point are simply truncated. (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 the decimal point are rounded. (Examples: 1.3 > 1, 15.5 > 16, 0.9999 > 1) Always terminating string variables with a binary 0 (zero): A string variable with a data format of "VT=string VL=4" can contain a maximum of 4 characters. If string data "abcd" is assigned, then there is no more room for zerotermination. If "zerotermination" mode is enabled, then the string variable will always be terminated with a binary 0 during type conversion. In the example above, the string variable would contain "abc" and a binary 0 would hold the fourth position.

#1

#2

#3

#4

16

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 read and 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 process data from the image is written to the PLC. When reading, this process is executed in reverse. The POBJ_EVENT_DATA event is only triggered when a change occurs in the subset.

1.5.12.2 Variable Addressing

57

PVI base system

Please note: When writing to a subset, all of the process data is always transferred to the PLC. If the process data is changed by the PLC from the time of the last read cycle up to the carrying out of the write instruction, then the data will be placed back to their old values by the write procedure. Therefore, variable addressing should be used either only in 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 variable addressing works via type conversion, a data format must be defined for the link object. Any application can set up several link objects to a variable object and divide process data into subsections using different variable addresses. Possible addressing types: Addressing Bit number Description Bit addressing: With bit addressing, an individual bit is defined an integer variable. In the link object, the data 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 must have variable type Integer (signed or unsigned). The bit number is specified with the VA parameter. 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 in the link object. Bit addressing is then carried out for each individual array. Array addressing: With array addressing, an individual element is defined an array variable. The element of the array variable may not be a structure. A data format for a single variable must be defined 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.

Array index

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: Object Attributes Refresh Time Data Format Object attributes control the approach when acquiring and handling process data of external variable objects. The refresh time determines how frequently the process data of external variable objects is updated. 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 define object attributes in the process object description with the AT parameter when creating a variable object. The POBJ_ACC_TYPE access type can be used to read or write the current setting for the object attribute property at runtime.

58

1.5.13 Process Data Properties

PVI base system

AT Description r Allows read access to the process data of a variable object. If this attribute is not specified, a read access attempt (POBJ_ACC_DATA access type) is rejected with Error 12035. In addition, PVI Manager doesn't carry 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 access attempt (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 in the 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 be accelerated with this (time between write request and write response). The write data is compared with the process image before the transfer to the PLC and, if there is a change, a POBJ_EVENT_DATA event is triggered via all existing link objects. d Direct event trigger for the POBJ_EVENT_DATA event. The "d" attribute is only effective in connection with the "e" attribute. A direct event trigger means that all process data returned by the line or PLC is sent directly 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. PVI attempts to acquire process data either through cyclic read accesses ("polling") or by using event variables (PLC event variables) within this time. The user can define the refresh time in the process object description (RF parameter) when creating a variable object. The POBJ_ACC_REFRESH access type can be used to read or write the current refresh time setting at runtime. Refresh Time 1 Description The behavior corresponds to that of an internal process variable. The data is not read automatically. However, the application can control data acquisition using targeted read tasks. Process data is only read once. Reading takes place after the line has initialized the variable object. As with RF = 1, the application can control further data acquisitioning using targeted read tasks. This setting can be used for constants for example. Behavior as with RF = 0, though the variable object is supplied with current process data in the specified refresh time (specified in ms). The refresh time should be set to correspond with the requirements of the process data (how current). Basic principle: the highest possible refresh rate.

Greater than 0

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 of type POBJ_PVAR). The user can define the process data format in the process object description when creating a variable object. The POBJ_ACC_TYPE access type can be used to read or write the current setting for the data format property at runtime. The user must always assign a data format to internal variable objects. For external 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 a data format. The user can assign a data format to each link object regardless of the data format in the variable object. This data format is defined in the link object description when creating a link object. If the data format is different for the 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 (VN parameter) is always 1. Structure variable Variable with variable type Structure. The number of array elements (VN parameter) is always 1. The elements in the structure can consist of single variables, additional structure variables, or array variables. Array variable Single variable or structure variable with more than one array element (VN parameter > 1).
1.5.13.2 Refresh Time 59

PVI base system

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, the variable 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 the nesting depth is defined by a number of "."'s (periods) within each expression in parentheses. Then element 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 always has a length of 4 bytes). If the variable length is specified however, it has to match with the length of the variable type. The length of the process data is calculated from the variable length multiplied with the number of elements (VL * VN). The process data length is the total length of the data of a variable object in the process image. This includes all filler bytes in structures. The following variable types can be specified with the VT parameter: Type i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 Description 8bit signed integer. Variable length: VL=1. Value range: 128 ... 127. 16bit signed integer. Variable length: VL=2. Value range: 32768 ... 32767. 32bit signed integer. Variable length: VL=4. Value range: 2147483648 ... 2147483647. 64bit signed integer. Variable length: VL=8. Value range: 9223372036854775808 ... 9223372036854775807. 8bit unsigned integer. Variable length: VL=1. Value range: 0 ... 255. 16bit unsigned integer. Variable length: VL=2. Value range: 0 ... 65535. 32bit unsigned integer. Variable length: VL=4. Value range: 0 ... 4294967295. 64bit unsigned integer. Variable length: VL=8. Value range: 0 ... 18446744073709551615. 32bit floating point (IEEE Float). Variable length: VL=4. Value range: 3.402823466e+38 ... 1.175494351e38 / +1.175494351e38 ... +3.402823466e+38. 64bit floating point (IEEE Float). Variable length: VL=8. Value range: 1.7976931348623158e+308 ... 2.2250738585072014e308 / +2.2250738585072014e308 ... +1.7976931348623158e+308. Bit variable (flag) mapped to 1 byte. Variable length: VL=1. TRUE = value other than 0, FALSE = value 0. String with 1byte character size and binary 0 termination (nullterminated). The length of the string buffer is defined with the variable length (VL parameter). The length of the string buffer is also the maximum string length. The actual string length is determined by the binary null character. When reading and writing process data with variable type String, note that data is only transferred up to and including the null character. All characters after the null character are undefined. Structure. The length of the structure can be defined either by specifying the structure elements or with the variable length (VL parameter). 32bit time difference in milliseconds. For clocks, this time difference refers to midnight. Variable length: VL=4. 32bit time and data in seconds since 1/1/1970. Variable length: VL=4. General data type. The length is defined with the variable length (VL parameter).

boolean string

struct time dt data

60

1.5.13.2 Refresh Time

PVI base system

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 16bit signed integer:
"VT=i16"

Example of an array variable with 8 elements and type 32bit 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 are not defined, then the variable length (VL parameter) has to be specified. If structure elements are defined, then the 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 is defined by a number of "."'s (periods) at the beginning of each expression in parentheses. The definition of the structure element also begins with a period. If a second structure is defined inside a structure, then the nesting depth is increased by one. Therefore, two periods have to specified when defining the elements of the second structure. 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;
1.5.13.2 Refresh Time 61

PVI base system

Structure alignment: If structure elements larger than one byte are addressed in a program, memory access by the processor can be accelerated by setting the structure elements to a data word limit. To do this, "filler bytes" are added to the respective 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 time Alignment = 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 the alignment 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 data for 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 changes greater than or equal to the specified hysteresis. The data function can be used to scale process values of monitor limit values.

Data Functions

Event hysteresis and the data function can be defined for link objects, process objects (variable objects), or for both. Defining for a link object is only possible however if a corresponding data format has also already been specified for the link object. Process data is divided into a raw value and a process value in the variable object (process object of type POBJ_PVAR). The raw value corresponds to the data of the external object (e.g. PLC variable). The process value refers to the data which is manipulated using the data function and event hysteresis. If no data function or event 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 type in 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 hysteresis defined 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:

62

1.5.14 Process Data Functions

PVI base system

The event hysteresis and data function defined in the process object is effective for all connected link objects with a process value link. The event hysteresis and data function defined in the link object is only effective for this link object. An application can also use both link types. In this case, only two link objects with different link types 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 hysteresis property can also be read or modified using the POBJ_ACC_HYSTERESE access type. Event hysteresis can only be applied for single variables or array variables and the data formats Integer (i8 ..., u8 ...) and Floating Point (f32 ...). Please note: The event hysteresis defined in the process object is only effective if the parameter "LT=prc" has been specified in 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 64bit floating point number (specify with decimal, valid value range: greater than 0.0). A value 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 greater than or equal to the specified hysteresis value. For array variables, the hysteresis filter is used for all array elements. 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 systemspecific value fluctuations (e.g. measurement value fluctuations on temperature sensors). The hysteresis filter in the link object can be used for userspecific 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. PVI Setup generates a key entry in the Windows registry with the function name for each installed data function. All
1.5.14.1 Event Hysteresis 63

PVI base system

entries are located under the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\PviFunc". Each function key includes entries for the name and path of the DLL as well as functionspecific parameters. A data function can be defined for variable objects (process objects of type POBJ_PVAR) and for link objects with the parameter FS in the object description. For process objects, the data function property can also be read or modified using the POBJ_ACC_FUNCTION access type. The data function can only be applied for single 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 systemspecific values into a standardized unit, whereas the data function in the link object can be used to further convert values to applicationspecific units. For example, the temperature value of a nonlinear temperature sensor is scaled in the variable object to the unit "degrees Celsius" and then converted to "degrees Fahrenheit" in the link object for display on the screen. Please note: The data function defined in the process object is only effective if the parameter "LT=prc" has been specified in the 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 data function "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 case sensitive. Function name LIN Short description Scaling function and limit monitoring 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 more points. The first and last points specified are used for limit monitoring. Limit monitoring can also be defined without 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 write instruction is not executed. Error 12014 is reported with the response data. The RESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW flag and the RESP_STATUS_LINK or 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's data format. This limit value can be read with the PVICOM function PviWriteResultResponse or PviXWriteResultResponse. If the limit value is exceeded in the read direction (access type POBJ_ACC_DATA or event POBJ_EVENT_DATA), then the limit value is returned with the response or event data. The RESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW flag and the RESP_STATUS_LINK or RESP_STATUS_POBJ flag are set in the status of the response or event data (RESPONSE_INFO structure). 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 or floating point format. Limit monitoring without scaling: Syntax:
64 1.5.14.2 Data Functions

PVI base system

FS=[LIN;]<Limit1>,<Limit2> The specified limits (<Limit 1> and <Limit 2>) define a valid value range for the process data. The valid range is tested 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 2 coordinates. The function calculation and monitoring of the valid value range takes place in the write and read directions (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 2 coordinates takes place using linear interpolation (linear function). The valid value range for limit monitoring is defined using the first (X1,Y1) and the last (Xn,Yn) coordinates. Function calculation and testing of the valid value 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.

1.5.14.2 Data Functions

65

PVI base system

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

1.5.15 PVICOM functions


Description Initializes the PVICOM interface and sets up the PVICOM communication instance Ends the communication connection to the PVI Manager and releases the PVICOM communication 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 link object PviCreateResponse Reads a response from a PviCreateRequest instruction. With this response, an ID is 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 the link 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 is assigned as a user message PviReadRequest Request for read access to an existing PVI object. The type of read access is determined with the access type. PviReadArgumentRequest Request for read access with argument data to an existing PVI object. The type of read access is determined with the access type. PviReadResponse Reads a PviReadRequest or PviReadArgumentRequest response or event data from a PVICOM event PviRead Synchronous variant of PviReadArgumentRequest / PviReadResponse functionality PviWriteRequest Request for write access to an existing PVI object. The type of write access is determined with the access type. PviWriteResponse Reads a PviWriteRequest response PviWriteResultResponse Reads a PviWriteRequest response with result data
66 1.5.15 PVICOM functions

Function PviInitialize PviDeinitialize

PVI base system

PviWrite PviGetResponseInfo PviGetVersion

Synchronous variant of PviWriteRequest / PviWriteResponse functionality Reads information about response or event data 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: 1. Functions with an instance handle ("PviX..."): The PVICOM interface must be initialized with the PviXInitialize function. Then only functions which begin with "PviX..." can be used. 2. 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. Functions which use instance handles allow several communication instances to be operated at one time. Each instance handle defines a communication instance which controls the client/server communication connection to the 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 one communication 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 should be 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 asynchronously and can therefore also be called asynchronous PVICOM functions. While a PVI request is being executed, the application can send another PVI request or handle other tasks. Synchronous PVICOM functions handle sending request data, waiting for the response, and reading the response data within a function. Since synchronous functions use asynchronous functions internally, they don't save any runtime. However, their use is substantially easier within a PVICOM application since the program doesn't have to worry about user messages and assigning requests and responses. In general, asynchronous and synchronous functions can also be mixed together. Note the following when using synchronous PVICOM functions: 1. Synchronous PVICOM functions are not multithreadcapable. That means that two synchronous functions may not be called from different threads at the same time. This also applies if the requests were given over different communication instances. 2. When the client/server connection is broken, the application stays in the PVICOM function until the communication timeout expires (see Communication instances). If the application is only using one thread, then the entire application cannot be operated during this time. 3. If a synchronous function is being run right then, then neither the assigned link object of the assigned communication instance can be freed up. 4. The RESPONSE_INFO structure cannot be read with synchronous functions. Please note: Synchronous functions should only be used in test programs, simple visualization applications, or small PVICOM applications like demo programs. If PVICOM functions need to be called from several threads, then you should only use asynchronous PVICOM functions. Using asynchronous PVICOM functions is recommended with the "remote" communication type or for highspeed applications. Please note: Handling exceptions (e.g. try/catch combination) in connection with PVICOM functions is not allowed. PVICOM functions come equipped with internal mechanisms for communication control and synchronizing access. If the sequence of these mechanisms is interrupted, then it can lead to undefined PVICOM behavior. An exception in a 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 for operation to go smoothly.
1.5.15.1 Functions with or without an instance handle 67

PVI base system

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 As Long) As Long PviXInitialize (ByRef phPvi As Long, ByVal Timeout As Long, ByVal RetryTime As Long, ByVal pInitParam As String, 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 ID To avoid problems with undefined instance handles, the instance handle should be preinitialized with 0 (zero) in the application. If the value is 0, PVICOM recognizes the instance handle as invalid and returns an appropriate error. Timeout In Communication timeout for the client/server (application/PVI Manager) communication in seconds The timeout also defines the time for the life sign monitor. An additional period is needed to detect a disruption in the client/server connection. To determine the total time where a communication disruption would be detected (at the latest), the timeout value specified here has to be doubled. If the timeout is 5, then an interruption in the connection can be detected in as early as 5 seconds and as late as 10 seconds. Connection interrupts are not recognized as such by the PVICOM interface if they occur within the timeout period. Data transfer simply continues once the connection is reestablished. Often used values are 3 10 seconds for local communication 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 User Message Operations section for more information about this parameter. Specification: 1 3600, <= 0 ... no retries (default setting) pInitParam In Pointer to a NULLterminated initialization parameter string. If no initialization parameters are needed, 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 an error, 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 PVICOM communication 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 PVI Manager (server) is opened. It should be noted, that client registration is only initiated. Therefore, returning from the function does not guarantee stable client/server communication. The PVICOM communication instance can signal the current status of the communication connection with the help of global events from the application. To do so however, the desired global event must be activated with the PviSetGlobEventMsg or PviXSetGlobEventMsg 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 new communication instance. This allows a PVICOM application to be able to communicate with several PVI Managers on different computers. If a communication instance is set up with PviXInitialize, then PVICOM functions must subsequently be called with an instance handle (PviX...). See also the Functions With or Without
68 1.5.15.3 PviInitialize, PviXInitialize Functions

PVI base system

an Instance Handle section. If the initialization function PviInitialize (or PviXInitialize) doesn't report an error, then sending requests can basically 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 AutoStart (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 an application 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 User Message 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 only intended for PVICOM applications which carry out particular tasks. Standard application do not need to be monitored 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 PVICOM communication. Either the TCP/IP address (e.g. "IP=10.43.50.62") or the host name ("IP=SystemPC1") of the server (PVI Manager) is specified with this parameter. If the host name is given, then the IP address assigned 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 PVI Manager 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;
1.5.15.3 PviInitialize, PviXInitialize Functions 69

PVI base system

// Free communication instance: Error = PviDeinitialize (); return (Error); }

Here, the application should communicate with two PVI Managers where the first PVI Manager is on the same computer 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

70

1.5.15.4 PviDeinitialize, PviXDeinitialize Functions

PVI base system

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 PVICOM communication instance. After the function is called, no user messages are sent to the application. Note, however, that window postmessages 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, LPARAM EventParam) 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 As Long,ByVal EventParam As Long) As Long PviXSetGlobEventMsg (ByVal hPvi As Long, ByVal nGlobEvent As Long, ByVal hEventMsg As Long, ByVal EventMsgNo 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 assigned POBJ_EVENT_PVI_CONNECT, POBJ_EVENT_PVI_DISCONN, or POBJ_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

1.5.15.4 PviDeinitialize, PviXDeinitialize Functions

71

PVI base system

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 or PviXDeinitialize 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 all events, 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 PVICOM function 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; ... }
72 1.5.15.5 PviSetGlobEventMsg, PviXSetGlobEventMsg functions

PVI base system

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, LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam) int PviXCreateRequest (DWORD hPvi, LPCSTR pObjectName, DWORD ObjectTyp, LPCSTR pObjektDescriptor, LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor, 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 As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long PviXCreateRequest (ByVal hPvi As Long, ByVal pObjectName As String, ByVal ObjectType As Long, ByVal pObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo 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.6.3 Arguments

Argument hPvi pObjectName ObjectType

I/O In In In

pObjectDescriptor In hEventMsg In

EventMsgNo

In

EventParam pLinkDescriptor

In In

Description Instance handle from the PviXInitialize function Pointer to the object name or object path name. Given as a nullterminated string. Object type specification POBJ_LINE, POBJ_DEVICE, POBJ_STATION, POBJ_CPU, POBJ_MODUL, POBJ_TASK, POBJ_PVAR If the object type is specified with the object name in pObjectName ("OT" parameter", then the object type given here is irrelevant. Pointer to the process object description. Given as a nullterminated string. Definition of the user message which is assigned to the link object for signaling object event data (events). If hEventMsg doesn't equal 0 (zero), then a temporary process object and a link object are set up. If hEventMsg equals 0 (zero), then a static process object without a link object is set up. 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). message parameter of the user message Pointer to the link object description. Given as a nullterminated string.
73

1.5.15.6 PviCreateRequest, PviXCreateRequest Functions

PVI base system

hResMsg

ResMsgNo ResParam

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 In Message number of the user message = 0 (Null): Same meaning as hResMsg=0. 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 only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 a temporary process object can be set up with a link object. The hEventMsg function parameter is used to select the type of the process object. Response data must be read with either the PviCreateResponse or PviXCreateResponse 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 already exists in PVI Manager which has the same name and same object type, Error 12002 (Object name already exists) is reported with the response. If there isn't such a process object, it will be set up as a static process object and set using the object parameters defined with pObjectDescriptor. The EventMsgNo, EventParam, and pLinkDescriptor 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 and a link object are set up. If there is already a process object (temporary or static) in PVI Manager with the same name and object type, then only a link object is set up for this process object and the pObjectDescriptor parameter becomes irrelevant. This corresponds to the way the PviLinkRequest function works. However, if no corresponding process object is present, then a temporary process object is set up and set using the object parameters defined with pObjectDescriptor. The object parameters defined with pLinkDescriptor are used when setting up the link object. The application receives 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) {


74 1.5.15.6 PviCreateRequest, PviXCreateRequest Functions

PVI base system

... 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++; ... }

1.5.15.6 PviCreateRequest, PviXCreateRequest Functions

75

PVI base system

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 hPvi wParam pLinkID

I/O In In Out

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must be specified. Pointer to the variable used to record the Link ID (only required if a link object was set up)

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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when the function is called (e.g. response data had been previously deleted), then Error 12055 (no response data present) 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 a valid 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 the PviCreateResponse 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, LPCSTR pObjektDescriptor, LPVOID hEventMsg, DWORD EventMsgNo, LPARAM EventParam, LPCSTR pLinkDescriptor)
1.5.15.8.2 Definition for Basic

PviCreate (ByRef pLinkID As Long, ByVal pObjectName As String, ByVal ObjectType As Long, ByVal pObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String) As Long PviXCreate (ByVal hPvi As Long, ByRef pLinkID As Long, ByVal pObjectName As String, ByVal ObjectType As Long, ByVal pObjectDescriptor As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal
76 1.5.15.7 PviCreateResponse, PviXCreateResponse Functions

PVI base system

EventParam As Long, ByVal pLinkDescriptor As String) As Long


1.5.15.8.3 Arguments

Argument hPvi pLinkID

I/O Description In Instance handle from the PviXInitialize function Out Pointer to the variable used to record the Link ID (only required if a link object was set up) pObjectName In Pointer to object names or object path names. Given as a nullterminated string. ObjectType In Object type specification POBJ_LINE, POBJ_DEVICE, POBJ_STATION, POBJ_CPU, POBJ_MODUL, POBJ_TASK, POBJ_PVAR If 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 nullterminated string. hEventMsg In Definition of the user message which is assigned to the link object for signaling object event data (events). If hEventMsg doesn't equal 0 (zero), then a temporary process object and a link object are set up. If hEventMsg equals 0 (zero), then a static process object 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 nullterminated 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager 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, ByVal ResParam As Long) As Long PviXDeleteRequest (ByVal hPvi As Long, ByVal pObjectName As String, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long
1.5.15.9.3 Arguments

Argument hPvi pObjectName hResMsg

I/O Description In Instance handle from the PviXInitialize function In Pointer to the object name or object path name. Given as a nullterminated string. In
77

1.5.15.8 PviCreate, PviXCreate Functions

PVI base system

ResMsgNo ResParam

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 In Message number of the user message = 0 (Null): Same meaning as hResMsg=0. 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 only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 the PviDeleteResponse or PviXDeleteResponse function unless using a callback function of type PVICALLBACK_DATA. This function is intended to delete static process objects. In principle, it is also possible to delete temporary process objects, but this is not necessary since deleting process objects takes place automatically when link objects are released. When a process object is deleted, all subordinate process objects (object hierarchy) are also deleted and all connected 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 hPvi wParam

I/O In In

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when the function is called (e.g. response data had been previously deleted), then Error 12055 (no response data present) is reported.
1.5.15.10.5 Description

This function is used to read the response from a request made by PviDeleteRequest or PviXDeleteRequest.

78

1.5.15.9 PviDeleteRequest, PviXDeleteRequest Functions

PVI base system

Please note: If a user message has been defined with the PviDeleteRequest or PviXDeleteRequest function call, then the PviDeleteResponse 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 nullterminated 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager 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, LPARAM EventParam, 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, LPARAM ResParam)
1.5.15.12.2 Definition for Basic

PviLinkRequest (ByVal pObjectName As String, ByVal hEventMsg As Long, ByVal EventMsgNo As Long, ByVal EventParam 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, ByVal EventMsgNo 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 hPvi pObjectName

I/O In In

Description Instance handle from the PviXInitialize function Pointer to the object name or object path name. Given as a nullterminated
79

1.5.15.11 PviDelete, PviXDelete Functions

PVI base system

hEventMsg

In

EventMsgNo

In

EventParam pLinkDescriptor hResMsg

In In In

ResMsgNo ResParam
1.5.15.12.4 Return Value

In In

string. Definition of the user message which is assigned to the link object for signaling object event data (events). 0 (zero) cannot be specified for this parameter. Message number of the user message = 0 (Null): No user message for event data is assigned to the link object In this case, any value other than zero can be specified for hEventMsg (e.g. PVI_HMSG_NIL). message parameter of the user message Pointer to the link object description. Given as a nullterminated string. 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 Message number of the user message = 0 (Null): Same meaning as hResMsg=0. message parameter of the user message

A value other than 0 signals an error. The error code is returned as a value. In principle, this function only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 the PviLinkResponse 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 application receives 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); }

80

1.5.15.12 PviLinkRequest, PviXLinkRequest Functions

PVI base system

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

1.5.15.13 PviLinkResponse, PviXLinkResponse Functions

81

PVI base system

1.5.15.13.3 Arguments

Argument hPvi wParam pLinkID

I/O In In Out

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must be specified. 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when the function is called (e.g. response data had been previously deleted), then Error 12055 (no response data present) 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 the Link ID. Please note: If a user message has been defined with the PviLinkRequest or PviXLinkRequest function call, then the PviLinkResponse 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, LPARAM EventParam, LPCSTR pLinkDescriptor) int PviXLink (DWORD hPvi, LPDWORD pLinkID, LPCSTR pObjectName, LPVOID hEventMsg, DWORD EventMsgNo, 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 EventMsgNo As 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 As Long, ByVal EventMsgNo As Long, ByVal EventParam As Long, ByVal pLinkDescriptor As String) As Long
1.5.15.14.3 Arguments

Argument hPvi pLinkID pObjectName hEventMsg EventMsgNo

I/O In Out In In In

EventParam In pLinkDescriptor In

Description Instance handle from the PviXInitialize function Pointer to variables used for recording the Link ID Pointer to object names or object path names. Given as a nullterminated string. Definition of the user message which is assigned to the link object for signaling object event data (events). 0 (zero) cannot be specified for this parameter. Message number of the user message = 0 (Null): No user message for event data is assigned to the link object In this case, any value other than zero can be specified for hEventMsg (e.g. PVI_HMSG_NIL). message parameter of the user message Pointer to the link object description. Given as a nullterminated string.

82

1.5.15.13 PviLinkResponse, PviXLinkResponse Functions

PVI base system

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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager 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, LPARAM ResParam)
1.5.15.15.2 Definition for Basic

PviUnlinkRequest (ByVal LinkID As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long PviXUnlinkRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, 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 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.15.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 the PviUnlinkResponse or PviXUnlinkResponse function unless using a callback function of type PVICALLBACK_DATA. If no additional link or process objects are assigned to a temporary process object, then the process object is also released. Once a link object is released, no more events are via this object. In addition, all requests and response data assigned to the link object are deleted. The corresponding user message are no longer executed.

1.5.15.14 PviLink, PviXLink Functions

83

PVI base system

Please note: The application can still receive user messages for response or event data until the response of the unlink request is received. If the PVICOM application should still receive the response data for all active requests when the link object is released, then the release procedure needs to be carried out in two steps: 1. Send write request with access type POBJ_ACC_CANCEL and value '0' (zero) to the link object. This cancels all active requests and carries out the user messages from them. Error 12043 is reported with the response data. 2. After receiving the response to the cancel request, send the request for releasing the link object. 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 hPvi wParam

I/O In In

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when the function is called (e.g. response data had been previously deleted), then Error 12055 (no response data present) 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 the PviUnlinkResponse 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
84 1.5.15.16 PviUnlinkResponse, PviXUnlinkResponse Functions

PVI base system

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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager 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 no longer be deleted (message queue). Error 12055 is returned if a PVICOM application responds to one of these user messages by calling a PVI response function (Pvi...Response or PviX...Response) or the PviGetResponseInfo or PviXGetResponseInfo function. The PVICOM application must therefore query for error 12055 and handle it accordingly. A better option is using the asynchronous functions PviUnlinkRequest / PviUnlinkResponse or PviXUnlinkRequest / PviXUnlinkResponse. This prevents the situation from happening since no additional user message exist for an object once the user message for the unlink response data has been 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, ByVal hResMsg 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, ByVal EventParam As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long
1.5.15.18.3 Arguments

I/O Description In Instance handle from the PviXInitialize function 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 (Requests and Responses) = 0 (Null): No response is sent by PVI Manager ResMsgNo In
1.5.15.17 PviUnlink, PviXUnlink functions 85

Argument hPvi LinkID

PVI base system

ResParam

Message number of the user message = 0 (Null): Same meaning as hResMsg=0. 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 only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 the PviChgLinkResponse or PviXChgLinkResponse function unless using a callback function of type PVICALLBACK_DATA. If a window message is used as a user message, then the message number (EventMsgNo) and the message parameter (EventParam) can be changed with PviChgLinkRequest. If using a callback function as a user message, only the message parameter can be changed (EventParam). Specifying the message number is irrelevant in this case. The POBJ_ACC_EVMASK access type is intended to enable or disable events. The PviChgLinkRequest should not 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 hPvi wParam

I/O In In

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout). If the reference specified in "wParam" is not valid when the function is called (e.g. response data had been previously deleted), then Error 12055 (no response data present) 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 the PviChgLinkResponse or PviXChgLinkResponse function must be called once the user message is received.
86 1.5.15.18 PviChgLinkRequest, PviXChgLinkRequest Functions

PVI base system

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 As Long) As Long
1.5.15.20.3 Arguments

Argument hPvi LinkID

I/O Description In Instance handle from the PviXInitialize function 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, any value 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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout).
1.5.15.20.5 Description

This function is the synchronous variant of the PviChgLinkRequest / PviChgLinkResponse or PviXChgLinkRequest / PviXChgLinkResponse functionality. See the Asynchronous and Synchronous Functions section. 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.

1.5.15.20 PviChgLink, PviXChgLink Functions

87

PVI base system

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 error occurs while carrying out the request or if the connection between the communication instance and PVI Manager 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 callback pointer specified in "hEventMsg" are compared with user messages to signal event data from all link objects in a communication instance. If they match, then the corresponding link object is released. In this way, all link objects assigned 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 to the link objects are cancelled and response data is deleted. The corresponding user message are no longer executed. The PviUnlinkAll and PviXUnlinkAll functions work synchronously. There is no asynchronous variant. See the Asynchronous 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, LPARAM ResParam) int PviXReadRequest (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID hResMsg, DWORD ResMsgNo, LPARAM ResParam)
1.5.15.22.2 Definition for Basic

PviReadRequest (ByVal LinkID As Long, ByVal nAccess As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long PviXReadRequest (ByVal hPvi As Long, ByVal LinkID As Long, ByVal nAccess As Long, ByVal hResMsg As Long, 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 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.22.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is reported only with the response data.

88

1.5.15.21 PviUnlinkAll, PviXUnlinkAll Functions

PVI base system

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 assigned process object. The link object is set using the LinkID function parameter. If a user message has been defined with the read request, it will be executed as soon as the PVICOM communication instance receives the response from PVI Manager. To read the response data, the application needs to call the PviReadResponse or PviXReadResponse 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 or PviXReadArgumentRequest 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, LONG ArgDataLen, 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, ByVal ArgDataLen 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, ByRef pArgData As Any, ByVal ArgDataLen As Long, ByVal hResMsg As Long, ByVal ResMsgNo As Long, ByVal ResParam As Long) As Long
1.5.15.23.3 Arguments

Argument hPvi LinkID

I/O Description In Instance handle from the PviXInitialize function 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 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.23.4 Return Value

A value other than 0 signals an error. The error code is returned as a value. In principle, this function only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 that argument 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 use this function.
1.5.15.22 PviReadRequest, PviXReadRequest Functions 89

PVI base system

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 As Long) As Long
1.5.15.24.3 Arguments

Argument hPvi wParam pData DataLen

I/O In In Out In

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must be specified. Pointer to the user data buffer used for recording the response or event data 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 when reading the response data to a read request if an error occurs when the request is executed, if the communication instance connection to PVI Manager is interrupted (communication timeout), or if there is an application error. The value '0' signals that the write request has been carried out and the response data in the user data buffer is valid. Unless there is an application error, an error can only be reported in connection with the POBJ_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 been previously 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 than the length actual data, then whatever space remains in the buffer will be filled with binary 0's (zero). If the length of user data buffer is smaller than the length of the data, then copying is stopped when the end of the buffer is reached. Any remaining response or event data is lost. To prevent this from happening, the PVI application has to set the dimensions of the user data buffer accordingly. To achieve this, the application can ask for the length of the response/event data with the PviGetResponseInfo or PviXGetResponseInfo function before this function is called. Please note: After receiving the user message in connection with a read request or an event, the PviReadResponse or PviXReadResponse must be called. However, this does not apply when using a callback function of type PVICALLBACK_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, LONG DataLen)

90

1.5.15.24 PviReadResponse, PviXReadResponse Functions

PVI base system

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, ByVal ArgDataLen As Long, ByRef pData As Any, ByVal DataLen As Long) As Long
1.5.15.25.3 Arguments

Argument hPvi LinkID

I/O Description In Instance handle from the PviXInitialize function 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 error occurs while carrying out the read request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout) or if an application error occurs. The value '0' signals that the read 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 or PviXReadArgumentRequest / PviXReadResponse functionality. See the Asynchronous and synchronous functions 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 As Long, 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) As Long
1.5.15.26.3 Arguments

Argument hPvi

I/O In

Description Instance handle from the PviXInitialize function


91

1.5.15.25 PviRead, PviXRead functions

PVI base system

LinkID nAccess pData DataLen hResMsg

In In In In In

ResMsgNo ResParam

In In

Link ID from the PviCreateResponse, PviLinkResponse, or PviXCreateResponse, PviXLinkResponse functions. Access type Pointer to write data Length of the write data in bytes = 0: No write data present. 0 (zero) may be specified for pData. 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 Message number of the user message = 0 (Null): Same meaning as hResMsg=0. 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 only reports Windows resource errors (e.g. not enough memory available) or user errors (e.g. illegal function parameters, incorrect function use, etc.). In this case, a request is not sent to PVI Manager and the defined response message is not executed. If an error occurs during data transfer or when handling the request, then it is 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 assigned process object. The link object is set using the LinkID function parameter. If a user message has been defined with the write request, it will be executed as soon as the PVICOM communication instance receives the response from PVI Manager. To read the response data, the application needs to call the PviWriteResponse or PviXWriteResponse 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 hPvi wParam

I/O In In

Description Instance handle from the PviXInitialize function Reference to the response data. The "wParam" parameter from the user message must 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 when reading the response data to a write request if an error occurs when the request is executed, if the communication instance connection to PVI Manager is interrupted (communication timeout), or if there is an application 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 been previously deleted), then Error 12055 (no response present) is reported.
92 1.5.15.26 PviWriteRequest, PviXWriteRequest Functions

PVI base system

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/PviXWriteResponse or PviWriteResultResponse/PviXWriteResultResponse function needs to be called. However, this does not apply 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) As Long PviXWriteResultResponse (ByVal hPvi As Long, ByVal wParam As Long, ByRef pRstData As Any, ByVal RstDataLen As Long) As Long
1.5.15.28.3 Arguments

Argument hPvi wParam

I/O Description In Instance handle from the PviXInitialize function In Reference to the response data. The "wParam" parameter from the user message must be specified. 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 when reading the response data to a write request if an error occurs when the request is executed, if the communication instance connection to PVI Manager is interrupted (communication timeout), or if there is an application 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 been previously 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 is that the PviWriteResultResponse or PviXWriteResultResponse function can be used to read result data of a write access. Please note: After receiving the user message in connection with a write request, the PviWriteResponse/PviXWriteResponse or PviWriteResultResponse/PviXWriteResultResponse function needs to be called. However, this does not apply 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, LONG RstDataLen)
1.5.15.27 PviWriteResponse, PviXWriteResponse Functions 93

PVI base system

int PviXWrite (DWORD hPvi, DWORD LinkID, DWORD nAccess, LPVOID pData, LONG DataLen, LPVOID pRstData, 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, ByRef pRstData 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, ByVal DataLen As Long, ByRef pRstData As Any, ByVal RstDataLen As Long) As Long
1.5.15.29.3 Arguments

Argument hPvi LinkID

I/O Description In Instance handle from the PviXInitialize function 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 error occurs while carrying out the write request or if the connection between the communication instance and PVI Manager is disrupted (communication timeout) or if an application error occurs. The value '0' signals that the write 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 pInfo As T_RESPONSE_INFO, ByVal InfoLen As Long) As Long PviXGetResponseInfo (ByVal hPvi As Long, ByVal wParam As Long, ByRef pParam As Long, ByRef pDataLen As Long, ByRef pInfo As T_RESPONSE_INFO, ByVal InfoLen As Long) As Long
1.5.15.30.3 Arguments

Argument hPvi wParam

I/O In In

Description Instance handle from the PviXInitialize function Pointer to response or event data. The "wParam" parameter from the user message must be specified.
1.5.15.29 PviWrite, PviXWrite functions

94

PVI base system

pParam pDataLen

Out Out

pInfo

Out

InfoLen

In

Pointer to the variable (4 bytes) for recording the user parameter. If the user parameter is not needed, then a null pointer can be specified. Pointer to a variable (4 bytes) for recording the length of the response or event data. 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 response data present. Pointer to a user buffer (T_RESPONSE_INFO structure) where additional information is copied. If additional information is not needed, then a null pointer can be specified. 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 errors which occur when it is called, such as user errors (e.g. illegal function parameters) or Error 12055 (no response data present). Errors which affect the request itself can only be read with the appropriate response function or from the RESPONSE_INFO structure.
1.5.15.30.5 Description

The application can use the PviGetResponseInfo or PviXGetResponseInfo function to read information about the response or event data after a user message is received. The function can only be executed before the corresponding response function is called. This function cannot be used in connection with synchronous functions. Calling this function is also not necessary when using a callback function of type PVICALLBACK_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 type POBJ_ACC_VERSION.

1.5.16 PVICOM Structures


Structure PROCEEDING_INFO RESPONSE_INFO Description Object events of event type POBJ_EVENT_PROCEEDING transfer event data using the format of the PROCEEDING_INFO structure. Information about event or response data is transferred using the format of the RESPONSE_INFO structure (see User Messages of type SET_PVICALLBACK_DATA and the PVICOM function PviGetResponseInfo).

1.5.15.30 PviGetResponseInfo, PviXGetResponseInfo Functions

95

PVI base system

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 nAccess Percent Info As End Type T_PROCEEDING_INFO As Long As Long String * 32

1.5.16.1.3 Elements

Element nAccess Percent Info

Description Access type of the running request Progress given in % (0 100) 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 Long End Type 1.5.16.2.3 Elements

Element Description LinkID Link ID nMode User message mode See following table nType Access type or event type If an event (nMode = POBJ_MODE_EVENT), then nType contains the type of event. If a response to a read or write request (nMode = POBJ_MODE_READ or nMode = POBJ_MODE_WRITE), then nType 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. The same error is reported as a return value when reading the response or event data with the corresponding "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 data See following table
96 1.5.16.1 PROCEEDING_INFO Structure

PVI base system

Definition of status flags (bits) in the "Status" element: Status flag RESP_STATUS_CAST_OVERFLOW RESP_STATUS_CAST_UNDERFLOW RESP_STATUS_OVERFLOW RESP_STATUS_UNDERFLOW RESP_STATUS_POBJ Description Upper range exceeded during type casting Lower range exceeded during type casting Upper limit value exceeded with the data function Lower limit value exceeded with the data function The limit value transgression (RESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW) occurred in the data function of the process object. #5 A limit value transgression (RESP_STATUS_OVERFLOW or RESP_STATUS_UNDERFLOW) occurred in the data function of the link object. #8 Error state was received from a higherlevel process object #9 Event data overwritten by more current data at least once. See the Object Events section. Bit #0 #1 #2 #3 #4

RESP_STATUS_LINK

RESP_STATUS_INHERIT_ERR RESP_STATUS_OVERWRITE

Definition for the mode of the user message in the "nMode" element: Mode POBJ_MODE_NULL POBJ_MODE_EVENT POBJ_MODE_READ POBJ_MODE_WRITE POBJ_MODE_CREATE POBJ_MODE_DELETE POBJ_MODE_LINK POBJ_MODE_CHGLINK POBJ_MODE_UNLINK No. #0 #1 #2 #3 #4 #5 #6 #7 #8 Description Undefined Global event or object event Response to a PviReadRequest or PviReadArgumentRequest request Response to a PviWriteRequest request Response to a PviCreateRequest request Response to a PviDeleteRequest request Response to a PviLinkRequest request Response to a PviChgLinkRequest request 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 is also responsible for communicating with B&R controllers (PLCs) and determines the communication protocol to be used to do so. PVI contains the following lines (line servers): Line name LNINA2 Name and usage 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 entry in 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 the name and path of the DLL as well as linespecific parameters.
1.6 PVI lines 97

PVI base system

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 specified in 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 only use 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 in quotation 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 INA2000 protocol. 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 Line object Device object Station object CPU object Usage INA2000 line Represents the communication device being used Can be specified, but not required Connection parameter Represents a PLC within a network or a routed PLC PLC name 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 Type Line Device Station CPU Connection "LNINA2" Device parameters

Allowed object structure for INA2000 process objects:

98

1.6.1 Line object

PVI base system

There is no limit to the number of process objects. Theoretically, any number of device objects can be assigned to 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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Type" column indicates which access types in the INA2000 line can be used with which process object types. Access types POBJ_ACC_VERSION Type Line Device Cpu Module Task POBJ_ACC_LIST_EXTERN Line POBJ_ACC_DATA Pvar POBJ_ACC_STATUS Cpu Module Task Pvar POBJ_ACC_TYPE_EXTERN Pvar POBJ_ACC_UPLOAD *) Module POBJ_ACC_DOWNLOAD *) CPU POBJ_ACC_DATE_TIME Cpu Module POBJ_ACC_MEM_DELETE CPU POBJ_ACC_MEM_INFO CPU POBJ_ACC_MOD_TYPE Module POBJ_ACC_UPLOAD_STM Module POBJ_ACC_DOWNLOAD_STM CPU POBJ_ACC_MOD_DATA Module Special Features Line object: Version of the line DLL Device object: Version of the INA frame DLL and device DLL CPU object: PLC operating system is read ("Vxxx"). Modules and task object: Module version is read ("x.xx"). List of all installed (PVI Setup) INA2000 devices

POBJ_EVENT_PROCEEDING supported POBJ_EVENT_PROCEEDING supported

POBJ_EVENT_PROCEEDING supported POBJ_EVENT_PROCEEDING supported Read reference data from BR log data objects. This access type is only supported beginning with PLC operating
99

1.6.2.2 INA2000 access types

PVI base system

POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR

CPU CPU CPU task

system V2.85 (SG4 Automation Runtime). Not supported Not supported Module objects on the PLC with a module path specification Task objects on the PLC with a module path specification CPU object: List of global variables Task object: List of local and global variables. The variable list contains additional information such as scope and variable type.

POBJ_ACC_CPU_INFO *) Translating BR modules 1.6.2.3 INA2000 events

CPU

The following table shows an overview of all event types which can be generated from a line. All event types which are not listed are generated by PVI Manager and therefore work independently of the line being used. Event types POBJ_EVENT_STATUS Special Features Support only for link node variables (process object type: Pvar) beginning with PLC 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, and POBJ_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 is checked every second by exchanging small data packets (ping/pong). General PC requirements: The INA2000 line can be operated on the following platforms: Windows platform Windows 9x/Me Windows NT/2000/XP Windows CE Limitations Only the B&R standard CAN card is supported. Only serial, CAN, and Ethernet communication are supported.

General PLC requirements: The INA2000 communication operates on a restricted basis (services) with PLC operating system 1.91. To use all the services (e.g. module upload, download, etc), PLC operating system 2.10 is required. If multimaster capability or a TCP/IP communication between PC and PLC is needed, PLC operating system 2.20 or higher must be used. For INA2000 event handling over the PLC (PLC monitors data changes), PLC operating system 2.24 or higher is needed.
100 1.6.2.3 INA2000 events

PVI base system

INA2000 requests are processed on the PLC during idle time. To ensure suitable response times, an idle time of 20% is a minimum requirement. If 20% idle time cannot be guaranteed for technical reasons, the response time increases 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 pointtopoint 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 to 255). 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 which Windows platforms. PLC requirements: To use INA2000 communication over CAN, CAN communication must be enabled in Automation Studio. See the Automation 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 Properties dialog 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 more network 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 the correct network card being found and used for communication purposes. Example:
Device parameters: /IF=tcpip /SA=1 CPU parameters /DA=13 /DAIP=172.43.70.13 IPAdr NW1: 172.43.71.12 Subnet Mask: 255.255.255.0 IPAdr NW2: 172.43.70.12 Subnet Mask: 255.255.255.0 IPAdr PLC: 172.43.70.13
1.6.2.4 INA2000 Communication 101

PVI base system

This would make sure that the second network card is used for PLC communication. If a DHCP server is configured for a network card, then it must be known which IP address and subnet masks the DHCP server specifies 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 pointtopoint connection. Modem features: Transparency: Standard Windows functions are used to access the modem. In other words, all modems that can be installed in Windows can be used. The user just needs to install the modem and doesn't need 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 to reestablish the connection in periodic intervals. The number of attempts as well as the intervals between attempts can be configured. Active connection: Windows establishes a dialup connection with a specified telephone number and transfers the protocol determined by the PVI line over this connection. Passive connection: Windows waits for an incoming call, answers automatically, and makes the connection. In this operating mode it is possible e.g. for a PLC itself to initiate the connection to a Windows computer with PVI. PC requirements: The PVI modem requires Microsoft TAPI version 2.0. This version is already installed in Windows NT 4.0. When using Windows 95, it is necessary to replace the standard TAPI Version 1.4 with a newer version. The current version 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 dialog box and its settings can be edited ("Properties"). The modem name shown in this dialog box corresponds to the modem 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 not supported by PVI! Settings for PLC Profibus cards (NW100 / NW150) and the PC card (5A1104.00090) can be taken from the PROFIBUS User's Manual (MASYS2PBE). PC requirements: Data transfer with the PC occurs using a 32kb DPR. An available address range must be set on the PC for this purpose. This is set with HEXswitches SW1 and SW2 on the Profibus card (SW1 = 0; SW2 = D). If only one Profibus card is used in the system, the jumpers BR1 and BR2 are left open. Additional information can be found 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 the IPC5000, either 32 bytes (1 Profibus card) or 64 bytes (two Profibus cards) must be excluded starting at the base address D000 under "PNP/PCI Configuration" in BIOS. PLC requirements: NW100 or NW150 with revision xx.05 or higher
102 1.6.2.4 INA2000 Communication

PVI base system

On the PLC, operating system V.2.00 or higher is necessary. The "FBPB.BR" module must be burned for INA2000 communication. The Profibus configuration module is already a component of the operating system and can be modified using suitable tools if necessary. To allow INA2000 communication via Profibus, the configuration for INA2000 Profibus communication must be updated 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. The corresponding 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 following communication 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 device parameters. Within the connection description, individual parameters are differentiated between using parameter identifiers. 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 communication device being used. Device names are not case sensitive, and at 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 /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's connection description.
1.6.2.4 INA2000 Communication 103

PVI base system

Par. Value Default Description /IF com1 ... None By default: COM1 to COM4. With some serial interface cards or adapters, it is possible to comX have more than COM4. Example: "/IF=com1" /BD 9600, 57600 Baud rate in bits per second 19200, Example: "/BD=38400" 38400, 57600, 115200 /RS 1, 0, 232 Sets the RS232 or RS422 protocol. RS485 is not supported by INA2000. 232, Example: "/RS=422" 422, 485 This parameter sets the flow control of the CTS (clear to send) and RTS (request to send) lines of the serial interface. Possible parameter values: = 1: PVI doesn't modify the current setting (see the interface device 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 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 control correctly. The parameter "/RS=0" must be specified to establish an RS232 connection using these adapters. Parity setting 0=NO PARITY 1=ODD PARITY 2=EVEN PARITY 3=MARK PARITY 4=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

/PA 0 4

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 the configurator shows all CAN devices which have already been set up. The device number must also be specified in the PVI device name. The CAN1 device corresponds to the PVI device name INACAN1. CAN2 corresponds to 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's connection description. Par. /IF Value inacan1 ... inacanX 0, 1 Default Description None CAN device. The device being used has to be entered in the device list of the B&R CAN device configurator. Example: "/IF=inacan1" 0 CAN controller number (channel). 2 CAN controllers are available on the LS172 card. The desired controller is selected with the /CNO parameter. No value other than 0 (zero) may be specified for the default CAN controller. Examples for LS172 card: CAN bus 1: "/IF=inacan2 /CNO=0"
1.6.2.5 INA2000 device objects

/CNO

104

PVI base system

/IT

0 60000, 0 0 = off

/BI

0 2047 / 1598 536870911 32 255 32

/MDA

/SA

1 /MDA

/BD

10000, 20000, 50000, 100000, 125000, 150000, 250000, 500000, 800000, 1000000 /CMODE 11, 29

*)

CAN bus 2: "/IF=inacan2 /CNO=1" Interval timeout (msec) Defines the maximum time which is to pass between two CAN messages when receiving or sending an INA frame. This parameter is used together with the /RT parameter 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 heavy interrupt loads on the PCs), but should be smaller than /RT. If quick detection of the broken connection is not required, monitoring interval timeouts does not need to be enabled (/IT=0). Example: "/IT=80" Base CAN ID for INA2000 communication Every station in the INA2000 network must have the same setting. Example: "/BI=1598" Number of maximum possible INA2000 stations (= highest station number) Every station in the INA2000 network must have the same setting. Example: "/MDA=50" Station number of the source station (separate station) The station number must be unique within the INA2000 network. Example: "/SA=3" Baud rate (data rate) on the CAN bus in bits per second. This parameter can also be specified in kBits per second. Every station in the INA2000 network must have the same setting. Example: "/BD=250000" or "/BD=250"

*)

/CT

>= 1, 0 = off

*)

/MC

>= 1

*)

CAN communication with 29bit identifiers (extended frames) or 11bit identifiers (standard frames). If 29bit CAN identifiers (extended frames) are used, then 11bit identifiers cannot be sent or received. Every station in the INA2000 network must have the same setting. Example: "/CMODE=29" Cycle time (in ms) within which the specified number (maximum) of CAN messages are sent (/MC parameter). Values < 20 ms don't make sense. Example: "/CT=20" Maximum number of CAN messages sent within the specified cycle time (/CT parameter). Example: "/MC=15"

*) The /BD, /CMODE, /CT, and /MC parameters can also be set using the B&R CAN device configurator. If these parameters are not specified in the connection description (the recommended method), then the values set in the configurator are used instead. If one of these parameters is specified in the connection description, 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 be restricted per cycle. This can reduce the load from the PC to the CAN bus. This could be important if other stations on the bus can only process a certain number of received CAN messages with the set baud rate, or if their interrupt load in general should be reduced. However, the disadvantage of limiting frames is slower CAN communication. Connection description example:
CD="/IF=inacan3 /CNO=1 /SA=3"

1.6.2.5 INA2000 device objects

105

PVI base system

1.6.2.5.3 Ethernet UDP device

The following table shows all parameters which can be defined for Ethernet UDP communication in the device object's connection description. Par. /IF Default Description None Ethernet UDP device Specification: "/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 used to introduce the value (e.g. "/LOPO=0x2b97"). A different default port number then only needs to be set if it is not 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 and 255 for SG4 targets. Example: "/SA=3" Value tcpip

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's connection description. Par. Value /IF modem1 ... modemX /MO Modem name Description Modem device Example: "/IF=modem1" None Name of the modem, as it appears in the Setup dialog box (Control Panel > Modems). The string must be enclosed in single quotation marks. If single quotes are to be used in the string, then the whole expression needs to be enclosed by another set of single quotes (e.g. m'56k is specified as /MO='m''56k' ). Example: "/MO='MicroLink 56k'" /TN Telephone None Telephone number. Telephone number to be dialed according number to the "ITUT Recommendation E.123" format, e.g. +43(7748)6586. The entire telephone number should always be specified (with country code). Conversions to the actual number are done automatically. This string must be written in single quotation marks. If a call is being waited for, an empty string should be entered (/TN=''). Example: "/TN='+43(7748)6586'" /MR 0 INFINITE INFINITE Maximum number of unsuccessful dialing attempts. Specifies how often it should be attempted to reestablish a broken connection. If "INFINITE" is specified, redialing continues indefinitely. A value 0 means that no attempts at redialing are made. 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 dialing attempt fails, then this time interval is always observed before another attempt is made. The /RI parameter is only relevant if /TN is not empty. Example: "/RI=120" /IT 0 60000 40
1.6.2.5 INA2000 device objects

Default None

106

PVI base system

Interval timeout (msec) Defined as the maximum time that can pass between receiving 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 where the data received is stored. The operating system stops reading if one of the following situations occurs: 1. The buffer is full. 2. A time span longer than the interval timeout has passed since the last character was received. Because of this, setting the /IT parameter for the interval timeout is extremely important. If the interval timeout is too small, INA2000 frames can be lost. This would cause the connection to be broken. If it is too big, data throughput is reduced because the interval timeout passes before the PC detects a received frame. The preset value of 40 ms has been selected due to measurements that show that a modem (using internal buffering) can insert 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 is poor (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 device object's connection description. Par. Value Default /IF pbusfdl1 ... None pbusfdlX /BA 0x00000 0xD0000 0xFFFFF Description Profibus device Example: "/IF=pbusfdl1" Base address of the DPR on the Profibus card. If the value is specified in Hexadecimal, 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 card *) Example: "/FF=nw.bin" /FC Path name nw_pb_32.br Path name of the network configuration file for the Profibus card *) Example: "/FC=nw_pb.br" /CB 1 255 2 Amount of communication buffers on the Profibus card Example: "/CB=4" /SA 0127 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 files must 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 by modifying 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's connection description.

1.6.2.5 INA2000 device objects

107

PVI base system

Par. Value Default Description /IF ls251_1 ... None LS251 device ls251_9 Example: "/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's connection description. Par. Value Default Description /IF ar000_1 None AR000 device Example: "/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 the communication connection. The following stations can be defined in the CPU object depending on the communication 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. The communication device being used is defined by the higherlevel device object. Within the connection description, individual parameters are differentiated between using parameter identifiers. These parameter identifiers 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 the communication device being used. At least one empty space is to be entered between the individual parameter specifications. 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's connection description. Par. Values /CN Path
108

Default Description None


1.6.2.5 INA2000 device objects

PVI base system

/SP Path name None

/RT 165535

275

Path specification for Routing Example: "/CN=IF3/IF2.7" Pathname of the working directory for storing temporary module information. Specifying a working directory speeds up the identification of variables. Example: "/SP=c:\Temp\" Response timeout in milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in 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's connection description. Par. Values /CN Path /SP Path name Default Description None Path specification for Routing Example: "/CN=IF3/IF2.7" 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\" 2 Station number of the target station. The station number must be unique within the INA2000 network. Example: "/DA=5" 275 Response timeout in milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in which an interrupted connection is detected is a result of the Response Timeout * 4. Example: "/RT=600" Rule of thumb for the RT setting for CAN: 275 ms * number of CAN stations + 100 ms Write request delay time in msec With a delay time for write requests, a defined delay must pass between receiving a message from a CAN station on the bus and sending the next message to this CAN station. Example: "/RW=30"

/DA 1 32 / 255

/RT 1 65535

/RW 1 10000 0=none

*)

*) The /RW parameter can also be set with the B&R CAN device configurator. If this parameter is not specified in the connection description, then the value set in the configurator is used. If this parameter is specified in the connection description, then the corresponding configurator setting is overwritten 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 CPU object's connection description. Par. /CN Values Path Default Description None
109

1.6.2.6 INA2000 CPU objects

PVI base system

/SP

Path name

None

/DA

1 99 / 255

/DAIP IP address Host name

None

Path specification for Routing Example: "/CN=IF3/IF2.7" Pathname of the working directory for storing temporary module information. Specifying a working directory speeds up the identification of variables. Example: "/SP=c:\Temp\" Station number of the target station. Automatic identification of the target station from the station number. The station number must be unique within the INA2000 network. The highest station number possible is 99 for SG3 targets and 255 for SG4 targets. Example: "/DA=56" IP address of the target station Manual identification of the target station from the IP address or identification from the host name (DNS, only possible for SG4). Examples: "/DAIP=68.10.10.27" ... IP address, "/DAIP=CP340su" ... Host name.

Specifying the /DA parameter depends on whether the /DAIP parameter is specified: If the /DAIP parameter is not specified, then the /DA parameter must always be specified. If the /DAIP parameter is specified as an IP address, the /DA parameters is optional. If /DA is specified, however, the defined station number must be correct. If the /DAIP parameter is specified as a host name, the /DA parameter is ignored. /RT 1 65535 275 Response timeout in milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in which an interrupted connection is detected is a result of the Response Timeout * 4. Example: "/RT=200" /REPO 1025 32767 11159 TCP/IP port number of the target station If the value is specified in Hexadecimal, then "0x" must be used to introduce the 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 (/DA parameter) 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 /DA parameter is used, then all PLC stations on the network must have their own unique station numbers (node switch setting or configured node number). When the connection is established, the INA2000 line checks whether the PLC station numbers are unique. If more than one PLC has the same station number in the network, 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 station is not possible. In this case, the target station muse be identified with the /DAIP parameter. If there are more than 99 or 255 PLC stations connected to the network, then the /DAIP parameter must also be used. Then all PLC stations can use the same node numbers. Connection description examples:
CD="/DA=5 /RT=200" CD="/DAIP=10.43.50.244 /RT=200"

110

1.6.2.6 INA2000 CPU objects

PVI base system

1.6.2.6.4 Modem station

The following table shows all parameters which can be defined for modem communication in the CPU object's connection description. Par. Values /CN Path Default Description None Path specification for Routing Example: "/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 milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in 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. For house internal communication, 350 ms is appropriate. A larger value must be used during longdistance telephone connections (especially satellite calls). Response timeout: The response timeout necessary can be calculated by adding up the following times. 1. 2 * transfer time when using a defined transfer rate between modems (or between the PC and modem should this be smaller) for 255 bytes 2. Signal runtime in both directions (significant during satellite communication or normal longdistance connections) 3. 2 * delay, which normally results in 80 ms (2 * 40 ms) 4. Reaction time of the opposite station (a maximum value of 20 msec can be assumed for a PLC) 5. When routing to the opposite station (path specification), 20 ms must be added for each path segment 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 CPU object's connection description. Par. Values /CN Path Default Description None Path specification for Routing Example: "/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 milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in which an interrupted connection is detected is a result of the Response Timeout * 4. Example: "/RT=300"

Connection description example:


1.6.2.6 INA2000 CPU objects 111

PVI base system

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's connection description. Par. Values /CN Path Default Description None Path specification for Routing Example: "/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 milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in 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's connection description. Par. Values /CN Path Default Description None Path specification for Routing Example: "/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 milliseconds If a response to a sent frame is not received with this time, then the frame is transferred again. After the third retry, the connection is deemed cancelled. The time in 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 station communication connection. These connections can also run via several PLC stations. Individual stations are defined in the routing path. The following graphic shows an example of a network configuration and corresponding PVI process objects:

112

1.6.2.6 INA2000 CPU objects

PVI base system

The PC is only serially connected to PLC 1. The PLC stations are connected via a CAN network one after the other. Communication to PLC 2 and PLC 3 take place via PLC 1. For this, the routing path must be specified in the 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> SS<Subslot> IF<Interface> <Address> Slot number: 0 (1) 15. Subslot number: 1 3. Interface number: 1 15. Station address: 1 ff (hexadecimal)

Routes to or via peripheral processors: CP PP<Slot> Main processor Peripheral process, slot number: 0 (1) 15.

If a peripheral processor should be routed to another peripheral processor, then the path specification must be conducted 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 station number 7 via IF2.
/CN=SL6.IF1
1.6.2.6 INA2000 CPU objects 113

PVI base system

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. The maximum configurable number of parallel connections is 16. Configuring parallel connections has an effect on the memory being used by the system. Memory is "given away" by configuring unnecessary parallel connections. The number of communication channels defines the number of "physical communication channels", so that for each open connection an entry is dynamically occupied and, additionally, an entry for the default configured "PG2000" connection is necessary. For this reason, the configured number must be at least one greater than the number of parallel connections. The following changes need to made in Sysconf: Number of parallel connections (sum from client and server connections) 1<= conn_cnt <= 16 5 + conn_cnt (+1 for each inserted PB card) LocIQDrv: 2 InaIQDrv: 2 + 2 * 2 * conn_cnt ==>(default+8) <= Semaphores <= (default+68) >=0x00014000

Communication

Connections Communication Channels

System

Semaphores Stack

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 in quotation 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>
114 1.6.2.7 INA2000 Module Objects

PVI base system

or <TaskName> If the task name is defined as the /RO parameter, the connection description must always be specified in quotation 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 different section. The INA2000 variable object represents a PLC variable. An INA2000 variable object can be created at two different positions in the PVI object structure. If the variable object is created under a CPU object, then a global PLC variable is addressed. If the variable object is created under an INA2000 task object, then a local PLC variable (task variable) is addressed. The name of the PLC variable must be specified in the connection description. Variable names are case sensitive. Please note: INA2000 can only address variable up to 64 KB in size. Variables bigger than 64 KB can only be used in connection with the extended BR module format. The extended BR module format is supported by PLC operating 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 the process data is already being carried out on the PLC. PVI Manager doesn't need to carry out any cyclic read requests. If the data in a PLC variables is not changed very often (at least not as often as the refresh time), then operating as a PLC event variable can reduce the data coming up in INA2000 communication. However, one disadvantage of this is an increased need for computing time on the PLC. It needs to be noted that specifying the refresh time (RF parameter) also has an effect on PLC event variables. Only single variables can be operated as PLC event variables. INA2000 only guarantees data consistency for single variables that are a maximum of 4 bytes in size. If the data from entire structures or fields should be transferred consistently, the user must implement corresponding measures (e.g. with handshake variables). Example: the data for a structure should be written on one side (e.g. PLC), and read and checked for consistency 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, the second counter (last element in the structure) is increased by 1 (add 1 to counter state) before writing the structure data. Then the structure data between the counters can be written. After the write procedure, the value of the second counter is transferred to the first counter (first element in the structure). On the PC, the states of the 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 variable or an element of the PLC variable. An alignment of 2 is used for structure variables on SG3 targets and an alignment of 4 on SG4 targets. Connection description syntax: Single variables, array variables, and structure variables: /RO=<variable_name> or <variable_name>
1.6.2.9 INA2000 variable objects 115

PVI base system

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 in quotation 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[15]

Elements 2 through 6 of an array variable are addressed. The data format in the process object corresponds to that 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" structurearray 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.

116

1.6.2.9 INA2000 variable objects

PVI base system

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 is carried 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 module during 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). The first three characters in the module type determine the translation library being used. This is loaded by the INA2000 line if need be. PVI Setup generates a key entry in the Windows registry for each installed translation library. All key entries are located under the registry key "...\Pvi\PviLine\LNINA2\BR_TypeTranslation". The name of the key corresponds to the first 3 characters of the module type. Each key contains entries for the path name 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. MT MV Description "MT=BRT" must be specified. When downloading, it is possible to specify the version number of the module.

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 NC_CNC NC_ZP0 NC_TDT NC_RPT NC_CAM NC_CAP Description CNC program Zero offset table Tool data table R parameter table Cam profile, definition using slave position(s) Cam profile, definition using polynomial(s)

Supported module types for module uploading (MT parameter): Module Type NC_xxx Description

1.6.2.10 Translating BR Modules

117

PVI base system

NC data object. When uploading the module, specifying "MT=NC_" is sufficient since the module type 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 node variables as it is with normal variables (PVs). For this reason, normal variables are the better choice for visualization tasks. Please note: Link node variables can only be used beginning with PLC operating system V2.80 (SG4 Automation Runtime). If the 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 global PLC variables, these variable objects must be set up under the CPU object. PVI can be used to access the producer, force, and consumer values of a link node. The following image shows the PVI "pickup" points within a link node for the producer, force, and consumer values.

Each of the three pickup points (producer, force, and consumer) are mapped in PVI using a separate variable object. Code letters in the variable object's connection description are used for differentiation. The producer and consumer values can only be read (readonly access). The force value can be both read and written. Link node variables cannot be used as PLC event variables. Otherwise, link node variables behave the same as normal variables (PLC PVs) in PVI. Connection description syntax: /RO=<code>+<link_node_name> or <code>+<link_node_name>

118

1.6.2.11 Link node variables

PVI base system

<code> P F C

Pickup point Producer value Force value 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' (1bit), 'B' (1byte), 'W' (2byte), 'D' (4byte) or 'L' (8byte) according to IEC IEC 611313. 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 as current as the data. Link node status syntax: ST=Lkn.<source> FC=<force> UL=<unresolved_link> [IO=<attribute>] Par. ST Description <source> is used to specify the source of the link node variable's data. "d" .. Default value, "p" .. Producer value, "f" .. Force value Specifying the source depends on the pickup point being used. <force> is used to specify the force state. 1 .. Force active, 0 .. Force inactive <unresolved_link> signals PV links to the link node. 1 .. At least one PV link present, 0 .. No PV links present <attribute> signals the type of I/O link. "r" .. Link with input, "w" .. Link with output If the IO parameter is not specified, there is no I/O link.

FC UL IO

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 the NET2000 protocol. The following topics are covered in this section: NET2000 process objects NET2000 access types NET2000 events NET2000 communication

1.6.2.11 Link node variables

119

PVI base system

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 a PLC. However, the connection is only established with the first variable object. Process objects in the NET2000 line: Name Line object Device object Station object CPU object Module object Task object Variable object Type Line Device Station CPU Module Task Pvar Connection "LNNET2" Device parameter Station number Usage NET2000 line Represents the communication device being used Represents a NET2000 station (PLC) in a network Can be specified, but not required Can be specified, but not required PLC task name Represents a task on the PLC 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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Type" column indicates which access types in the NET2000 line can be used with which process object types. Access types POBJ_ACC_VERSION Type Special features Line Line object: Version of the line DLL Device Device object: Version of the NET2000 state machine, INA frame DLL, and device DLL Line List of all installed (PVI Setup) NET2000 devices Pvar Not supported Pvar Not supported
1.6.3.1 NET2000 process objects

POBJ_ACC_LIST_EXTERN POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE_EXTERN POBJ_ACC_UPLOAD


120

PVI base system

POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE POBJ_ACC_UPLOAD_STM POBJ_ACC_DOWNLOAD_STM POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR POBJ_ACC_CPU_INFO 1.6.3.3 NET2000 events

Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported

The following table shows an overview of all event types which can be generated from a line. All event types which 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. A multimaster function is not possible via the NET2000 protocol. Identifying variables using NET2000 requests is carried out during the idle time by the PLC. NET2000 requests for reading and writing variable data are executed in a defined task class (NET2000.task_class). This enables the response time to be influenced by the selected task class. A NET2000 communication connection doesn't provide life sign monitoring. If the NET2000 line is not requesting any data from the PLC (e.g. if there are no active variable objects present), then the existence of the NET2000 communication connection cannot be monitored. General PC requirements: The NET2000 line can be operated on the following platforms: Windows platform Windows 9x/Me Windows NT/2000/XP Windows CE Limitations Only supports serial communication

General PLC requirements: PLC operating system V2.20 or higher is needed for NET2000 communication. In addition, a NET2000 slave driver is needed on the PLC (NET2000 library).

1.6.3.3 NET2000 events

121

PVI base system

1.6.3.4.1 Serial Communication

All necessary components are installed with PVI Setup. Serial communication can be operated as a pointtopoint connection (RS232/RS422) or as a network connection (RS485). PLC requirements: For RS485 operation, take note that active/passive switching of the RS485 interface can take up to 15msec in Windows NT and up to 10msec in Windows 95. This can cause a bus collision with a PLC response. Setting the idle time on the PLC can delay the response frame by the required time. The idle time is specified in characters when 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. Crosssection: min. 0.5 mm. Wave impedance: 120 ohms. Terminating resistance: 120 ohms on both ends. Length: maximum 1,200 meters. Maximum line resistance: 50 ohms per wire. The cabling for the RS485 network can only be made using a bus structure. The bus connection can be made either 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 pointtopoint connection. Modem features: Transparency: Standard Windows functions are used to access the modem. In other words, all modems that can be installed in Windows can be used. The user just needs to install the modem and doesn't need 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 to reestablish the connection in periodic intervals. The number of attempts as well as the intervals between attempts can be configured. Active connection: Windows establishes a dialup connection with a specified telephone number and transfers the protocol determined by the PVI line over this connection. Passive connection: Windows waits for an incoming call, answers automatically, and makes the connection. In this operating mode it is possible e.g. for a PLC itself to initiate the connection to a Windows computer with PVI. PC requirements: The PVI modem requires Microsoft TAPI version 2.0. This version is already installed in Windows NT 4.0. When using Windows 95, it is necessary to replace the standard TAPI Version 1.4 with a newer version. The current version 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 dialog box and its settings can be edited ("Properties"). The modem name shown in this dialog box corresponds to the modem 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).
122 1.6.3.4 NET2000 Communication

PVI base system

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. The corresponding 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 following communication 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 are defined in the connection description of the device object. Within the connection description, individual parameters are differentiated between using parameter identifiers. These parameter identifiers always begin with 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, and at 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 device object's connection description. Par. Value /IF com1 ... comX /BD 9600, 19200, 38400, 57600, 115200 /RS 1, 0, 232, 422, 485 Default Description None By default: COM1 to COM4. With some serial interface cards or adapters, it is possible to have more than COM4. Example: "/IF=com1" 57600 Baud rate in bits per second Example: "/BD=38400"

232

Sets the RS232, RS422, or RS485 protocol Example: "/RS=485" This parameter sets the flow control of the CTS (clear to send) and RTS (request to send) lines of the serial interface.
123

1.6.3.4 NET2000 Communication

PVI base system

Possible parameter values: = 1: PVI doesn't modify the current setting (see the interface device 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 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 control correctly. The parameter "/RS=0" must be specified to establish an RS232 connection using these adapters. Parity setting 0=NOPARITY 1=ODDPARITY 2=EVENPARITY 3=MARKPARITY 4=SPACEPARITY Default setting for NET2000 communication is "/PA=1". Interval timeout (msec) Defined as the maximum time that can pass between receiving two consecutive characters. The NET2000 protocol uses this time to recognize the end of a received frame. Example: "/IT=40"

/PA 0 4

/IT

0 60000 20

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 a higher overall transfer speed when compared with an RS485 network connection (one device object with n station objects). The reason for this is that only one PLC can be accessed at a time (request/response operation) over an RS485 network connection. Communication with RS232 single connections is carried out simultaneously. However, the disadvantage of RS232 single connections is the more complex hardware and wiring 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 device object's connection description. Par. Value /IF modem1 ... modemX /MO Modem name Default None None Description Modem device Example: "/IF=modem1" Name of the modem, as it appears in the Setup dialog box (Control Panel > Modems). The string must be enclosed in single quotation marks. If single quotes are to be used in the string, then the whole expression needs to be enclosed by another set of single quotes (e.g. m'56k is specified as /MO='m''56k' ). Example: "/MO='MicroLink 56k'" Telephone number. Telephone number to be dialed according to the "ITUT Recommendation E.123" format, e.g. +43(7748)6586. The entire telephone number should always be specified (with country code). Conversions to the actual number are done automatically. This string must be written in
1.6.3.5 NET2000 device objects

/TN Telephone number

None

124

PVI base system

single quotation marks. If a call is being waited for, an empty string should be entered (/TN=''). Example: "/TN='+43(7748)6586'" /MR 0 INFINITE INFINITE Maximum number of unsuccessful dialing attempts. Specifies how often it should be attempted to reestablish a broken connection. If "INFINITE" is specified, redialing continues indefinitely. A value 0 means that no attempts at redialing are made. 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 dialing attempt fails, then this time interval is always observed before another attempt is made. The Parameter /RI is only relevant when /TN is not empty. Example: "/RI=120" /IT 0 60000 40 Interval timeout (msec) Defined as the maximum time that can pass between receiving two consecutive characters. The NET2000 protocol uses 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 where the data received is stored. The operating system stops reading if one of the following situations occurs: 1. The buffer is full. 2. A time span longer than the interval timeout has passed since the last character was received. Because of this, setting the /IT parameter for the interval timeout is extremely important. If the interval timeout is too small, NET2000 frames can be lost. This would cause the connection to be broken. If it is too big, data throughput is reduced because the interval timeout passes before the PC detects a received frame. The preset value of 40 ms has been selected due to measurements that show that a modem (using internal buffering) can insert 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 is poor (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 device object's connection description. Par. Value Default Description /IF ls251_1 ... None LS251 device ls251_9 Example: "/IF=ls251_1" For additional parameters, see NET2000 protocol parameters. Connection description example:
CD="/IF=ls251_1"

1.6.3.5 NET2000 device objects

125

PVI base system

1.6.3.5.4 NET2000 protocol parameters

The following table shows the adjustable NET2000 protocol parameters for the device object. Par. Value /SA 1 254 Default Description 1 Node number for the NET2000 master Example: "/SA=2" /RC 0 255, 3 Retry counter for errors 0 = none Example: "/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 error situation is corrected. For certain system configurations, it is possible that the error status is desired. For example, a PVI application (e.g. visualization) can use variables which will only be created on the PLC in a later system expansion. In this case, the identification of these variables would be repeated continuously and greatly slow down NET2000 communication. Make sure that the PLC identification requests are handled in the idle time. If there is not very much idle time available on the PLC, this will cause additional delays in the NET2000 protocol. The "/SR" parameter can help. With this parameter, identification retries can be suppressed for certain errors. "/SR=0" "/SR=1" "/SR=2" "/SR=3" No suppression (default setting) Suppresses error 12601 (variable does not exist on the PLC) Suppresses all errors from the PLC (12600 to 12699) 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 by temporary disturbances on the cable connection. If an error occurs with "/SR" selected, PVI switches the corresponding process object to a continuous error status. This can only be corrected by changing the connection description (CD=...) or by deleting and recreating 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 the communication parameters. The parameters for baud rate (/BD parameter) and timeouts (/TE and /TT parameters) are then trimmed. The following basic rule applies: Highest possible baud rate, lowest possible timeout 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 a higher value when the communication can function without disturbances. The /TE parameter is only effective when identifying variables (initialization phase) and reading external data types. Variable identification is carried out on the PLC during idle time. As a result, it is important to ensure that there 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 not executed during idle time, but in a defined task class (NET2000.task_class). In this way, response time can be influenced 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"
126 1.6.3.5 NET2000 device objects

PVI base system

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 through 254 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 in quotation 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 in quotation 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 two different positions in the PVI object structure. If the variable object is created under a station object, then a global PLC variable is addressed. If the variable object is created under an NET2000 task object, then a local PLC 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.

1.6.3.6 NET2000 Station Objects

127

PVI base system

The NET2000 line supports PLC event variables (see also the AT parameter). Monitoring for changes in the process data is already being carried out on the PLC. PVI Manager doesn't need to carry out any cyclic read requests. If the data in a PLC variables is not changed very often (at least not as often as the refresh time), then operating as a PLC event variable can reduce the data coming up in NET2000 communication. However, one disadvantage of this is an increased need for computing time on the PLC. It needs to be noted that specifying the refresh time (RF parameter) also has an effect on PLC event variables. Only single variables can be operated as event variables. Please note: Sine NET2000 can only transfer data from PLC event variables with read or write requests, pay attention that at least one variable is read cyclically (polled) per station. A refresh rate should be defined for these variables which 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 variable or 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 in quotation 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"

128

1.6.3.6 NET2000 Station Objects

PVI base system

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&R MULTI/MIDI/MINI and compact (SG2) controllers. In principle, it is also possible to communication with SG3 and SG4 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 a MININET station. Process objects of the MININET line: Name Line object Device object Station object CPU object Module object Task object Variable object Type Line Device Station CPU Module Task Pvar Connection "LNMINI" Device parameter Station number Usage MININET line Represents the communication device being used Represents a MININET station (PLC) in a network Can be specified, but not required Can be specified, but not required Can be specified, but not required Represents a variable on the PLC

Variable name

Object structure for MININET process objects:

1.6.4 MININET line

129

PVI base system

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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Access type" column indicates which access types in the MININET line can be used with which process object types. Access types POBJ_ACC_VERSION POBJ_ACC_LIST_EXTERN POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE_EXTERN POBJ_ACC_UPLOAD POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE POBJ_ACC_UPLOAD_STM POBJ_ACC_DOWNLOAD_STM POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR POBJ_ACC_CPU_INFO 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 types which 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 a pointtopoint 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. A multimaster 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 Windows 9x/Me Windows NT/2000/XP Windows CE
130

Type Line Device Line Pvar

Special features Line object: Version of the line DLL Device object: Version of the INA frame DLL List of all installed MININET devices Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported

Limitations Not possible


1.6.4.2 MININET access types

PVI base system

Requirements for SG2 controllers (MULTI/MIDI/MINI and Compact): B&R standard software (model number: SWSPSCOM010 for 3.5") Function blocks: PLC mode DFMN.MSL DPMN.PRG DTMN.TAB NDSA.MSL NDSB.MSL NDSC.MSL NDSD.MSL NDSE.MSL NPLS.MSL MDSA.MSL MDSB.MSL MDSC.MSL NETWORK ADAPTER MININET V0.01 Mininet Driver NP02 / PP40 Configuration Table for DFMN MININET SLAVE DRIVER A V2.40 MININET SLAVE DRIVER B V2.15 MININET SLAVE DRIVER C V2.40 MININET SLAVE DRIVER D V0.00 MININET SLAVE DRIVER E V0.00 MININET SLAVE PLC V2.04 MININET/PLC SLAVE A V2.30 MININET/PLC SLAVE B V2.15 MININET/PLC SLAVE C V2.50 SPOIO mode NDSA.MSL NDSB.MSL NDSC.MSL NDSD.MSL NDSE.MSL NSPO.MSL MSSA.MSL MSSB.MSL MSSC.MSL MININET SLAVE DRIVER A V2.40 MININET SLAVE DRIVER B V2.15 MININET SLAVE DRIVER C V2.40 MININET SLAVE DRIVER D V0.00 MININET SLAVE DRIVER E V0.00 MININET SLAVE SPOIO PLC V2.04 MININET/SPOIO SLAVE A V2.41 MININET/SPOIO SLAVE B V2.21 MININET/SPOIO SLAVE C V2.60 PIFA/PIF1/PIF3 PP40/CP31/.. CP63/CP80/PP60 =NDSA + NSPO =NDSB + NSPO =NDSC + NSPO 7200 19200 19200 PIFA/PIF1/PIF3 PP40/CP31/.. CP63/CP80/PP60 Hardware PIFA/PIF1/PIF3 PP40/CP31/.. CP63/CP80/PP60 PRTS without FIFO PRTS with FIFO =NDSA + NPLS =NDSB + NPLS =NDSC + NPLS 7200 19200 19200 Max. Baud Rate 7200 19200 19200 19200 19200 PIFA/PIF1/PIF3 PP40/CP31/.. CP63/CP80/PP60 PRTS without FIFO PRTS with FIFO 7200 19200 19200 19200 19200 Network p. NP02 19200 Hardware Max. baud rate

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. Crosssection: min. 0.5 mm. Wave impedance: 120 ohms. Terminating resistance: 120 ohms on both ends. Length: maximum 1,200 meters. Maximum line resistance: 50 ohms per wire.

1.6.4.2 MININET access types

131

PVI base system

The cabling for the RS485 network can only be made using a bus structure. The bus connection can be made either 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 communication device with the necessary device parameters and MININET protocol parameters are defined in the connection description of the device object. Within the connection description, individual parameters are differentiated between 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 parameter specification. 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. /IF Value com1 ... comX 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200 1, 0, 232, 422, 485 Default Description None By default: COM1 to COM4. With some serial interface cards or adapters, it is possible to have more than COM4. Example: "/IF=com1" 57600 Baud rate in bits per second Example: "/BD=19200"

/BD

/RS

232

Sets the RS232 or RS422 protocol. Example: "/RS=485" This parameter sets the flow control of the CTS (clear to send) and RTS (request to send) lines of the serial interface. Possible parameter values: = 1: PVI doesn't modify the current setting (see the interface device 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 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 control correctly. The parameter "/RS=0" must be specified to establish an RS232 connection using these adapters. Parity setting 0=NOPARITY 1=ODDPARITY 2=EVENPARITY 3=MARKPARITY 4=SPACEPARITY Default setting for MININET communication is "/PA=0". Interval timeout (msec) Defined as the maximum time that can pass between receiving two
1.6.4.5 MININET device objects

/PA

04

/IT

0 60000 20

132

PVI base system

/TT

0 60000 3000

/RETRY 1 255

consecutive characters. The MININET protocol uses this time to recognize the end of a received frame. Example: "/IT=40" Timeout for requests (ms) This value must correspond at least to the maximum response time of the controller + the transfer time of 256 characters (depends on the baud rate). Example: "/TT=512" Retry counter for errors After a request is sent, a valid response must be received with the time /TT. Otherwise, the procedure is repeated. The maximum number of retries can be modified with /RETRY. An error is only reported 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 also possible 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, SPS "/MODE=SPOIO" Protocol type used on the controller SPOIO The SPOIO protocol type allows simultaneous read and write data transfer of several data blocks in a frame. In contrast, only one request 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. The total 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>
1.6.4.6 MININET Station Objects 133

PVI base system

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 in quotation 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 2byte 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 (Remote Transmission Request) objects. Unlike INA2000 communication via CAN, the contents of the CAN messages are not interpreted. This allows communication 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 CAN messages with a certain CAN ID. Process objects of the DCAN line: Name Line object Device object Station object CPU object Module object Task object Variable object Type Line Device Station CPU Module Task Pvar Connection "LNDCAN" Device parameter Station parameters Usage DCAN Line DCAN device Virtual station Can be specified, but not required Can be specified, but not required Can be specified, but not required Represents a CAN object

CAN ID

Allowed object structure for DCAN process objects:

134

1.6.5 DCAN line

PVI base system

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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Type" column indicates which access types in the DCAN line can be used with which process object types. Access types POBJ_ACC_VERSION POBJ_ACC_LIST_EXTERN POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE_EXTERN POBJ_ACC_UPLOAD POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE POBJ_ACC_UPLOAD_STM POBJ_ACC_DOWNLOAD_STM POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR POBJ_ACC_CPU_INFO 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 types which 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.5.2 DCAN access types 135

Type Line Device Line Pvar

Special features Line object: Version of the line DLL Device object: Version of the INA frame DLL and device DLL Lists entry for DCAN device if installed (PVI Setup) Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported

PVI base system

1.6.5.4 DCAN Communication A particular communication device is used for DCAN (direct CAN) communication. "CAN" needs to be selected as an additional interface in PVI Setup. PC Requirements: The DCAN line can be operated on the following platforms: Windows platform Windows 9x/Me Windows NT/2000/XP Windows CE Limitations Cannot use RTR objects 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 which Windows platforms. 1.6.5.5 DCAN Device Objects The communication device being used is determined with the DCAN device object. To address the DCAN device, it first has to 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 the configurator shows all CAN devices which have already been set up. The device number must also be specified in the PVI device name. The CAN1 device corresponds to the PVI device name DCAN1. CAN2 corresponds to DCAN2, etc. the B&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 the device object. Within the connection description, individual parameters are differentiated between 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 parameter specification. 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's connection description. Par. /IF Value Default Description dcan1 ... None CAN device. The device being used has to be entered in the device list of the B&R dcanX CAN device configurator. Example: "/IF=dcan1" 0, 1 0 CAN controller number (channel). 2 CAN controllers are available on the LS172 card. The desired controller is selected with the /CNO parameter. No value other than 0 (zero) may be specified for the default CAN controller. Example for LS172 card: CAN bus 1: "/IF=dcan2 /CNO=0" CAN bus 2: "/IF=dcan2 /CNO=1" 10000, *) Baud rate (data rate) on the CAN bus in bits per second. This parameter can also 20000, be specified in kBits per second. 50000, Example: "/BD=250000" or "/BD=250" 100000, 125000, 150000, 250000,
1.6.5.4 DCAN Communication

/CNO

/BD

136

PVI base system

500000, 800000, 1000000 /CMODE 11, 29 *)

/CT

>= 1, 0 = off

*)

/MC

>= 1

*)

CAN communication with 29bit identifiers (extended frames) or 11bit identifiers (standard frames). If 29bit CAN identifiers (extended frames) are used, then 11bit identifiers cannot be sent or received. Example: "/CMODE=29" Cycle time (in ms) within which the specified number (maximum) of CAN messages are sent (/MC parameter). Values < 20 ms don't make sense. Example: "/CT=20" Maximum number of CAN messages sent within the specified cycle time (/CT parameter). Example: "/MC=15"

*) The /BD, /CMODE, /CT, and /MC parameters can also be set using the B&R CAN device configurator. If these parameters are not specified in the connection description (the recommended method), then the values set in the configurator are used instead. If one of these parameters is specified in the connection description, 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 be restricted per cycle. This can reduce the load from the PC to the CAN bus. This could be important if other stations on the bus can only process a certain number of received CAN messages with the set baud rate, or if their interrupt load in general should be reduced. However, the disadvantage of limiting frames is slower CAN communication. 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 to buffer received CAN messages. The size of the FIFO buffer and the corresponding timeouts are set with station parameters. On a DCAN station, bus nodes with different designs can be grouped together and operated with different settings (Receive FIFO, Timeouts). The user can determine the distribution in DCAN stations according to his requirements. However, note that each station requires Windows resources (RAM, path objects, threads, etc.). Therefore, the number of stations should be kept within limits. The virtual station name and station parameters are defined in the station object's connection description. Within the connection description, individual parameters are differentiated between using parameter identifiers. These parameter identifiers always begin with the "/" character. At least one blank space needs to be between individual 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's connection description. Par. Value /CN Name Default Description "DefStation" Virtual station name Only alphanumeric characters and the "_" (underscore) character may be included in names. Names may only be up to 31 characters long. Names are also case sensitive. Example: "/CN=Main".
137

1.6.5.6 DCAN Station Objects

PVI base system

/FS 1 65535 100

/TR 1 60000 1000

/TW 1 2000

250

/RW 1 10000 0=none

*)

/CF 0, 1

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 /CN parameter. Size of the receive buffer (FIFO) in the CAN driver The value specifies the number of CAN messages. Only CAN messages whose IDs are enabled using an assigned variable object (read object) are written to the receive buffer. The necessary buffer size is therefore arranged only according to the frequency with which enabled CAN messages can occur on the CAN bus. Example: "/FS=200" Timeout for RTR read request in ms After an RTR read request, the response from the opposite station needs to be received within the set time. If this doesn't happen, then Timeout Error 14987 is reported. This parameter is only significant if used in connection with RTR read objects. Example: "/TR=100" Write procedure timeout in msec If the write request cannot be executed within the set time (e.g. CAN bus is occupied by CAN messages with higher priority), then the write procedure is cancelled and Timeout Error 14986 is reported. Internal write procedures (such as registering or deregistering RTR objects) can also report Error 13036. Example: "/TW=50" Write request delay time in msec Along with the delay time for write requests, a defined delay time is adhered to between the most recently received CAN message and the next CAN message to be sent. Example: "/RW=0" "/CF=0": Do not empty receive buffer (FIFO) before the write procedure (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 not specified in the connection description, then the value set in the configurator is used. If this parameter is specified 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 Link Layer"). 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 the user or by the DCAN line. DCAN Variable objects can be defined for either send or receive operation within a station object. This definition takes place with the object attribute property (AT parameter). "AT=w" is specified for send operations, "AT=e" for receive operations. Send and receive operation on the same CAN object is not possible. In receive operation,
138 1.6.5.7 DCAN Variable Objects

PVI base system

CAN data is transferred as an object event to the application (POBJ_EVENT_DATA event type). Specifying the refresh 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 a send ("AT=w") or receive ("AT=r") object. RTR (Remote Transmission Request) is a method standardized for CAN 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 same CAN 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 read request 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 the refresh time. The application itself determines when the read request is carried out by calling the PviReadRequest or PviXReadRequest and using access type POBJ_ACC_DATA. RTR receive objects work with timeout monitoring. After an RTR read request, the response from the opposite station needs to be received within the given time. If this doesn't happen, then Timeout Error 14987 is reported. The maximum response time can 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 is supplied with data by calling the PviWriteRequest or PviXWriteRequest function. However, the maximum number of send objects is limited and depends on the CAN card being used. A maximum of 12 can be used with the B&R standard CAN interface. Up to 256 send objects can be used with the LS172 card. With the LS172 card, RTR send objects can only be used with an ID less than or equal to 2047 even when using extended frames (29bit identifiers). Received data for a CAN object is normally monitored for changes. That means the application is only informed of changes to CAN data. Monitoring for changes can be disabled (specification "AT=de") with the variable attribute "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 the application. 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 Intel format anyway (least significant byte first). The CAN object ID must be entered in the connection description. Code letters can be used to determine how the 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 only transfer a maximum of 8 data bytes. The total length of the set data format determines the length of the data to be transferred in the write direction (sending). In the read direction (receiving), the data is copied dependent on its length. For example, the user defined "i32" (4byte integer) as a data format. If a CAN message with 2 bytes of data is received, then only the first 2 bytes of the integer value are copied. All other bytes remain undefined. If a data format is not defined when creating the DCAN variable object, then the line automatically 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 user has the option of setting the format of a structure, array, or signal variable using the
1.6.5.7 DCAN Variable Objects 139

PVI base system

Specified

CAN data. This allows PVI functions like type casting, variable addressing, event hysteresis, or data functions to be used. Regardless of the user setting, a data format of "VT=u8 VN=9" (byte array with 9 byte length) is set by the DCAN line. The length of the CAN object data to be sent or received is passed in the first byte. Bytes 29 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 (of course) be used for CAN objects with a fixed data length. Code letter "R" Description Not specified Standard CAN object for send or receive operation This definition takes place with the object attribute property (AT parameter). "AT=w" is specified for send operations, "AT=e" for receive operations. Specified RTR send or receive object This definition takes place with the object attribute property (AT parameter). "AT=w" is specified for the send object, "AT=r" is specified for the receive object. The refresh time property 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 4byte 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 are mapped to a 9byte array.
CD=1597 VT=i32 AT=w

With the write access to the variable object, the 4byte integer data is sent together with the CAN ID 1597 as a CAN 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. 2byte 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) (see also the "Provit 5000 User's Manual", model number MAPRV50000). 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 as functions 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:

140

1.6.6 MTC line

PVI base system

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 Line object Device object Station object CPU object Module object Task object Variable object Type Line Device Station CPU Module Task Pvar Connection Usage "LNMTC" MTC line Device parameter MTC device Can be specified, but not required Can be specified, but not required Can be specified, but not required Can be specified, but not required 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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Access type" column indicates which access types in the MTC line can be used with which process object types. Access types POBJ_ACC_VERSION POBJ_ACC_LIST_EXTERN POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE_EXTERN POBJ_ACC_UPLOAD POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE
1.6.6.1 MTC process objects

Type Line Device Line Pvar Pvar Pvar

Special features Line object: Version of the line DLL Device object: MTC version MTC device

Not supported Not supported Not supported Not supported Not supported Not supported
141

PVI base system

POBJ_ACC_UPLOAD_STM Not supported POBJ_ACC_DOWNLOAD_STM Not supported POBJ_ACC_LIST_STATION Line Device POBJ_ACC_LIST_CPU Line Device POBJ_ACC_LIST_MODULE Line Device POBJ_ACC_LIST_TASK Line Device POBJ_ACC_LIST_PVAR Line Device 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 types which 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 Windows 9x/Me Windows NT/2000/XP Windows CE Limitations Not possible

B&R MTC Utilities (starting from Version 1.09) must be installed on the PC. These are included on the "Provit Driver & Utilities" CD (model number 5S0000.01090). At least BIOS Version 00.25 is needed for MTC communication (see also "Provit 5000 MTC Utilities 32Bit User's Manual"). Otherwise, the MTC driver cannot be loaded. The "WatchdogTime", "Watchdog", "MkeyLedMatrix", and "KeySwitches" variables are only supported starting from 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 parameter specification. The following table shows all parameters which can be defined in a device object's connection description.

142

1.6.6.3 MTC events

PVI base system

Param. Value /IF mtc /TO

Default Description None MTC device Specification: "/IF=mtc" 0 60000 100 Timeout for MTC requests (ms) The MTC line controls the MTC using asynchronous calls. The timeout specifies how long it must wait before necessary data can be accessed when an MTC request 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 object corresponds to the name of the MTC variable. The MTC line supports predefined variable names. These are not case 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 in quotation 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 DriverVersion Data Format I/O VT=string VL=80 R Value ASCII string with max. 79 characters Description Version of the MTC driver. Example: "MTC Driver 1.11 19980925" This string is also returned with the MTC DLL version for the device object and access type VERSION.
1.6.6.6 MTC Variable Objects 143

PVI base system

MtcVersion

VT=string VL=80 R

ASCII string with max. 79 characters

MTC version Example: "MTC BIOS 1.1 000404" IPC version Example: "IPC5000C Bernecker + Rainer IndustrieElektronik V1.14" Number of key levels. Key levels have an effect on the "MkeyLeds", "MkeyLedMatrix", "Mkeys", and "MkeyMatrix" variables. WARNING: If a key level is set to value other than 0, then the MkeyLevelMode variable must be set to 1 (toggle) or 2 (oneshot)! Key level operating mode. Shift keys for key levels can be defined with B&R MKEY Utilities. State of key LEDs for the current key level. Note: Only the individual elements (LEDs) of the array can be addressed, not the entire array. State of scan codes in ROM for the current key level. State of scan codes in RAM for the current key level. Number of operating hours for the IPC. Number of powerons for the IPC. "Resets" are also counted. Number of overtemperature operating hours for the IPC. Number of operating hours for the fan. CPU overtemperature alarm.
1.6.6.6 MTC Variable Objects

IpcVersion

VT=string VL=80 R

ASCII string with max. 79 characters

MkeyLevel

VT=u8

R/W

03

MkeyLevelMode 1)

VT=u8

R/W

0 = default 1 = toggle 2 = oneshot

MkeyLeds

VT=u8 VN=128

R/W

1 element per LED: 0 = off 1 = normal blinking 2 = fast blinking 3 = on

ScanCodesStateRom 1)

VT=boolean

Scan codes are: 0 = undefined 1 = OK Scan codes are: 0 = undefined 1 = OK 0 65535 0 65535

ScanCodesStateRam

VT=boolean

IpcOperatingHours IpcPowerOnCycles

VT=u16 VT=u16

R R

IpcOverTempHours

VT=u16

0 65535

IpcFanHours CpuAlarm 1) 2)
144

VT=u16 VT=boolean

R R

0 65535 0 = normal 1 = alarm

PVI base system

IoAlarm 1) FpdAlarm BatteryState

VT=boolean

0 = normal 1 = alarm 0 = normal 1 = alarm 0 = normal 1 = empty, broken, or not present 0 127 0 127

VT=boolean VT=boolean

R R

Overtemperature alarm in the in the I/O area of the IPC. Display overtemperature alarm. Status of the CMOS battery in the IPC. Current CPU temperature in degrees Celsius. Current temperature in the I/O area of the IPC in degrees Celsius. ID of the display unit.

CpuTemperature 1) 3) IoTemperature 1) FpdNumber

VT=u8 VT=u8

R R

VT=u16

FpdName IpcMkeyRegisters

VT=string VL=9 R VT=u8 R

Number of registers for IPC keys. IpcMkeyLedRegisters VT=u8 R 0 16 Number of registers for IPC 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 VT=boolean R 1 element per key: State of the keys in the 1) VN=128 current key level. 0 = pressed 1 = not pressed WARNING: Pressing keys for just a very short time may not be detected. MkeyMatrix VT=u8 VN=16 R 1 bit per key: State of the keys in the 1) current key level in 0 = pressed "packed" form: 1 = not pressed byte 0, bit 0 = 1st key byte 0, bit 1 = 2nd key ... byte 1, bit 0 = 9th key ... WARNING: Pressing keys for just a very short time may not be detected. A display unit has to be connected for the following variables: FpdOperatingHours VT=u16 R 0 65535 FpdPowerOnCycles FpdOverTempHours VT=u16 VT=u16 R R 0 65535 0 65535 Number of operating hours for the display unit. Number of powerons for the display unit. Number of overtemperature operating hours for the display unit. Current display unit temperature in degrees Celsius. Contrast setting for the
145

0 = no display connected, other values are displaydependent ASCII string with max. 8 characters 0 16

Name of the display unit.

FpdTemperature 1) FpdContrast
1.6.6.6 MTC Variable Objects

VT=u8

0 127

VT=u8

0 100

PVI base system

display unit in percent. This variable is initialized by the MTC line with FpdDefaultContrast. Brightness setting for the display unit in percent. This variable is initialized by the MTC line with FpdDefaultBrightness. Default value for the display unit's contrast given in percent. Default value for the display unit's brightness (background lighting) given in percent. Number of registers for display unit keys. Number of registers for display unit key LEDs. State of the user LED (one of the status LEDs) on the IPC. State of the key LEDs in the current key level in "packed" form: byte 0, bit 0+1 = 1st LED byte 0, bit 2+3 = 2nd LED ... byte 1, bit 0+1 = 5th LED ... State of the key switches. Only those bits can be evaluated for which a key switch has also been defined. The state of all other bits is undefined and can therefore be either 0 or 1. Note: A key switch can also occupy several bits. Offset of the key switches. Watchdog timeout in ms. If the timeout expires without the Watchdog variable having been defined, then the IPC resets. WARNING:Windows requires the system to be shut down properly. This
146 1.6.6.6 MTC Variable Objects

FpdBrightness

VT=u8

0 100

FpdDefaultContrast

VT=u8

R/W

0 100

FpdDefaultBrightness

VT=u8

R/W

0 100

FpdMkeyRegisters VT=u8 R 0 16 1) FpdMkeyLedRegisters VT=u8 R 0 16 1) The following variables are supported beginning with MTC Version 00.10: UserLed VT=boolean R/W 0 = off 1 = on MkeyLedMatrix VT=u8 VN=32 W 2 bits per LED: 00 = off 01 = normal blinking 10 = fast blinking 11 = on

KeySwitches 1)

VT=u8

1 bit per contact: 0 = closed 1 = opened

KeySwitchesOffset WatchdogTime

VT=u8 VT=u32

R W

0 127 0 = off 1 1310700

PVI base system

Watchdog

VT=u8

(Irrelevant is not evaluated)

doesn't happen if a reset occurs. This can lead to data loss which can leave the system or application "paralyzed". Variable for acknowledging the watchdog. The watchdog is reset when this variable is written to. WARNING:Before this variable is "removed" with PviUnlink or PviDelete, the watchdog must be disabled by writing 0 to the WatchdogTime variable!

The following variables are only supported on an IPC500C/5600C: 1) CpuAlarmIntern VT=boolean R 0 = normal 1 = alarm CpuAlarmSocket VT=boolean R 0 = normal 1 = alarm CpuAlarmFan VT=boolean R 0 = normal 1 = alarm CpuTemperatureIntern VT=u8 R 0 127

CpuTemperatureSocket

VT=u8

0 127

IpcFanRpm IpcVoltage2_5 IpcVoltage3_3 IpcVoltage5 IpcVoltage12 IpcVoltageCore IpcVoltageBattery

VT=u16 VN=2 VT=f32 VT=f32 VT=f32 VT=f32 VT=f32 VT=f32

R R R R R R R

0 65535

Internal CPU overtemperature alarm. CPU socket overtemperature alarm. CPU fan alarm (fan not running). Current internal CPU temperature in degrees Celsius. Current CPU socket area temperature in degrees Celsius. Number of IPC fan revolutions per minute. 2.5V IPC voltage in volts. 3.3V IPC voltage in volts. 5V IPC voltage in volts. 12V IPC voltage in volts. IPC core voltage in volts. IPC battery voltage in volts.

1) Direct Access Mode is used to access this variable on a IPC5000C/5600C. Because of this, a shorter 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 an IPC5000C/5600C.
1.6.6.6.1.1 Access Time

Reading and writing variables may take a relatively long time (depending on MTC communication) if an IPC5000C or IPC5600C is not being used. These devices support MTC communication using a FIFO buffer and Direct Access Mode. Note: If an IPC5000 (or older IPC5000C/5600C without FIFO) is used, MTC communication can be "sped up" in the
1.6.6.6 MTC Variable Objects 147

PVI base system

following way: The "PollingRate" parameter for the MTC driver must be set to a higher value (e.g. 10) in the registry (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 can react 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 key must 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 key is pressed, the level is toggled between level 0 and the respective level. In "OneShot" mode, pressing the level key only has an effect on the key pressed immediately afterwards. Once the 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 one access to the MTC driver has to be made for all keys. However, the PVI application itself then has to evaluate the 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 the keys pressed. This means that pressing keys for only a short duration may not be detected depending on the scan times of the MTC driver, the MTC line, and the PVI application. The MTC line scan time is influenced by the number and refresh rates of the registered variables. Task states should therefore only be read for diagnostic 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, then the 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 allowed minimum 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 to FpdContrast or FpdBrightness always sends the values of both variables to the MTC. If a variable has not been set 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
148 1.6.6.6 MTC Variable Objects

PVI base system

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 possible LEDs or keys which may exist. The actual existing amount depends on the connected keypad modules or the display unit being used.

1.6.7 OS9NET line


The OS9NET line communicates with one or more OS9/Net stations (SG2) over ARCNET (OS9NET communication). 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 an OS9/Net station. Process objects in the OS9NET line: Name Line object Device object Station object CPU object Module object Task object Variable object Type Line Device Station CPU Module Task Pvar Connection "OS9NET" "ARCNET" OS9/Net station name Usage OS9NET line ARCNET device Represents a OS9/Net station (PLC) in an ARCNET network Can be specified, but not required Can be specified, but not required Can be specified, but not required Represents a variable on the PLC

Variable name

Object structure for OS9/Net process objects:

1.6.6.6 MTC Variable Objects

149

PVI base system

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 not listed here as well as access types to the PVI base object are executed by PVI Manager and therefore work independently of the line being used. The "Type" column indicates which access types in the OS9/Net line can be used with which process object types. Access types POBJ_ACC_VERSION POBJ_ACC_LIST_EXTERN POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE_EXTERN POBJ_ACC_UPLOAD POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE POBJ_ACC_UPLOAD_STM POBJ_ACC_DOWNLOAD_STM POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR POBJ_ACC_CPU_INFO 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 types which 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 OS9/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 Windows 9x/Me Windows NT/2000/XP Windows CE Limitations Not possible Only possible in Windows NT/2000 Not possible Type Line Device Line Pvar Special features Line object: Version of the line DLL Device object: Version of the OS9Arc DLL ARCNET device Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported

The OS9NET line is comprised of the PVI components "LnOs9Net.dll" (line server) and "Os9Arc.dll" (OS9/Net communication). In addition, the "Packet.sys" driver (OS9/Net communication) and "Ntndis40.sys" (COM20020 network card) files are required.
150 1.6.7.2 OS9NET access types

PVI base system

The installation of the protocol driver PACKET.SYS and the network driver NTNDIS40.SYS is required for operation. Installation procedure: 1. Start > Settings > Control Panel > Network 2. Register network card 3. Add > Diskette 4. Specify path for OEMSETUP.INF file (e.g. "\BR_Automation\PVI\Drivers\Com20020") 5. Register protocol 6. Add > Diskette 7. Specify path for OEMSETUP.INF file (e.g. "\BR_Automation\PVI\Drivers\Arcos9") 8. Reboot computer 1.6.7.5 OS9NET Device Objects The OS9/Net line only supports one device object The device name "ARCNET" must be specified in the connection 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:

1.6.7.5 OS9NET Device Objects

151

PVI base system

/RO=<Connection> or <Connection> Memory type Counter (register) Flag Input Output Connection R<DecimalOffset> F<DecimalOffset> I<B&RHexOffset> O<B&RHexOffset> Min. offset 0000 000 000 000 Max. offset 7095 799 3FN 3FN Example "R1234" "F156" "I0FN" "O0FA"

Example of object description:


CD="/RO=R926" VT=i16

The memory range beginning with Counter 926 is read and written as a 2byte 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 PVI Manager

1.7.1 Snapshot Files


The Snapshot function is a useful tool for diagnosing the operational state of PVI Manager PVI objects. The Snapshot function writes a list of PVI objects (link objects, process objects, and service objects) along with their status and a list of all registered clients as text (ASCII) to a file. The Snapshot function can be triggered via PVI Monitor or from a PVI application (access type POBJ_ACC_SNAPSHOT). Snapshot information is divided into 5 sections: 1. General PVI information 2. List of all registered communication instances (clients) 3. List of link objects 4. List of process objects 5. List of service objects Snapshot information is divided into lines. Depending on the first character in the line, the rest of the line is interpreted as follows: Character '*' '>' ':' '' Description Comment line with general PVI information Time stamp (date and time) of the Snapshot information Indicates the start of a list entry A space character indicates a following line of a list entry

At the beginning of each list entry is a code with an identification number (ID) directly after the ":" character. This ID number is unique within a list and is displayed as a hex number. ID CId
152

Description Entry for registered communication instance


1.7 Diagnostics

PVI base system

C P S

(client) Entry for a link object Entry for a process object Entry for a service object

The assignment of individual objects is also displayed with the ID number. Several process objects can be assigned to one service object, and several link objects can be assigned to one process object. The following image 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 main components are identical. The list of all registered communication instances, the list of link objects, and the list of process objects are all of particular significance to the user. General PVI information: Comment lines containing general PVI information are output at the beginning of the Snapshot file. The first line contains information about the operating system platform and the system operating mode of PVI Manager. The second line displays the file version and product version of PVI Manager. The next few lines contain information about 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 CId name ComType ProcID PriorClass Platform TC TR Description ID number of the communication instance (client) Name of the application process Communication type: 0 ... Local, 1 ... Remote ID of the user process in hex format Priority class of the user process Platform where the user processes are running Setting being used for the communication timeout in seconds ("Timeout" argument in the PviInitialize or PviXInitialize function) Setting being used for the retry time for PVICOM user messages in seconds ("RetryTime" argument in the PviInitialize or PviXInitialize function)
153

1.7 Diagnostics

PVI base system

PT LM

Setting being used for the process timeout in seconds (PT initialization parameter in the PviInitialize or PviXInitialize function) Setting being used for limiting user messages (LM initialization parameter in the PviInitialize or 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 C P CId Desc: Description ID number of the link object ID number of the assigned process object ID number of the communication instance (client) which created the link object Code for lines with the current link object property settings. The parameters output here correspond to those 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 data Windows 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. E If the link object is in an error state, then the error code is output with "E=<Code>". "LastE=<Code>" LastE shows the last occurring error. The link object is no longer in an error state here. Ctr This displays additional internal operating modes for the link object. These operating modes cannot be DCond interpreted by the user. Example:
:C=0091 P=00e11f60 CId=599a0005 Desc: EV=de LT=prc VT=string VL=80 VN=1 State: 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 P S Description ID number of the process object. The ID number of the higherlevel process object in the object structure is output in parentheses. ID number of the assigned service object. If no service objects are assigned to the process object (e.g. for internal process objects), then ID number 0 (zero) is output.
1.7 Diagnostics

154

PVI base system

Pn OT Desc: State: <Act/Idl> <WState> Temp E Ctr DCond Example:

Path name of the process object Object type of the process object Code for lines with the current process object property settings. The parameters output here correspond to those of the process object description. ID for lines with specifications regarding the process object status. Current active status: "Act": active, "Idl": inactive (idle) Current operating state: "NotRdy": not ready, "Rdy": ready, "Err": error. The following value in parentheses shows the operating state in binary format. This displays a temporary process object. If the process object is in an error state, then the error code is output with "E=<Code>". This displays additional internal operating modes for the process object. These operating modes cannot be interpreted by the user.

:P=00e11f60(00e10180) S=0082 Pn=@Pvi/LNINA2/COM2/CPU/Pvar1 OT=Pvar Desc: CD="PV1" AT=rw RF=250 VT=i32 VL=4 VN=1 State: 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 S Description ID number of the service object. The ID number of the higherlevel service object in the object structure is output in parentheses. L Identification number of the assigned object within the line This ID number is used in the PVI logger output for the line. Pn Path name of the service object. Unlike the process object, the path name is formed from the connection 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 in parentheses 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) Ctr This displays additional internal operating modes for the service object. These operating modes PrL cannot be interpreted by the user. StL Example:

1.7 Diagnostics

155

PVI base system

: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 Snapshot function, the Data Logger records the timing of processes in the individual PVI layers. The logging output of PVI components are primarily intended for B&R to analyze problems. However, the outputs of some components can also provide users with useful information. PVI components use the Data Logger to write text (ASCII) information to a file during runtime. This file is handled as a ring buffer, i.e. if the end of the file is reached when writing, then the write pointer is set to zero and output 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 time overview 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, the Data Logger can greatly affect the timing of PVI components. Because of this, a warning appears on the screen when 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 thePVI Monitor. The approach to and effects of logger parameters are described in the Setting up the Data Logger section. 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 key is comprised of the process context, the component's filename, and an optional section. The logger settings for the 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 ... > Time ... > Verbose ... > <Component> ... > Mode > Time > Verbose > LogPath > LogSize > LineLen > LogBackup > BreakMode > BreakTime > BreakStr

global logging mode global time stamp format global verbose mode Key: Logging component ... logging mode (0/1) ... time stamp format ... verbose mode (0/1) ... path name of the log file ... size of the log file in bytes ... maximum length of a text line (in characters) ... number of backup log files ... break function (0/1) ... break delay ... break expression

Current logger settings can be saved in a registry file using the Windows Registry Editor: 1. Start the "Regedit.exe" program 2. Select the HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi\DataLogger key 3. Click on the "File > Export..." menu item 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
156 1.7.2 Data logger

PVI base system

"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 the verbose mode, the logging mode determines the extent of logger output. Component <Prog>/PviCom.dll/Client Description Logger output for the PVICOM user interface: Logging mode "Log Error": All occurring system errors and errors reported to the application are logged. Logging mode "Log Main": Logs all function calls from the PVICOM user interface and user messages which are triggered. In addition, a hex dump of all data is output with the verbose mode. Logging mode "Log Details": The communication with PVI Manager is logged from the point of view of the client. The complete file name of the application process is used for <Prog>. The name of registered PVI applications can be also be taken from the list of communication instances in the Snapshot file. Default logger output of PVI Manager: Logging mode "Log Error": All system errors which occur when requests are executed are logged along with errors reported to the application. Logging mode "Log Main": All requests, responses, and events from and to PVI applications are logged. In addition, a hex dump of all data is output with the verbose mode. Logging mode "Log Details": Communication with the connected line is logged from the point of view of PVI Manager. System logger output of PVI Manager: Logging mode "Log Error": All system errors which occur in operating system functions of PVI Manager are logged. Logging mode "Log Main": Logging of the program flow of operating system functions during initialization or deinitialization as well as in operation as an NT service. Logging of installation and deinstallation as a Windows NT service. Logger output of the NET2000 line: Logging mode "Log Details": Variable identification (GetOV) logged. Logger output of the NET2000 line (state machine): Logging mode "Log Error": Errors reported by the NET2000 state machine are logged. Logging mode "Log Details": Function calls from the state machine are logged. In addition, a hex dump of reference data is output with the verbose mode. Logger output of the INA2000 line: Logging mode "Log Details": The internal program flow is logged. In addition, a hex dump of all data transferred to and from the ICOMM is
157

PviMan.exe

PviMan.exe/System

PviMan.exe/LnNet2.dll PviMan.exe/Net2000.dll

PviMan.exe/LnIna2.dll

1.7.2.1 PVI components with logger output

PVI base system

PviMan.exe/IComm.dll PviMan.exe/InaFrms.dll/<Dev>

output with the verbose mode. Logger output of the INA2000 line (ICOMM): Logging mode "Log Details": The internal program flow is logged. Logger output of the INA frame library: Logging mode "Log Error": All system and communication errors which occur are logged. Logging mode "Log Main": All function calls of the frame interface are logged. In addition, a hex dump of all frame data is output with the verbose mode. The INA frame library is used to transport log data from the NET2000, INA2000, Direct CAN, and MININET lines. The corresponding device name 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 connection with the INACAN or DCAN devices, then the '.' character (period) and the value of the device name have to be connected (e.g. "/IF=INACAN2 /CNO=1" results in <Dev>: "INACAN2.1"). Logger output of the INA frame TCP/IP device library: Logging mode "Log Error": All system and communication errors which occur are logged. Logging mode "Log Main": All function calls of the frame interface are logged. Logging mode "Log Details": Network communication is logged. In addition, a hex dump of sent and received frames is output with the verbose 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). Logger output of the INA frame INACAN device library: Logging mode "Log Error": All system and communication errors which occur are logged. Logging mode "Log Main": All function calls of the frame interface are logged. Logging mode "Log Details": CAN communication is logged. In addition, a hex dump of all sent and received CAN messages is output with the verbose 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). Logger output of the INA frame DCAN device library: Logging mode "Log Error": All system and communication errors which occur are logged. Logging mode "Log Main": All function calls of the frame interface are logged. The INA frame DCAN device library is a part of the INA frame library (InaFrms). The corresponding DCAN device name is used for <Dev> (see description for the INA frame library). Logger output of the DDE server: Logging mode "Log Main": The DDE interface is logged. Logger output of the OPC server: Logging mode "Log Error": All occurring system errors and errors reported 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.

PviMan.exe/DvTcpIp.dll/<Dev>

PviMan.exe/DvInaCan.dll/<Dev>

PviMan.exe/DvDCan.dll/<Dev>

PviDDE.exe PviOPC.exe

Note that "Log Main" also activates "Log Error", and that "Log Details" activates both "Log Main" and "Log
158 1.7.2.1 PVI components with logger output

PVI base system

Error". The PVI Data Logger is primarily intended for B&R to analyze problems. For this reason, much of the logger output refers to internal program sequences or internal PVI component states. However, some logger output can be 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 problems which arise in connection the the PVICOM interface. The component "PviMan.exe/InaFrms.dll/<Dev>" (logging mode "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, define PVI objects with clear identification numbers. The Snapshot function can be used to coordinate the assignment between identification numbers and object names. It should be noted that giving the identification number takes place when the object is set up. If this object is released and then set up again, then the identification number can 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 an additional space. Changes in logging states are identified with the sequence "###" followed by a corresponding text and name of the component: ### start trace ### change trace ### stop trace ### begin trace ### end trace ### break trace Logger output was started while the component was running (online) Logger mode was changed while the component was running Logger output was stopped while the component was running Logger output was started with the component Logger output was ended with the component Logger output was automatically stopped with the cancel function

The "### start trace" and "### begin trace" logger entries define when logger recording begins. However, the Data Logger handles the logger file like a ring buffer. If recording takes a long time, the beginning of the logger record may be overwritten. The "### stop trace", "### end trace" and "### break trace" logger entries define when logger recording ends. One of these labels is almost always present. However, the Data Logger cannot output any of these "end markings" if the program crashes. In this case, the time stamp must be used to determine 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 for other 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 C=<ID> P=<ID> S=<ID> Description Identification number (ID) for the link object Identification number (ID) for the process object Identification number (ID) for the service object
159

1.7.2.2 Logger output format

PVI base system

CId=<ID> RId=<ID> L=<ID> Pn=<PathName> E=<Code> SysE=<Code> SockE=<Code> Ty=<Type> Md=<Mode> Dl=<Length> Ih=<Handle> Ot=<Type> OT=<Type> St=<Status> Msg=(<Msg>)

CDesc=(<Par>) PDesc=(<Par>) Len=<Num> Offs=<Num> Ev=<Flags> Svc=<Mode> CdP=<ID> FrP=<ID> HyP=<ID>

Identification number (ID) for the registered communication instance (client) Identification number (ID) for request and response data Identification number (ID) of the assigned object within the line Path name of the process or service object PVI error code. A "no error" status can also be signaled with "E=0". System error code (general Windows error code) Windows socket error code PVI access type (numeric) PVI function mode, numeric or string ("WR" Write, "RD" Read) Data length of PVI request, response, or event data Handle of the PVICOM communication instance PVI process object type as a numeric value PVI process object type as a string (Pvi, Line, Device, Station, Cpu, Module, Task, Pvar) PVI status flags (bits) of response or event data (RESPONSE_INFO structure) User message for signaling response or event data Windows 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. Specifies the link object description Specifies the process object description Length (general) Offset (general) Enabling mask for object events in the line Line service ("RD", "WR", "IDENT", "INFO") Identification number of the process object for the connection description Identification number of the process object for the data format (only for variable objects) 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 the communication between the PVI Manager (server) and the PVICOM communication instance (clients). "Comm.Event" "Comm.ReadRequ" "Comm.ReadResp" "Comm.WriteRequ" "Comm.WriteResp" "Comm.CreateRequ" "Comm.CreateResp" "Comm.LinkRequ" "Comm.LinkResp" "Comm.ChgLinkRequ" "Comm.ChgLinkResp" "Comm.UnlinkRequ" "Comm.UnlinkResp" "Comm.UnlinkAllRequ" "Comm.UnlinkAllResp" "Comm.DeleteRequ" "Comm.DeleteResp" "Comm.ClientAttach" "Comm.ClientDetach"
160

Sends event data Receives request data for read request Sends response data for read request Receives request data for write request Sends response data for write request Receives request data for "Set up process object" request Sends response data for "Set up process object" request Receives request data for "Set up link object" request Sends response data for "Set up link object" request Receives request data for "Change user message" request Sends response data for "Change user message" request Receives request data for "Release link object" request Sends response data for "Release link object" request Receives request data for "Release all link objects" request Sends response data for "Release all link objects" request Receives request data for "Delete process object" request Sends response data for "Delete process object" request Registers a communication instance Deregisters a communication instance
1.7.2.2 Logger output format

PVI base system

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 or read. The PVICOM interface ("<Prog>/PviCom.dll/Client" component) logs all user function calls. "Initialize" "Deinitialize" "SetGlobEventMsg" "CreateRequest" "CreateResponse" "DeleteRequest" "DeleteResponse" "LinkRequest" "LinkResponse" "UnlinkRequest" "UnlinkResponse" "ChgLinkRequest" "ChgLinkResponse" "UnlinkALL" "ReadRequest" PviInitialize or PviXInitialize function call PviDeinitialize or PviXDeinitialize function call PviSetGlobEventMsg or PviXSetGlobEventMsg function call PviCreateRequest or PviXCreateRequest function call PviCreateResponseor PviXCreateResponse function call PviDeleteRequest or PviXDeleteRequest function call PviDeleteResponse or PviXDeleteResponse function call Calls the PviLinkRequest or PviXLinkRequest function PviLinkResponse or PviXLinkResponse function call PviUnlinkRequest or PviXUnlinkRequest function call PviUnlinkResponse or PviXUnlinkResponse function call PviChgLinkRequest or PviXChgLinkRequest function call PviChgLinkResponse or PviXChgLinkResponse function call PviUnlinkAll or PviXUnlinkAll function call PviReadRequest, PviXReadRequest, PviReadArgumentRequest, or PviXReadArgumentRequest function call "ReadResponse" PviReadResponse or PviXReadResponse function call "WriteRequest" PviWriteRequest or PviXWriteRequest function call "WriteResponse" PviWriteResponse, PviXWriteResponse, PviWriteResultResponse, or PviXWriteResultResponse 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 function variants 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 >> 12:00:14.340 ... >> 12:00:14.390 >> 12:00:14.420 >> 12:00:14.420 WriteRequest Ih=0 C=0010 Ty=11 Dl=2 WriteRequest OK Send W:00000974,1027,1001 RId=80000018 WriteResponse Ih=0 RId=80000018 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
1.7.2.2 Logger output format 161

PVI base system

>> 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 POBJ_ACC_OBJECT POBJ_ACC_VERSION POBJ_ACC_ERROR POBJ_ACC_EVMASK POBJ_ACC_LIST POBJ_ACC_LIST_EXTERN POBJ_ACC_CONNECT POBJ_ACC_DATA POBJ_ACC_STATUS POBJ_ACC_TYPE POBJ_ACC_TYPE_EXTERN POBJ_ACC_REFRESH POBJ_ACC_HYSTERESE POBJ_ACC_DEFAULT POBJ_ACC_FUNCTION POBJ_ACC_UPLOAD POBJ_ACC_DOWNLOAD POBJ_ACC_DATE_TIME POBJ_ACC_MEM_DELETE POBJ_ACC_MEM_INFO POBJ_ACC_MOD_TYPE POBJ_ACC_UPLOAD_STM POBJ_ACC_DOWNLOAD_STM POBJ_ACC_LIST_LINE POBJ_ACC_LIST_DEVICE POBJ_ACC_LIST_STATION POBJ_ACC_LIST_CPU POBJ_ACC_LIST_MODULE POBJ_ACC_LIST_TASK POBJ_ACC_LIST_PVAR POBJ_ACC_CPU_INFO POBJ_ACC_CANCEL POBJ_ACC_USERTAG POBJ_ACC_INFO_LICENCE POBJ_ACC_LIST_CLIENTS POBJ_ACC_SNAPSHOT No. #1 #2 #3 #5 #6 #7 #10 #11 #12 #13 #14 #15 #16 #17 #18 #20 #21 #22 #23 #24 #25 #26 #27 #30 #31 #32 #33 #34 #35 #36 #50 #128 #129 #200 #210 #240 Description Reads object type Reads version of PVI components or corresponding PLC object Reads error code of the most recent error Reads/Sets enabling mask for object events Reads list of all setup process objects Reads list of all possible process objects Reads/Writes connection description Reads/Writes process data Reads/Sets PLC object status Reads/Writes object attributes, mode for type conversion, and/or data format Reads object attributes and data format as well as structure definition and element names of a PLC variable Reads/Writes refresh rate Reads/Writes the event hysteresis of a variable object Reads preset value for a variable object. The value is returned in string format. Reads/Writes the data function of a variable object Reads BR module from PLC and saves it to a file Reads BR module from file and transfers it to PLC Reads/Sets date and time Deletes specified data memory on the PLC Reads information about existing PLC data memory Reads information about a PLC module Reads BR module from PLC and transfers it as binary user data Transfers BR module from binary user data to PLC Reads list of all possible line objects Reads list of all possible device objects Reads list of all possible station objects Reads list of all possible CPU objects Reads list of all possible module objects Reads list of all possible task objects Reads list of all possible variable objects Reads CPU information Cancels sent PVI instruction Reads / configures user tag Reads PVI Manager license information Reads list of all clients registered with PVI Manager Executes snapshot function

List of event types and global event types: Event types


162

No.

Description
1.8 Appendix

PVI base system

POBJ_EVENT_ERROR POBJ_EVENT_CONNECT POBJ_EVENT_DATA POBJ_EVENT_STATUS POBJ_EVENT_DATAFORM POBJ_EVENT_PROCEEDING POBJ_EVENT_USERTAG POBJ_EVENT_PVI_CONNECT POBJ_EVENT_PVI_DISCONN POBJ_EVENT_PVI_ARRANGE Parameters for object definition: Par. CD EV LT AT RF VT VL VN {...} AL CM VA DV HY FS UT Definition KWDESC_CONNECT KWDESC_EVMASK KWDESC_LINKTYPE KWDESC_ATTRIBUTE KWDESC_REFRESH KWDESC_PVTYPE KWDESC_PVLEN KWDESC_PVCNT PVICHR_SUB_ON, PVICHR_SUB_OFF KWDESC_ALIGNMENT KWDESC_CASTMODE KWDESC_PVADDR KWDESC_DEFAULT KWDESC_HYSTERESE KWDESC_FUNCTION KWDESC_USERTAG

#3 #10 #11 #12 #13 #128 #129 #240 #241 #242

Change in error state or error code Change in connection definition Change in process data Change in status Change in data format Progress information User tag modification Connection made to PVI Manager Connection to PVI Manager lost New registration on PVI Manager

Description Connection definition Enabling mask for object event Link type Object attributes Refresh time Variable type (data format) Variable length (data format) Number of elements (data format) Definition of structure elements (data format) Structure alignment (data format) Mode for type conversion Variable addressing Default value Event hysteresis Data function User tag

Parameters for initialization parameters: Par. AS LM PT IP PN Definition KWINIT_AUTOSTART KWINIT_MSG_LIMIT KWINIT_PRC_TIMEOUT KWINIT_IPADDR KWINIT_IPPORT Description PVI Manager autostart Limit on user messages. Process timeout (not suitable for standard applications) TCP/IP address or host name for remote communication type TCP/IP port number.

Parameters for object services: Par. Pieces VO OT SC SN LD IM MN Definition KWDESC_PVELEM KWDESC_PVOFFS KWDESC_OBJTYPE KWDESC_SCOPE KWDESC_SNAME KWDESC_LOADTYPE KWDESC_INSTMODE KWDESC_MODNAME Description Additional information for structure elements Offset for structure elements Object type Scope Structure name Load type / memory type Installation mode Module name
163

1.8 Appendix

PVI base system

ST FC IO MT ML SL SF SB

KWDESC_STATUS KWDESC_FORCESTATE KWDESC_IOTYPE KWDESC_MODTYPE KWDESC_MODLEN KWDESC_MEMLEN KWDESC_MEMFREELEN KWDESC_MEMBLOCKLEN

Status Force state I/O type (attribute: r/w) Module type Module length in bytes Memory length in bytes Available memory length in bytes Largest available memory area

List of process object types: Object type definition Binary String POBJ_PVI #0 KWOBJTYPE_PVI POBJ_LINE #1 KWOBJTYPE_LINE POBJ_DEVICE #2 KWOBJTYPE_DEVICE POBJ_STATION #3 KWOBJTYPE_STATION POBJ_CPU #4 KWOBJTYPE_CPU POBJ_MODULE #5 KWOBJTYPE_MODULE POBJ_TASK #6 KWOBJTYPE_TASK POBJ_PVAR #7 KWOBJTYPE_PVAR Keywords for load state / memory type: Keyword SysRam RAM SysRom Rom MemCard FixRam DRam PerMem Delete Definition KWLOADTYPE_SYS_RAM KWLOADTYPE_RAM KWLOADTYPE_SYS_ROM KWLOADTYPE_ROM KWLOADTYPE_MEMCARD KWLOADTYPE_FIX_RAM KWLOADTYPE_DRAM KWLOADTYPE_PER_MEM KWLOADTYPE_DELETE Description System RAM User RAM System Flash (ROM) User Flash (ROM) Memory Card Fix RAM DRAM Permanent memory Deletes module (access type POBJ_ACC_STATUS) Product ID Pvi Line Device Station CPU Module Task Pvar Base object Line object Device object Station object CPU object Module object Task object Variable object

Installation mode keywords for cyclic tasks: Keyword Overload Copy OneCycle Definition KWINSTMODE_OVERLOAD KWINSTMODE_COPY KWINSTMODE_ONECYCLE Description Default mechanism Exchange in several cycles 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 PviMan.exe PviFcLin.dll PviMon.exe PviCom.dll PviLog.dll Vsauthd.vxd
164

Directory Bin Bin Bin System System System

Platform NT/9x/CE NT/9x/CE NT/9x/CE NT/9x/CE NT/9x/CE 9x

Description PVI Manager PVI data function LIN PVI Monitor PVICOM interface PVI Data Logger Driver for B&R security key (LPT port)
1.8.2 Appendix B Base Components

PVI base system

Ds1410d.sys Ds2490.sys Ibfs32.dll Ib90usb.dll Ib10e32.dll BrSecChk.exe LnIna2.dll iComm.dll BrBase.dll BrMod102.dll BrModCE.dll InaFrm.dll BrPgVm32.dll BrBrMgen.dll LnNet2.dll Net2000.dll LnMini.dll LnOs9Net.dll Os9Arc.dll LnDCan.dll LnMtc.dll InaFrms.dll Serial.vxd DvInaCan.dll DvDCan.dll InaCan.vxd InaCan.sys CanDrv.dll CanDvCfg.cpl DvTcpIp.dll DvModem.dll DvPBusFDL.dll PBus.vxd PBus.sys DvLs251.dll Ls251Drv.vxd Ls251Drv.sys DvAr000.dll

System System System System System Tools Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin Bin System Bin Bin System System System Bin Bin Bin System System Bin System System Bin

PS 2K/XP, 98/Me NT/9x 2K/XP, 98/Me NT/9x NT/9x NT/9x/CE NT/9x/CE NT/9x/CE NT/9x CE NT/9x/CE NT/9x NT/9x NT/9x/CE NT/9x/CE NT/9x PS PS NT/9x/CE NT/9x NT/9x/CE 95 NT/9x/CE NT/9x/CE 9x PS CE NT/9x/CE NT/9x/CE NT/9x NT/9x 9x PS PS 9x PS PS

Driver for B&R security key (LPT port) Driver for B&R security key (USB port) Library for B&R security key Library for B&R security key (USB port) Library for B&R security key (LPT port) Program to check B&R security key INA2000 line (line server) INA2000 line (communication) INA2000 line (subcomponent) INA2000 line (subcomponent) INA2000 line (subcomponent) INA2000 line (subcomponent) INA2000 line (subcomponent) Compilation library for binary modules NET2000 line (line server) NET2000 line (NET2000 state machine) MININET line (line server) OS9NET line (line server) OS9NET line (OS9/Net communication) Direct CAN linie (line server) MTC line (line server) INA frame library (communication) Driver for RS485 communication in Windows 95 INACAN device DLL for the INA frame library DCAN device DLL for the INA frame library Driver for B&R CAN devices Driver for B&R CAN devices Driver for B&R CAN devices B&R CAN device configurator TCP/IP device DLL for the INA frame library Modem device DLL for the INA frame library PBUSFDL device DLL for the INA frame library Driver for shared memory communication Driver for shared memory communication LS251 device DLL for the INA frame library Driver for LS251 communication Driver for LS251 communication 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 for users who carry out separate installation programs and need to replicate PVI base system registration themselves. The PVI base system uses the Windows registry to store installation information, operating parameters, and system entries. PVI entries are divided among the following keys:

1.8.3 Appendix C Registration

165

PVI base system

1. "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App_Paths\PviMan.exe": This key holds the system entry for starting PVI Manager. 2. "HKEY_LOCAL_MACHINE\SOFTWARE\BR_Automation\Pvi": Installation information and operating parameters are stored under this key. 3. "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet": This key contains PVI Setup driver information. "...\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 changed afterwards. They indicate the installed components of the PVI base system. These entries affect functions of 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 changed afterwards. They only serve to indicate the version or other subordinate functions. These entries are not absolutely necessary to operate the PVI base system.
166 1.8.3 Appendix C Registration

PVI base system

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 base system. 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 the function 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 have a 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 the INA frame library "InaFrms.dll". <Line> Other additional key entries for all installed PVI lines are setup under the "...\PviLine" key. The key name corresponds to the name of the line. The location and name of the line DLL is defined with the "Path" and "Name" entries. The "Devices" entry shows all devices which are fundamentally supported by this line. Together with the key entries for the installed communication devices (<Device>), it can be determined which devices can be used for this line. <TranslationT >he "BR_TypeTranslation" key is installed in the appropriate registry entry for PVI lines which support the translation library in connection with the upload/download functions. Other additional key entries for all installed translation libraries are setup under this key. The path name of the DLL is 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"

1.8.3 Appendix C Registration

167

PVI base system

[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:
168 1.8.3 Appendix C Registration

PVI base system

"%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)

1.8.3 Appendix C Registration

169

PVI base system

170

1.8.3 Appendix C Registration

You might also like