Copyright: © 2002 CTC Parker Automation GA-82871-605


Contents
User Device Interface Driver Help Contents

This Help provides information on User Device Interface (UDI) driver. The UDI driver, along with a user-written driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations.

This Help contains instructions on how to configure the UDI driver for maximum performance, how to communicate with a user-written driver, and how to access the data it provides.

The following Help Topics are available for the User Device Interface Driver:

Introduction

Driver Configuration

Addressing Format

Run Mode

Error Handling

Contact Information

To learn more about using online help, press F1.


Introduction
User Device Interface Driver Help Contents

This Help provides information on User Device Interface (UDI) driver. The UDI driver, along with a user-written driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations.

This Help contains instructions on how to configure the UDI driver for maximum performance, how to communicate with a user-written driver, and how to access the data it provides.

The following Help Topics are available for the User Device Interface Driver:

Introduction

What is the User Device Interface?

16550 UART Support

Driver Configuration

Addressing Format

Run Mode

Error Handling

Contact Information

To learn more about using online help, press F1.


What is the User Device Interface?

The User Device Interface (UDI) driver is a program that allows Interact to communicate with user-written drivers or user drivers. The UDI driver, along with the user driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations. The difference between a typical Interact driver and the UDI driver is that the UDI driver requires an additional user written driver to communicate with the controller.

The UDI driver is under the control of the Application Manager (AM), and data is transferred between the user driver and Interact modules via the UDI driver. The following illustration shows the relationship among the UDI driver, the user driver, Interact, and the controller.


16550 UART Support

Important   We strongly recommend the use of a 16550AF (or equivalent) UART if you are running Interact. The UART buffers incoming characters until the processor can read them, virtually eliminating overrun errors.

At startup, Interact looks for a 16550AF UART. If it is detected, all Interact serial drivers automatically support FIFO operation.

Without 16550AF UART installed, it may not be possible to run more than one Interact serial driver at a time using baud rates greater than 4800 baud. This depends upon the processor clock speed.

If you experience communication problems when using Interact, we suggest you do one of the following:

•	install a 16550 UART (the recommended solution)

•	run at a slower baud rate


Driver Configuration
User Device Interface Driver Help Contents

This Help provides information on User Device Interface (UDI) driver. The UDI driver, along with a user-written driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations.

This Help contains instructions on how to configure the UDI driver for maximum performance, how to communicate with a user-written driver, and how to access the data it provides.

The following Help Topics are available for the User Device Interface Driver:

Introduction

Driver Configuration

Write Blocks

Read Blocks

Write Buffering

User TSR Driver

Station List

Addressing Format

Run Mode

Error Handling

Contact Information

To learn more about using online help, press F1.


Write Blocks

Use the Write Blocks page to list or add information to blocks of data that are sent to the controller. The user driver determines how this shared memory is allocated. The minimum amount of shared memory, even with no blocks defined, is eight bytes.

Use the Add button to enter new block information and the delete button to delete currently selected blocks.

Memory Type

For each write block, select the memory type that will be written to the controller. Available memory type mnemonics are defined by the user driver.

Station Number

For those user drivers that use station numbers, select the station number used with this write block. Otherwise, this parameter is not used.

Start Offset

The Start Offset parameter establishes the offset into the memory type for this write block.

Block Size

The Block Size specifies the number of data items included in the write block. The actual number of bytes depends on the data size for the selected memory type. Typically you should not overlap write blocks.


Read Blocks

Use the Read Blocks page to list or add information to blocks of data that are sent to the controller. The user driver determines how this shared memory is allocated. The minimum amount of shared memory, even with no blocks defined, is eight bytes.

Use the Add button to enter new block information and the delete button to delete currently selected blocks.

Memory Type

For each read block, select the memory type that will be written to the controller. Available memory type mnemonics are defined by the user driver.

Station Number

For those user drivers that use station numbers, select the station number used with this write block. Otherwise, this parameter is not used.

Start Offset

The Start Offset parameter establishes the offset into the memory type for this read block.

Block Size

The Block Size specifies the number of data items included in the read block. The actual number of bytes depends on the data size for the selected memory type. Typically you should not overlap read blocks.


Write Buffering

Use the Write Buffering page to assign parameters that indicate whether data written from Interact to the user driver is to be buffered, or issued and acknowledged one at a time. Individual parameter descriptions are listed below.

Wait For Writes

Use this parameter to specify that the UDI driver should wait for an acknowledge from the user driver before continuing processing.

During Run Mode, Interact modules write data to the UDI driver that, in turn, sends this data to the user driver. The UDI driver will then take one of two possible actions:

•	wait for an acknowledge from the user driver before proceeding

•	immediately return to the module.

Select the Wait For Writes check box to cause the UDI driver to wait for an acknowledge from the user driver. No additional Interact module writes will be accepted until an acknowledge from the user driver is received or a time-out occurs.

A disadvantage of selecting the Wait for Writes parameter is that additional processing time is required while waiting for the user driver's response. An advantage is that if any write errors are detected, error status is returned immediately and displayed on the object. You are aware of current write status before performing another write.

With Wait For Writes checked, the Write Buffer Size parameter is grayed out and not selectable. Operation with the Wait for Writes parameter checked is shown below.

Clearing the Wait For Writes check box will allow Interact modules to continue writing data to the UDI driver. The UDI driver will write this data to the user driver and not wait for the user driver acknowledge. This saves time and thus is the preferred method of operation.

If a module performs another write prior to the driver receiving the acknowledge from the user driver, the write request will be placed in a write buffer. The number of write requests that can be placed in this buffer is set with the Write Buffer Size parameter.

If an acknowledge is not returned from the user driver within a time-out period, an error will be returned. This is displayed on the driver screen.

Operation with the Wait for Writes parameter cleared is shown below.

Write Buffer Size

Use this parameter to specify the number of write requests that can be buffered in the driver. Click on the spin control to enter a number from 10-999. The default is 10.

This parameter works in conjunction with the Wait for Writes parameter. Clearing the Wait For Writes check box will require you to enter a value for the Write Buffer Size.

Using the default size, a "buffer full" condition is unlikely, but if it occurs, all subsequent writes will be rejected until there is room in the buffer.

Buffered writes are shown below.


User TSR Driver

Use the User TSR Driver page to configure the user driver. You can also view the location of the current user driver as well as to change to a different user driver.

TSR Driver EXE

Use this parameter to view the location of the current user driver that you are configuring.

Select Driver

Use this button to change to a different user driver. This feature automates the process of configuring multiple user drivers. The location of the active user driver appears at the top of this page.

TSR Interrupt

Use this parameter to select the interrupt that the UDI driver uses to communicate with the user driver. The valid range of interrupts is 60 through 67 hex. The default is 61.

Important   If you are developing applications for a PowerStation with a touch screen, make sure that the interrupt you select does not conflict with the one used by the touch screen driver. The touch screen driver uses interrupt 61 by default.


Station List

Use the Station List page to configure the startup status of individual station numbers. The Station List is only available for those user drivers that support station numbering.

Use the Add button to enter new block information and the delete button to delete currently selected blocks.

Use the Add button to enter the station number and startup state. To delete a previously entered station number, just highlight the entry and select the Delete button.

Station Number

Enter the station number (0 to 65535) of the device with which you wish to communicate.

Startup State

The station will default to Active for the startup condition field, thus the user driver will communicate with the station upon entering the Run Mode.

Change the startup condition field by selecting the appropriate Startup state. If Stopped is selected, the user driver will not automatically begin communications with that controller upon entering the Run Mode. Once in the Run Mode you can stop or start communications with a unit by using a selection button on the UDI driver runtime display.


Run Mode
User Device Interface Driver Help Contents

This Help provides information on User Device Interface (UDI) driver. The UDI driver, along with a user-written driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations.

This Help contains instructions on how to configure the UDI driver for maximum performance, how to communicate with a user-written driver, and how to access the data it provides.

The following Help Topics are available for the User Device Interface Driver:

Introduction

Driver Configuration

Addressing Format

Run Mode

Entering Run Mode

Clear Errors

Log Off Driver

Log On Driver

Go To AM

Control Comm

Error Handling

Contact Information

To learn more about using online help, press F1.


Entering Run Mode

After you have configured the UDI driver and installed the user driver in memory, you are ready to communicate with your controller online.

Caution   Upon entering the Run Mode, all write values in the controller's memory are forced to the tools specified preset values if presets were selected for the Startup Write Values. Preset values for the tools should be chosen carefully to ensure that processes and/or machinery are placed in a safe mode of operation when these values are written. Configure your system for safe and predictable operation in the event of unexpected power ON/OFF cycles.

In the DOS operating environment, return to the AM from the device driver Program menu by pressing Go To AM on the UDI Main Menu. When the AM Main Menu appears, press Run/Prog Mode to enter Run Mode.

Important   After pressing Run/Prog Mode, the UDI driver immediately begins communications with the user driver in order to initialize any write data. If the user driver cannot establish communications with the controller, it may take a few minutes to time-out, depending upon the number of tools configured for the application. You may press ESC or the right mouse button should you wish to abort and return to the AM.

In Run Mode, all module and driver programs specified for the application are running simultaneously. The UDI driver will begin collecting data from the user driver and pass this data on to the modules. To bring the device driver Run Mode menu into the foreground, press Go To Driver on the AM Main Menu.

Write Data Adjustment

All write data is received from Interact modules in floating point form. If the data is being written to a data type other than floating point, the data is rounded to the nearest integer value.

If the data to be written is out of range for the data type in the user driver, it is placed at the nearest limit. For example, if 35034 is sent to a memory type that accepts 16 bit signed data, then 32767 is actually written to the user driver. If a negative number is written to a memory type that accepts unsigned data (thus a minimum of zero), then zero is written instead of the negative number.


Clear Errors Button
Clear Errors

Pressing this button will clear all errors displayed on the runtime display. Also, all error references are set to 0.


Log Off Driver Button
Log Off Driver

Pressing this button will halt all communications with the controller. Data cannot be written to or read from any controller.

In the error display portion of the device driver runtime display, a time-stamped message will be displayed indicating the off-line condition.

This selection button is useful while debugging your application. It allows you to go off-line with your controller without having to return to the AM Main Menu to leave Run Mode.


Log On Driver Button
Log On Driver

Pressing this button will start communications with the controller following an off-line condition. Data can now be written to and read from any controller. A time-stamped message will be displayed indicating the on-line condition.


Go To AM Button
Go To AM

Pressing this button returns the AM to the foreground. Your application is still in runtime as indicated on the screen. To switch back to Program mode, press the Run/Prog Mode button on the AM Main Menu.


Control Comm Button
Control Comm

The Control Comm button is available only if your user driver supports station numbers. Pressing this button controls the communication status of each station number assigned during development. The UDI Comm Control menu will be displayed as shown below.

A list showing the assigned unit numbers appears on the right of the screen. To halt communications with a particular unit:

1.	Select the number; the entry is highlighted.

2.	Select the ON/OFF button to toggle the communication status.

With communications stopped, data cannot be written to or read from the station number assigned. This feature is useful if you want to halt communications with a particular station instead of halting communications with the entire system.

Changing the communication control of a particular station number will not affect the setting of the Startup State on the Station List page of the User Driver Interface (UDI) property sheet.


Error Handling
User Device Interface Driver Help Contents

This Help provides information on User Device Interface (UDI) driver. The UDI driver, along with a user-written driver, provides Interact modules with real-time data used to monitor and interface with plant floor operations.

This Help contains instructions on how to configure the UDI driver for maximum performance, how to communicate with a user-written driver, and how to access the data it provides.

The following Help Topics are available for the User Device Interface Driver:

Introduction

Driver Configuration

Addressing Format

Run Mode

Error Handling

Error Information

Error References

Driver Error Codes

Contact Information

To learn more about using online help, press F1.


Addressing Format

The address reference format is as follows:

d\ s   :   m   o   .b

d - driver_name

\ - delimiter that separates driver name from station reference number (if station numbers are supported)

s - station reference number of the destination controller (if station numbers are supported). See the topic on the Network Address List.

: - delimiter that separates station reference number from memory type

m - memory type mnemonic (these are defined by the user driver)

o - numeric offset of the element being referenced within the given memory type.

. - delimiter that separates offset from bit number

b - optional bit number


Error Information

Error messages are displayed on the runtime display so you may analyze the error that has occurred, and determine the appropriate action to be taken. There are two types of errors:

•	Driver errors: errors detected by the UDI driver in its attempt to interface with the Interact Application Manager or communicate with the user driver.

•	Device errors: errors detected by the controller or the user driver and passed back to the UDI driver. Refer to the user driver documentation for more information; these errors have no associated text.

If the same error consecutively repeats, only the first occurrence will be logged.

Driver Screen Error Format

Errors are displayed on the runtime display in the following format.

time stamp   ERROR_CLASS - ERROR_CODE   text   (ERROR_STATION)

The time stamp parameter indicates the system time at which the error occurred in 24 hour time (e.g 12:00:00 is 12:00 noon and 24:00:00 is 12:00 midnight). The Text parameter describes the error if it was a driver error. In addition there are three variables associated with each error which change simultaneously when an error occurs. These are listed below.

ERROR_CLASS - describes the error type as either UDI driver or user driver/device related. 1 = UDI driver error, 2 = user driver/device error, 0 = no error.

ERROR_CODE - describes which UDI driver or user driver/device error occurred. It will be displayed in HEX on the driver runtime display and in DECIMAL on the Interact tool displaying this error reference. Refer to the error code listing for a description of each error code.

ERROR_STATION - this variable is only available if your controller protocol supports station numbers. This variable indicates which controller station number is associated with the error. This can be any valid station number. If the error cannot be associated with a particular station number (i.e. a driver error) a -1 is returned to the Interact module.

Pressing Clear Errors on the device driver runtime display will erase all displayed errors. Also, ERROR_CLASS and ERROR_CODE values in the tool error references are set to 0. ERROR_STATION references are set to a -1.

Once an error is cleared, it is removed from memory and cannot be recalled.

Example

Assume the following error was displayed on the driver runtime display:

03:45:36 DRIVER - 04H Write Buffer Overflow

This error occurred at 03:45:36, it is a DRIVER error, error code 05H. This error indicates that the write buffer has overflowed.


Error References

An Interact module can obtain the error class, error code, or error station using error references just described. These error references allow you to view errors within an Interact module without having to display the UDI runtime display in the foreground.

To display an error class, error code, error station, or error status you must assign a reference to an object or tool. Error References are entered in the following format:

UDI\ERROR_CLASS - to obtain the error type (0 = no error, 1 = DRIVER, 2 = DEVICE).

UDI\ERROR_CODE - to obtain the error code. It will be displayed on the tool in decimal.

UDI\ERROR_STATION - to obtain the controller number. If the error cannot be associated with a particular controller, a -1 is returned to the Interact module.

UDI\ERROR_STATUS - Format required if the driver supports station numbers. It is used to obtain the communication status of the controller. If the controller is unable to communicate with the driver a 1 is returned. This could be caused by a cable problem, driver was logged off, or any other communication problem. If the controller can communicate with the driver a 0 is returned.

OR

UDI\ERROR_STATUS\<station number> - Format required if the driver supports station numbers. It is used to obtain the communication status of the controller. If the controller is unable to communicate with the driver a 1 is returned. This could be caused by a cable problem, driver was logged off, or any other communication problem. If the controller can communicate with the driver a 0 is returned. Enter the station number of the controller that communication status is desired.


Driver Error Codes

Error codes are listed in HEX. Decimal values are listed in parentheses ().

Error Code	Description
1 (1)	Memory allocation error: Insufficient memory
2 (2)	Driver was logged off: Driver was logged off by the user.
3 (3)	Driver was logged on: Driver was logged on by the user.
4 (4)	Write buffer overflow: Appears only when the Wait for Writes parameter has been cleared. Increase the Write Buffer Size parameter to correct this error.
5 (5)	Station was logged off: A station was logged off.
6 (6)	Station was logged on: A station was logged on.
F (15)	Invalid write reference: The address reference is not defined in the user driver’s write blocks.
10 (16)	Invalid read reference: The address reference is not defined in the user driver’s read blocks.
11 (17)	Data out of range error: The data received from the controller was not in range for the memory type.


Glossary

acquisition

clear_errors

comm_params

error_class

error_code

error references

error_station

log_onoff

shared memory

user driver

wait for writes

watchdog interval

watchdog reference

write buffer size


acquisition

A parameter that specifies how often read data should be acquired from the controller.


clear errors
clear_errors

A variable used in an Interact module to clear driver errors from the display.


comm params
comm_params

A variable used in PTM to list the driver configuration parameters on a panel.


error references

Special references assigned to an object or tool enabling the display of error information.


error class
error_class

Describes the error type as either driver or device related. A driver error returns a 1, a device error returns a 2, and no error returns a 0.


error code
error_code

Describes which driver or device error occurred. Displayed in HEX on the driver runtime display and in DECIMAL on the Interact tool displaying this error reference.


error log
error_log

This variable is used to display the driver error status on a PTM panel. If an error occurs error information such as the error class and error code will be displayed.


error station
error_station

Indicates which station number is associated with the error. This can be any valid station number. If the error cannot be associated with a particular number, a -1 is returned to the module. In some drivers, instead of a -1, a null string is returned.


log onoff
log_onoff

A variable used in an Interact module to control the driver log on/log off status.


shared memory

A specific amount of memory that is shared between the UDI driver and user driver. The UDI driver reads data from and writes data to this area. The user driver accesses this area and communicates with the controller. This process is shown below:


user driver

A Terminate-Stay-Resident (TSR) program that is a user-written device driver. Typically the user driver communicates with a programmable logic controller (PLC).


wait for writes

Configuration option that allows selecting if you want the device driver to wait for an acknowledge from the controller.


watchdog interval

A parameter that specifies how often the watchdog reference address is toggled.


watchdog reference

An address that can be used to monitor Interact for an online condition.


write buffer size

Configuration option that reflects the number of pending write requests.