BASEstar[TM] Classic DAS for_Siemens_H1[TM]_Protocol_________________________ Installation and User's Guide Order Number: AA-R219A-TE November 1996 This manual describes how to install and use the DAS for Siemens H1 Protocol for BASEstar Classic on OpenVMS. Revision/Update Information: This is a revised document. Operating System and Version: OpenVMS/Alpha Version 6.1 Operating System and Version: OpenVMS/VAX Version 5.5-2 Interface Software and Version:ASEstar Classic Version 3.4 Software Version: BASEstar Classic DAS for Siemens H1 Protocol, Version 3.4 Digital Equipment Corporation Maynard, Massachusetts ________________________________________________________________ November 1996 Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Digital or an authorized sublicensor. Digital Equipment Corporation makes no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description. © Digital Equipment Corporation 1991, 1996. All Rights Reserved. The following are trademarks of Digital Equipment Corporation: Alpha, BASEstar, Digital, OpenVMS, TK, VAX, and the Digital logo. H1, Simatic, and SINEC are trademarks of Siemens AG. All other trademarks and registered trademarks are the property of their respective holders. This document is available on CDROM. This document was prepared using DEC DOCUMENT Version 3.0. _________________________________________________________________ Contents Preface................................................... v 1 Overview of Siemens Device Access Software 1.1 Description................................... 1-1 1.2 Device Communications......................... 1-1 1.3 Supported Functions and Devices............... 1-2 2 Installing the DAS for Siemens H1 Protocol 2.1 Installation Requirements..................... 2-1 2.1.1 Hardware Requirements..................... 2-2 2.1.2 Software Requirements..................... 2-2 2.1.3 Disk Space Requirements................... 2-3 2.2 Installing the DAS for Siemens H1 Protocol.... 2-4 2.2.1 Files Created During Installation......... 2-6 2.2.2 Installation Messages..................... 2-7 2.3 Post Installation Tasks....................... 2-9 2.3.1 Editing the Configuration File............ 2-9 2.3.1.1 Editing Type Records.................... 2-9 2.3.1.2 Editing Path Records.................... 2-10 2.3.1.3 Editing Device Records.................. 2-11 2.3.1.4 DAS for Siemens H1 Protocol Configuration File...................... 2-13 2.3.2 Configuring DECnet/OSI Parameters......... 2-14 2.3.3 DAS SPT Block Usage....................... 2-18 2.3.4 Setting Up Plant Floor Equipment.......... 2-19 iii 3 Using the DAS for Siemens H1 Protocol 3.1 Accessing DAS for Siemens H1 Protocol Functions..................................... 3-1 3.2 Supported Functions........................... 3-2 3.2.1 TSAPs, Establishing Communications........ 3-4 3.2.2 Control Operations........................ 3-5 3.2.2.1 Control Operation Communications........ 3-5 3.2.2.2 Model S135U Communications.............. 3-6 3.2.2.3 Common Steps............................ 3-6 3.2.2.4 Start and Stop.......................... 3-7 3.2.2.5 Upload and Download..................... 3-8 3.2.2.6 Read Status............................. 3-9 3.2.3 Read and Write Data....................... 3-11 3.2.4 Operations on the Unsolicited TSAP........ 3-13 3.2.4.1 Send and Receive Data................... 3-13 3.2.4.2 Read and Write Data..................... 3-14 3.3 Automatic Data Collection..................... 3-17 3.3.1 Unsolicited Data.......................... 3-17 3.3.2 Pollsets.................................. 3-18 A DAS for Siemens H1 Protocol Returned Values and Associated Error Messages A.1 NI Related Returned Codes..................... A-1 A.2 PE Related Returned Codes..................... A-2 B Sending and Receiving Data Using ILAN$DEVICE_SPECIFIC C Data exchange using the UNSOLICITED TSAP C.1 Read Operation................................ C-2 C.2 Acknowledged Write Operation.................. C-3 C.3 Non Acknowledged Write Operation.............. C-4 C.4 Unsolicited messages.......................... C-4 iv Index Examples 2-1 NULL Internet OSI Transport Template...... 2-15 2-2 OSI Transport............................. 2-16 Figures 1-1 DAS for Siemens H1 Protocol Communications............................ 1-2 Tables 1-1 Siemens Devices and Supported Functions... 1-3 2-1 Disk Space Requirements................... 2-4 2-2 Files Created During Installation......... 2-7 2-3 CREATE TYPE............................... 2-10 2-4 CREATE_PATH............................... 2-11 2-5 CREATE DEVICE............................. 2-11 2-6 OSI Transport Template Parameters......... 2-15 2-7 OSI Transport Parameters.................. 2-15 3-1 Siemens Devices and Supported Functions... 3-2 3-2 Data Block Addressing..................... 3-13 v _________________________________________________________________ Preface This document describes how to install and use the BASEstar Classic DAS for Siemens H1 Protocol. Intended Audience This document is intended for use by system managers who must set up and maintain the following: o BASEstar Classic for OpenVMS software o BASEstar Classic DAS for Siemens H1 Protocol software This document is also intended for use by application programmers who develop plant-floor management software layered on BASEstar Classic software. Readers of this document should have a solid understanding of OpenVMS operations and administration, as well as OpenVMS application software. In addition, knowledge of Seimens Siemens programmable controllers and the specific requirements of the installation site is essential. Document Structure This document is organized as follows: o Chapter 1 provides an overview of the DAS for Siemens H1 Protocol. o Chapter 2 provides information you need to install the DAS for Siemens H1 Protocol. o Chapter 3 provides information about the supported functions for Siemens programmable controllers, and how to access the functions. v Associated Documents Further information on topics covered in this document can be found in the following documents: o BASEstar Classic Installation Guide o BASEstar Classic Configuration and Tuning Guide o BASEstar Classic Menu Interface User's Guide o BASEstar Classic Command Line Interface User's Guide o BASEstar Classic Introduction to Callable Services o BASEstar Classic Guide to Writing Device Access Software o BASEstar Classic Application Programming Interface Reference Guide Information on DECnet/OSI installation, configuration and programming can be found in the following documents. o DECnet/OSI for OpenVMS Installation and Configuration o DECnet/OSI for OpenVMS Introduction and Planning o DECnet/OSI for OpenVMS Network Management o DECnet/OSI for OpenVMS Common Trace Facility Use o DECnet/OSI for OpenVMS Programming Refer also the documentation produced by Siemens for the SH1 Type S115U, SH1 Type S135U, SH1 Type S150U and SH1 Type S150U programmable controllers. Conventions This manual uses the following conventions: Boldface Highlights user input within textual descriptions. Press the key labeled Return. Unless otherwise specified, press after entering a command or responding to a prompt. Enter Type the words or symbols described and press . vi 1 _________________________________________________________________ Overview of Siemens Device Access Software This chapter provides an overview of the BASEstar Classic DAS for Siemens H1 Protocol. It also includes a brief description of Siemens devices and the supported functions for the DAS. 1.1 Description The DAS for Siemens H1 Protocol allows you to access Siemens devices using the H1 protocol through BASEstar Classic device connection management. Device connection management is a component of BASEstar Classic software, which is an engineered family of software components and services that facilitate the development and integration of manufacturing automation solutions. Using the DAS for Siemens H1 Protocol, users or applications can perform a variety of device access functions for the Siemens family of devices using the H1 protocol. Examples of functions supported for the Siemens devices include: reading and writing data, uploading and downloading logic programs, and reading the status of a device. 1.2 Device Communications The DAS for Siemens H1 Protocol consists of a Protocol Emulator (PE) and a Network Interface (NI). PEs and NIs work together to provide device-specific communications for BASEstar Classic's generic callable services. The PE translates BASEstar Classic device connection management generic services into device-understandable format. The PE also converts device-specific protocol into BASEstar Classic device connection management format. The NI works directly with an OpenVMS driver to send data to and receive data from plant-floor devices. The NI Overview of Siemens Device Access Software 1-1 Overview of Siemens Device Access Software 1.2 Device Communications communicates the requests and data translated by the PE. Figure 1-1 shows how the DAS facilitates communications between device connection management and the device. The DAS for Siemens H1 Protocol must be installed on an OpenVMS host that is connected to Siemens programmable controllers using an Ethernet backbone. Optionally, one may introduce an Ethernet bridge to separate the Ethernet traffic in the computer room from the Ethernet traffic on the plant floor. The OpenVMS host and the programmable controller communicate using the first four layers of the ISO/OSI standard. On the OpenVMS side this is done using the OSI Transport Services application programming interface. Figure 1-1 DAS for Siemens H1 Protocol Communications 1.3 Supported Functions and Devices You can perform only the BASEstar Classic device connection management functions that are supported by a device's PE. These functions can be accessed through BASEstar Classic library management and BASEstar Classic device connection management menu system, commands, and callable services. The DAS for Siemens H1 Protocol supports the following BASEstar Classic device connection management functions: o Start and stop operations on a device o Upload the contents of a device's memory to a OpenVMS file o Download a OpenVMS file to a device's memory o Read data from a specific address in a device's memory o Write data to a specific address in a device's memory o Read status for a device 1-2 Overview of Siemens Device Access Software Overview of Siemens Device Access Software 1.3 Supported Functions and Devices The DAS for Siemens H1 Protocol supports Siemens programmable controllers model S115U, S135U, S150U and S155U. The S135U programmable controllers may be configured with a single type "S" or type "R" CPU. This programmable controller must include at least one CP-535 Ethernet communications card. For model S150U programmable controllers it is recommended that a CP-511 serial communications card is also used. The DAS for Siemens H1 Protocol supports a variety of devices, as shown in Table 1-1. Table_1-1_Siemens_Devices_and_Supported_Functions________________ Read Write Read Device______Upload__DownloadStart___Stop____Data____Data____Status S115U X X X X X X X S135U X X X X X X X S150U X X X X X X X S155U_________________________________________X_______X__________ For more information about the supported functions, refer to Chapter 3 of this document. Overview of Siemens Device Access Software 1-3 2 _________________________________________________________________ Installing the DAS for Siemens H1 Protocol This chapter provides the information you need to install the DAS for Siemens H1 Protocol and to configure your system. 2.1 Installation Requirements The DAS for Siemens H1 Protocol can be installed by a system manager who has access to an account with the SYSPRV privilege. However, modifications to the hardware configuration of the host must be done by trained Digital service personnel. The installation takes 1 to 5 minutes depending on distribution media and system configuration, and is carried out using the standard OpenVMS utility VMSINSTAL. You only need to respond to simple YES or NO questions during the installation. Review the following hardware and software requirements to ensure that your system is prepared for the DAS installation. ________________________ Note ________________________ Back up the disks on your system before installing this software. This will provide a method to restore your system in the event of an installation problem. The procedure for backing up disks is described in the OpenVMS System Management Utilities Reference Manual. ______________________________________________________ Installing the DAS for Siemens H1 Protocol 2-1 Installing the DAS for Siemens H1 Protocol 2.1 Installation Requirements 2.1.1 Hardware Requirements The DAS for Siemens H1 Protocol communicates with Siemens programmable controllers using the H1 protocol over Ethernet. The DAS for Siemens H1 Protocol requires the same hardware as BASEstar Classic device connection management. For more information on hardware requirements, see the BASEstar Classic Installation Guide. The same Ethernet controller may be shared between DECnet and the DAS for Siemens H1 Protocol. Siemens model S135 programmable controllers are multiprocessor programmable controllers. They allow multiple CPUs to coexist in the same programmable controller. There is one MUX/Coordinator card which coordinates data traffic between the CPUs and to the Ethernet communication card. When performing control operations such as upload or download, it is necessary to connect a special RS-232 cable between the Ethernet communications card and the CPUs or between the Ethernet communications card and the Coordinator. If the RS-232 cable is connected to the Coordinator card, then control operations may be performed to any one of the CPUs. ________________________ Note ________________________ It is recommended that the DIP switch on the Coordinator card is set so that the leftmost CPU is addressed as CPU number 1. Also, the toggle switch of the Coordinator should be set to RUN or TEST mode. ______________________________________________________ If the RS-232 cable is connected directly to the CPU card, then all control operations are restricted to that CPU only. 2.1.2 Software Requirements Before installing the DAS for Siemens H1 Protocol, the following software must already be installed: - OpenVMS Version 5.5-2 or higher (VAX) - OpenVMS Version 6.1 or higher (Alpha) 2-2 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.1 Installation Requirements - VAX/FMS Version 2.3 or Version 2.4 (required only when the menu system will be used) (The Menu System is available only on OpenVMS/VAX systems.) - BASEstar Classic for OpenVMS, Version 3.4 or higher - DECnet/OSI, Version 5.6B or higher (VAX) - DECnet/OSI, Version 5.7 or higher (Alpha) For information on installing the above software, see the BASEstar Classic Installation Guide and DECnet/OSI for OpenVMS Installation and Configuration. The minimum required version of DECnet/OSI is different for the various versions of OpenVMS. Refer to DECnet/OSI for OpenVMS Installation and Configuration for the minimum required version of OpenVMS required for the version of DECnet/OSI being installed. ________________________ Note ________________________ Before using this product on a system, you must first register a License Product Authorization Key (License PAK) using the License Management Facility (LMF). For more information about the License Management Utility, refer to the License Management Utility Manual for OpenVMS. ______________________________________________________ 2.1.3 Disk Space Requirements Table 2-1 lists the disk space required to install the DAS for Siemens H1 Protocol. The space requirements are approximations; actual sizes may vary depending on your system environment, configuration, and software options selected. Installing the DAS for Siemens H1 Protocol 2-3 Installing the DAS for Siemens H1 Protocol 2.1 Installation Requirements Table_2-1_Disk_Space_Requirements__________________________ Peak/Net_Usage____________Approximate_Space_Requirements___ Peak usage (during 500 blocks (VAX) installation) 600 blocks (Alpha) Net usage (after 300 blocks (VAX) installation) ________________________________400_blocks_(Alpha)_________ 2.2 Installing the DAS for Siemens H1 Protocol When your system meets all the hardware and software requirements, you can install the DAS for Siemens H1 Protocol. The installation takes from 1 to 5 minutes, depending on system load and configuration. Install the DAS for Siemens H1 Protocol using the following steps: 1. Log in to a privileged system manager's account. 2. Set the default directory to SYS$UPDATE: $ SET DEFAULT SYS$UPDATE 3. Invoke VMSINSTAL: $ @SYS$UPDATE:VMSINSTAL DCM_H1VV034 ddcu: The DCM_H1VA034 argument is the kit name. The 034 portion of the name is the version number. The ddcu argument represents the name of the device on which the installation media is mounted, where: o dd is the device code o c is the controller designation o u is the unit number VMSINSTAL prompts you for information during the installation. Note that DECnet does not need to be running in order to perform the installation procedure. The following is an example of the output from the installation. 2-4 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.2 Installing the DAS for Siemens H1 Protocol OpenVMS AXP Software Product Installation Procedure V6.1 It is 17-OCT-1996 at 13:23. Enter a question mark (?) at any time for help. * Are you satisfied with the backup of your system disk [YES]? The following products will be processed: DCM_H1VA V3.4 Beginning installation of DCM_H1VA V3.4 at 13:23 %VMSINSTAL-I-RESTORE, Restoring product save set A ... %VMSINSTAL-I-RELMOVED, Product's release notes have been moved to SYS$HELP. Copyright (C) Digital Equipment Corporation 1991, 1996. All rights reserved. Restricted Rights: Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR 52.227-14 Alt. III, as applicable. This software is proprietary to and embodies the confidential technology of Digital Equipment Corporation. Possession, usr, or copying of this software and media is authorized only pusuant to a valid written license from Digital or an authorized sublicensor. BASEstar Classic DAS for Siemens H1 Protocol installation procedure. Checking for a valid license... Product: DAS-SH1-CL Producer: DEC Version: 3.4 Release Date: 26-NOV-1996 * Does this product have an authorization key registered and loaded? y Now checking OpenVMS version... Now checking that network software is installed... Now checking that BASEstar Classic is installed... Installing the DAS for Siemens H1 Protocol 2-5 Installing the DAS for Siemens H1 Protocol 2.2 Installing the DAS for Siemens H1 Protocol Now checking disk space... * Do you want to purge files replaced by this installation [YES]? * Do you want to run the IVP after the installation [YES]? The installation procedure has no further questions to ask and will complete in 1 to 5 minutes depending on the system and system load. The configuration template file for Siemens H1 support, DCM_H1_CONFIG.TEMPLATE, is used to define the Siemens paths, types, and devices. Edit this file, as necessary, to reflect your specific site configuration. During installation it will be placed in the directory BCC$SYSDATA. %VMSINSTAL-I-MOVEFILES, Files will now be moved to their target directories... Copyright (C) Digital Equipment Corporation 1991, 1996. All rights reserved. Executing the Installation Verification Procedure. BASEstar Classic DAS for Siemens H1 Protocol installation procedure has succeeded. Installation of DCM_H1VA V3.4 completed at 13:24 Adding history entry in VMI$ROOT:[SYSUPD]VMSINSTAL.HISTORY Creating installation data file: VMI$ROOT:[SYSUPD]DCM_H1VA034.VMI_DATA VMSINSTAL procedure done at 13:24 2.2.1 Files Created During Installation Table 2-2 lists the files that the DAS for Siemens H1 Protocol installation procedure creates and the directories in which they are placed. 2-6 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.2 Installing the DAS for Siemens H1 Protocol Table_2-2_Files_Created_During_Installation________________ Directory________Filename__________________________________ BCC$SYSDATA: DCM_H1_CONFIG.TEMPLATE SYS$LIBRARY: ILAN_SH1.EXE ILAN_VOTS.EXE SYS$HELP: DCM_H1DCM_H1VV034.RELEASE_NOTES (VAX) DCM_H1DCM_H1VA034.RELEASE_NOTES (Alpha) SYS$TEST:________DCM_H1$IVP.COM____________________________ 2.2.2 Installation Messages You may see VMSINSTAL messages during the installation procedure. The following messages are specific to the DAS for Siemens H1 Protocol installation: BADBCC, BASEstar Classic software must be installed before DAS for Siemens H1 Protocol. Explanation: Error. Incorrect version of or missing BASEstar Classic software. User Action: Install BASEstar Classic for OpenVMS, Release 3.4 or higher software. BADDCM, BASEstar Classic Device Connect must be installed before the DAS for Siemens H1 Protocol. Explanation: Error. Incorrect version of or missing BASEstar Classic DCM software. User Action: Install BASEstar Classic DCM for OpenVMS, Release 3.4 or higher software. BADDECNET, A valid version of DECnet must be installed before the DAS for Siemens H1 Protocol. Explanation: Error. Incorrect version of DECnet/OSI software. User Action: Install DECnet/OSI software Version 5.6B (VAX) or Version 5.7 (Alpha) or higher. Installing the DAS for Siemens H1 Protocol 2-7 Installing the DAS for Siemens H1 Protocol 2.2 Installing the DAS for Siemens H1 Protocol BADVMS (VAX), The DAS for Siemens H1 Protocol must be installed under OpenVMS V5.5-2 or greater. Explanation: Error. Incorrect version of OpenVMS. User Action: Install OpenVMS V5.5-2 or higher. BADVMS (Alpha), The DAS for Siemens H1 Protocol must be installed under OpenVMS V6.1 or greater. Explanation: Error. Incorrect version of OpenVMS. User Action: Install OpenVMS V6.1 or higher. NETBLOCKS (VAX), DAS for Siemens H1 Protocol requires 300 blocks after installation. Explanation: Error. Not enough disk space to complete installation. User Action: Delete any unnecessary files, then reinstall. NETBLOCKS (Alpha), DAS for Siemens H1 Protocol requires 400 blocks after installation. Explanation: Error. Not enough disk space to complete installation. User Action: Delete any unnecessary files, then reinstall. NOLICENSE, No license found for this product - IVP will not be run., Explanation: Informational. A valid license was not found. The installation will continue, but the IVP will not be run. User Action: Register and load a valid license for this product before attempting to use the DAS. NOLOAD, License for this product not loaded - IVP will not be run., Explanation: Informational. The license for this product has not been loaded by the License Management Utility. The installation willl proceed, but the IVP will not be run. User Action: Load the license using the License Management Utility before attempting to use the DAS. 2-8 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks 2.3 Post Installation Tasks This section describes the tasks to perform after installing the DAS for Siemens H1 Protocol, including editing the configuration file, setting the device connection management support block parameter, configuring ports and setting up plant floor equipment. 2.3.1 Editing the Configuration File A configuration file, BCC$SYSDATA:DCM_H1_CONFIG.TEMPLATE, is supplied with the kit. The configuration file contains definitions for types, paths, and devices. A type record represents a Protocol Emulator (PE). A path record represents a Network Interface (NI). Copy the template file, edit this file to include site-specific information about types and paths, and execute the file. The following sections give examples of the type, path, and device records. See the BASEstar Classic Command Line Interface User's Guide for more information about creating type, path, and device definitions. 2.3.1.1 Editing Type Records The following example shows the type records created by the configuration file. create type SH1_TYPE_S115U /manuf = SIEMENS /model = S115U- /proto = SH1 /descr = SH1_CPU_S115U create type SH1_TYPE_S135U /manuf = SIEMENS /model = S135U- /proto = SH1 /descr = SH1_CPU_S135U create type SH1_TYPE_S150U /manuf = SIEMENS /model = S150U- /proto = SH1 /descr = SH1_CPU_S150U create type SH1_TYPE_S155U /manuf = SIEMENS /model = S155U- /proto = SH1 /descr = SH1_CPU_S155U Table 2-3 lists the types and parameters of the CREATE TYPE command, and indicates the parameters of the previous example that you can change. Installing the DAS for Siemens H1 Protocol 2-9 Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Table_2-3_CREATE_TYPE______________________________________ Type_____________Parameter________Modifiable?______________ SH1_TYPE_S115U Manufacturer No Model No Protocol No Description Yes SH1_TYPE_S135U Manufacturer No Model No Protocol No Description Yes SH1_TYPE_S150U Manufacturer No Model No Protocol No Description Yes SH1_TYPE_S155U Manufacturer No Model No Protocol No _________________Description_________Yes___________________ 2.3.1.2 Editing Path Records The following example shows the path records created by the configuration file. create path OSI_PATH /netn = VOTS /multidrop- /vaxport = "_OS:" /io_size = 1024 /retries = 0 /descr = OSI_PATH Table 2-4 lists the paths and parameters of the CREATE PATH command, and indicates the parameters of the previous example that you can change. Verify that the VAXport and the line parameters match your plant-floor configuration. 2-10 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Table_2-4_CREATE_PATH______________________________________ Path__________________Parameter___Modifiable?______________ OSI_PATH Vaxport Yes Netname No Multidrop No IO size No ______________________Retries________No____________________ 2.3.1.3 Editing Device Records The following example shows the device records created by the configuration file. create device S150_DEVICE /type = SH1_TYPE_S150U / path = OSI_PATH - /neta = "H1NET%080006010001:(R=READREAD,W=WRITWRIT)" Table 2-5 lists the devices and parameters of the CREATE DEVICE command, and indicates the parameters of the previous example that you can change. Table_2-5_CREATE_DEVICE____________________________________ Device________________Parameter___Modifiable?______________ S150_DEVICE Path No Type No Description Yes Timeout Yes ______________________Netaddr________Yes___________________ Device address format When configuring the Siemens device, the network address qualifier must reflect the address of the programmable controller. This network address must at least contain the OSI transport template name used by DECnet/OSI and the Ethernet address of the device. It has the following format: osi_template_name%Ethernet_address: Installing the DAS for Siemens H1 Protocol 2-11 Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks For example: H1NET%080006000001: Note that the OSI transport template name and Ethernet address are separated by " % " and that the Ethernet address must be terminated by " : ". Optionally, up to five Transport Service Access Points (TSAPs) may be added to define the read, write, unsolicited or command channels and to define the calling TSAP. o R defines the TSAP for the read channel. It has no default value. This channel is used for read operations. o W defines the TSAP for the write channel. It has no default value. This channel is used for write operations. o U defines the TSAP for the unsolicited channel. It has no default value. This channel is used for unsolicited operations. o C defines the TSAP for the command channel. Its default value is S5PGCONN. This channel is used for command operations (upload, download, stop, start,...) o O defines the calling TSAP on the host. Its default value is VAXVAXVA. For example: H1NET%080006000001:(R=READREAD) H1NET%080006000001:(U=UNSOLUNS) H1NET%080006000001:(R=READTSAP,W=WRITTSAP) H1NET%080006000001:(R=MY_TSAP1,W=MY_TSAP2,U=MY_TSAP3) These TSAPs must also be defined on the CP-535 card of the programmable controller. The names of the TSAPs must be up to 8 uppercase characters, left justified, blanks padded on the right. They are enclosed in parenthesis and separated by commas. The unsolicited TSAP is always accessed as soon as the device is enabled, and is always deaccessed when the device is disabled. It is a "permanent" TSAP. The command TSAP is a "temporary" TSAP. It is accessed when the command operation starts, and deaccessed when the command operation completes. 2-12 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks By default, the read TSAP and the write TSAP are "permanent" TSAPs. It is possible to make them "temporary", by defining them with TR and TW instead of R and W. For example: H1NET%080006000001:(TR=TEMPREAD) H1NET%080006000001:(R=SIEMENSR,TW=SIEMENSW) H1NET%080006000001:(TR=TMP_READ,TW=TMP_WRIT) The NSAP definition on the programmable controller may be ignored. The network address is limited to 54 characters. If the OSI transport template length + ethernet address length + TSAP lengths is larger than 54 characters then the TSAPs must be defined as described below: Additional TSAPs may be defined using a system logical name. The name of this logical is made of the OSI transport template name used by DECnet/OSI and the Ethernet address of the device, separated by a $ . For example: DEFINE/SYSTEM H1NET$080006000001 "(C=CDE_TSAP,O=OWN_TSAP)" 2.3.1.4 DAS for Siemens H1 Protocol Configuration File The following is an example of the DAS for Siemens H1 Protocol configuration file. $! $! This file is a template for the definitions needed for the $! BASEstar Classic DAS for Siemens H1 Protocol. $! $ $ BSTAR DCM create type SH1_TYPE_S115U /manuf = SIEMENS /model = S115U- /proto = SH1 /descr = SH1_CPU_S115U create type SH1_TYPE_S135U /manuf = SIEMENS /model = S135U- /proto = SH1 /descr = SH1_CPU_S135U create type SH1_TYPE_S150U /manuf = SIEMENS /model = S150U- /proto = SH1 /descr = SH1_CPU_S150U create type SH1_TYPE_S155U /manuf = SIEMENS /model = S155U- /proto = SH1 /descr = SH1_CPU_S155U Installing the DAS for Siemens H1 Protocol 2-13 Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks create type SH1_COMPATIBLE /manuf = UNKNOWN /model = H1_COMPATIBLE- /proto = SH1 /descr = "Any device supporting H1 protocol on Ethernet" create path OSI_PATH /netn = VOTS /multidrop- /vaxport = "_OS:" /io_size = 1024 /retries = 0 /descr = OSI_PATH create device S150_DEVICE /type = SH1_TYPE_S150U- /path = OSI_PATH /neta = "H1NET%080006010001:(R=READREAD,W=WRITWRIT)" modi device S150_DEVICE /timeout = 3600 $ $ exit For more information about maintaining type, path, and device definitions, refer to the BASEstar Classic Command Line Interface User's Guide. 2.3.2 Configuring DECnet/OSI Parameters Use SYS$STARTUP:NET$CONFIGURE to configure your OSI Transport Template for Siemens communications. ________________________ Note ________________________ Be sure to configure the template as a NULL Internet transport template. ______________________________________________________ Table 2-6 gives a list of recommended OSI transport template parameters. Table 2-7 gives a list of OSI transport parameters that may need to be modified for your intallation. These parameters are explained in detail in the DECnet/OSI documentation. Some are inter-dependent so that modifying one parameter may require changing other ones also. 2-14 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Table_2-6_OSI_Transport_Template_Parameters________________ Parameter________Recommended_Value[1]______________________ Keepalive Time 3[2] Retransmit 2[2] Threshold CR Timeout 5 ER Timeout 5 [1]The_values_of_these_parameters_depends_on_your_specific_ network configuration and expected response times. [2]The product of these values must be lower than the /TIMEOUT value on the device definition. ___________________________________________________________ Table_2-7_OSI_Transport_Parameters_________________________ Parameter__________________________________________________ Maximum Transport Connections Maximum_Remote_NSAPs_______________________________________ Example 2-1 shows an example OSI transport template configured for NULL Internet. Example 2-1 NULL Internet OSI Transport Template NCL>sho osi transport template h1net all Node 0 OSI Transport Template h1net at 1996-10-17-14:49:41.446-04:00Iinf Identifiers Name = h1net Characteristics (continued on next page) Installing the DAS for Siemens H1 Protocol 2-15 Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Example 2-1 (Cont.) NULL Internet OSI Transport Template Keepalive Time = 60 Retransmit Threshold = 8 Initial Retransmit Time = 5 CR Timeout = 30 ER Timeout = 30 Network Service = CLNS Security = Classes = { 4 } Checksums = True Maximum NSDU Size = 2048 Expedited Data = True CONS Template = Use CLNS Error Reports = True Acknowledgement Delay Time = 1 Local NSAP = CLNS Inactive Area Address = { 49::FF-00 } Inbound = True Loopback = False Send Implementation Id = True Extended Format = True Network Priority = 0 Send Preferred maximum TPDU size = True Send Request Acknowledgement = True RFC1006 Port Number = 102 Example 2-2 shows an example OSI transport definition. Example 2-2 OSI Transport (continued on next page) 2-16 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Example 2-2 (Cont.) OSI Transport NCL>sho osi transport all char Node 0 OSI Transport at 1996-10-17-14:57:47.388-04:00Iinf Characteristics Maximum Transport Connections = 200 Maximum Receive Buffers = 4000 Delay Weight = 5 Delay Factor = 4 Maximum Window = 20 Maximum Multiplexing = 4294967295 Disconnect Holdback = 0 Maximum Network Connections = 4294967295 ISO Version = 1 Version = V1.1.0 CONS Classes Supported = { 0 , 2 , 4 } CLNS Classes Supported = { 4 } Support MAP = False Maximum Remote NSAPs = 201 NSAP Selector = 33 CONS Filters = { "OSI Transport" } Congestion Avoidance = False CONS NSAP Addresses = { } Maximum RFC1006 Connections = 4294967295 RFC1006 Listener Ports = { (continued on next page) Installing the DAS for Siemens H1 Protocol 2-17 Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks Example 2-2 (Cont.) OSI Transport 102 } Out Of Order Cache Size = 10 Furthermore there is a similar set of parameters pre- defined for the Siemens CP-535 communications card. The parameters on the host must match the pre-defined parameters on the Siemens CP-535. Setting the parameters at the recommended values will allow normal communications with the Siemens programmable controller. It is possible to choose other values for these parameters depending on your special network requirements. However, please consult DECnet/OSI documentation carefully before changing any of these parameters. 2.3.3 DAS SPT Block Usage The ILAN$MAX_SPT_REQUESTS parameter specifies the maximum number of blocks allocated in the SPT global section. To set this parameter, perform the following steps: 1. Approximate the SPT blocks for this DAS by using the following formula: SPT = 1 + num_paths + (6 * num_devices) The num_paths argument is the number of paths defined in the configuration file. The num_devices argument is the number of Siemens devices defined. The SPT argument is the approximate number of blocks for the DAS for Siemens H1 Protocol. 2. Use the SPT to calculate the total block requirements for the ILAN$MAX_SPT_REQUESTS parameter. See the BASEstar Classic Configuration and Tuning Guide for instructions on calculating the total block requirements. 2-18 Installing the DAS for Siemens H1 Protocol Installing the DAS for Siemens H1 Protocol 2.3 Post Installation Tasks 2.3.4 Setting Up Plant Floor Equipment To set up your plant floor equipment, see the Siemens documentation for your specific device. Installing the DAS for Siemens H1 Protocol 2-19 3 _________________________________________________________________ Using the DAS for Siemens H1 Protocol This chapter provides information about the supported functions for Siemens devices, and how to access these functions. 3.1 Accessing DAS for Siemens H1 Protocol Functions DAS for Siemens H1 Protocol functions are accessed through the BASEstar Classic device connection management: o Commands o Menu system o Callable services To use the BASEstar Classic device connection management commands, enter the following command at the DCL prompt ($): $ BSTAR DCM For more information about the BASEstar Classic device connection management commands, refer to the BASEstar Classic Command Line Interface User's Guide. To use the BASEstar Classic device connection management menu system, enter the following command: $ BSTAR/MENU ________________________ Note ________________________ The menu system is available on OpenVMS/VAX systems only. ______________________________________________________ For information about the BASEstar Classic device connection management menu system, refer to the BASEstar Classic Menu Interface User's Guide. Using the DAS for Siemens H1 Protocol 3-1 Using the DAS for Siemens H1 Protocol 3.1 Accessing DAS for Siemens H1 Protocol Functions For information about the BASEstar Classic device connection management callable services, refer to the BASEstar Classic Application Programming Interface Reference Guide. 3.2 Supported Functions This section describes the functions that are supported by the DAS for Siemens H1 Protocol. It explains how these operations are performed from the point of view of the host and from the point of view of the programmable controller. The more complex control operations such as upload, download, start, stop, status are explained in greater detail outlining as much as possible the steps involved. Table 3-1 shows the Siemens devices and the functions supported for them. Table_3-1_Siemens_Devices_and_Supported_Functions________________ Read Write Read Device______Upload__DownloadStart___Stop____Data____Data____Status S115U X X X X X X X S135U X X X X X X X S150U X X X X X X X S155U_________________________________________X_______X__________ The host and the Siemens programmable controller are interconnected using Ethernet. The basic communications are carried using the first four layers of the ISO/OSI communications reference model. On the host side this is done using DECnet/OSI which implements the first four layers. DECnet/OSI provides the basic communication environment for data exchange. As such it allows for programs such as DAS for Siemens H1 Protocol to establish Transport connections with the Siemens programmable controller, and then to exchange data packets to transfer information. These data packets are encoded according to the Siemens specific protocol called H1. The DAS for Siemens H1 Protocol implements the H1 protocol to send commands to the programmable controller to obtain data, to understand the meaning of the data, and to make it available to application programs on the host. 3-2 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions For upload or download operations, the application program provides the DAS for Siemens H1 Protocol with the name of a file on the host. The DAS for Siemens H1 Protocol then sends the file to the memory of the programmable controller. From the point of view of the programmable controller there are several cards which cooperate to execute the operations. First, there is the CPU and the memory card. Next there is the CP-535 Ethernet communications card which connects the programmable controller to the Ethernet backbone. For normal read or write operations, the CP-535 exchanges data with the CPU using a special dual-port RAM. Normally this dual-port RAM needs to be synchronized between the CP-535 and the CPU. Please refer to the appropriate Siemens documentation for the required programming steps on the CPU of the programmable controller to do this. For control operations such as upload, download, status, start and stop, the CPU is sometimes stopped and thus the dual-port RAM is inoperable. In this case, a second communication card is used, the CP-511. This is an RS- 232 based communication card which is able to communicate directly with the CPU even when the CPU is stopped. The CP-535 and the CP-511 cards are interconnected using a special cable. The control operation is sent from the host to the CP-535, the CP-535 sends it to the CP-511 which then forwards the operation to the CPU. For model S135U programmable controllers, the CP-511 card is not required as the CPU card itself may be connected directly to the CP-535. Model S135U programmable controller allows for multiple CPU cards within the same programmable controller. To coordinate between the CPUs, there is a special Coordinator /MUX card. In this configuration, read and write operations are done as before using the dual-port RAM and data is exchanged with the host as before. Using the DAS for Siemens H1 Protocol 3-3 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions For control operations, the special RS-232 cable must be connected between the CP-535 and any of the CPUs or between the CP-535 and the Coordinator. When the cable is connected directly to the CPU, the programmable controller appears to the host as a uniprocessor programmable controller. When the special RS-232 cable is connected to the Coordinator card, then control operations may be performed to any of the CPUs. Thus it is not necessary to move the cable from one CPU to the other to upload the contents of any CPUs in the programmable controller. In the case uploads may be performed remotely without having to move the cable between the CP-535 and each of the CPUs in the programmable controller. 3.2.1 TSAPs, Establishing Communications The transport service provides transport users with the means to set up, transfer data across and conclude transport connections. The transport connection is a two- way data transfer path between two transport users. On the programmable controller side the transport user is the CP- 535 communication card. On the host side the transport user is the DAS for Siemens H1 Protocol. Each transport user is associated with a TSAP. Application programs do not need to have separate TSAPs. They do not establish a transport connection directly to the programmable controller. They all use the transport connection established between the programmable controller and the DAS for Siemens H1 Protocol. The number of available TSAPs is a limited resource both on the host and especially on the programmable controller. Therefore, all application programs on the same host use only one channel. The name of the TSAP on the host is fixed by default as VAXVAXVA . The host may connect with up to three TSAPs on the programmable controller. Available TSAPs are the READ, WRITE, and UNSOLICITED TSAPs. The READ TSAP is used to read data from the programmable controller. The WRITE TSAP is used to write data to the programmable controller. The UNSOLICITED TSAP is used to send or receive data packets. 3-4 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions In addition to these there is a fixed command TSAP on the programmable controller which is used for control operations such as upload, download, start, stop and status. The name of this command TSAP is fixed by default as S5PGCONN . There can only be one connection at a time to this special TSAP. The programmable controller allows only one user or application program at a time to do upload, download, status, etc. All the TSAPs names are configurable. On the host this is specified as part of the /NETADDR qualifier of the device definition. See Section 2.3 for further information. 3.2.2 Control Operations The control operations implemented with DAS for Siemens H1 Protocol are upload, download, start, stop, and status. Only one application program or user may do one of these at any time. 3.2.2.1 Control Operation Communications For control operations a special TSAP is used. This is predefined and may be changed. When doing control operations, the CPU is sometimes stopped and thus the dual port RAM is non-operative. These control operations are NOT supported for S155U programmable controllers. To do control operations one needs to use the CP-511 communication card which can communicate with the CPU even when it is stopped. In this configuration, the host is connected to the CP-535 card via Ethernet. The CP-535 is connected to the CP-511 by an RS-232 cable, and the CP-511 communicates with the CPU via the backplane. To do control operations, the host sends a series of requests to the CPU by going through the CP-535 and the CP-511 cards. For example, for an upload, the host first finds the type and status of the CPU, then determines what memory records have been programmed in the programmable controller. It then requests the contents of each of these memory records and writes them to a file. Using the DAS for Siemens H1 Protocol 3-5 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions 3.2.2.2 Model S135U Communications Model S135U of the Siemens programmable controller allows for multiple CPU cards within the same programmable controller. To coordinate between the CPUs there is a special Coordinator/MUX card. Model S135U programmable controllers do not need the CP-511 card. The CPU may be connected directly to the CP-535 using a similar RS-232 cable as in the direct connection above. As such, when the CP-535 is connected directly to the CPU card, all control operations are done only to that CPU as if there are no other CPUs in the programmable controller. The RS-232 cable may also be connected between the CP- 535 card and the Coordinator card. In this configuration, control operations may be done to any of the CPU's in the programmable controller without changing the position of the cable. The Coordinator card is responsible for routing the control operation to the appropriate CPU. 3.2.2.3 Common Steps Before doing the actual upload, download, start, stop or status, the following steps need to be performed: o Establish the Transport connection to the special TSAP o Access the CP-535 card. If the programmable controller is an S135U, and if connected with Coordinator, also select CPU o Find the model, type, and revision of the CPU o Find the operational status of the CPU Then, perform the various steps specific to the control operation. When the whole operation is finished, or if there is an error condition, then abort the connection to the special TSAP. 3-6 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions 3.2.2.4 Start and Stop The start and stop functions change the operating mode of a device. The start function enables outputs and the stop function disables outputs. _______________________ Warning _______________________ Devices can control complex and perhaps dangerous industrial processes. Do not use the start and stop functions until you take the required safety precautions and put required operating restrictions into effect. See the manufacturer's documentation for specific safety precautions. ______________________________________________________ The following are the steps to start the CPU: o Finish the common steps outlined above o Start CPU The following are the steps to stop the CPU: o Finish the common steps outlined above o Stop CPU Start_and_Stop_Qualifiers__________________________________ Qualifier________Value_______Description___________________ START_OPTIONS CPUn For the model S135U, this specifies the CPU to be started STOP_OPTIONS CPUn For the model S135U, this specifies the CPU to be _____________________________stopped_______________________ CLI examples To start the second CPU of a model 135 programmable controller type the following. DCM> START SIE_135 /START_OPTIONS=CPU2 To stop the CPU of a model 150 programmable controller type the following. Using the DAS for Siemens H1 Protocol 3-7 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions DCM> STOP SIE_150 3.2.2.5 Upload and Download The upload function transfers the contents of a device's memory to an OpenVMS file. The download function transfers the contents of an OpenVMS file to a device's memory. The following are the steps for the upload operation: o Finish the common steps outlined above o Find directory layout of first data area o Read first memory record defined for this area o Write it to file o Repeat above two steps for all memory records in this area o Repeat above four steps for all data areas in the programmable controller After finishing the common steps, the DAS for Siemens H1 Protocol asks for the directory layout of the memory of the programmable controller. For each data area, it obtains all data records and writes them to file. The following are the steps for the download operation: o Finish the common steps outlined above o Open the OpenVMS file containing the program to be downloaded. Verify that it contains a Siemens program. o Clear all memory in the CPU o Read the first record in the file o If necessary inform the programmable controller that there is a new record in a new data area. o Repeat above two steps for all records in the file When downloading to the CPU, one needs to inform the CPU that there is a new record. The CPU makes the proper entry in its directory and readies itself to accept the new record. If for whatever reason it can not do so, it replies with a protocol error and the download operation is terminated. 3-8 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions In this case, the memory contents are left in an unknown state. When attempting a new download, the memory contents are cleared again, thus retrying the download operation from a cleared condition. Note that the memory contents of the CPU are cleared first, hence the CPU should not reject the records unless there is an error in the OpenVMS file. Upload_and_Download_Qualifiers_____________________________ Qualifier________Value_______Description___________________ DEVICE_FILE CPUn For the model S135U, this specifies the CPU to be _____________________________uploaded_or_downloaded._______ CLI examples To upload the memory contents of the third CPU of a model 135 programmable controller, type the following: DCM> UPLOAD SIE_135 DUA0:[LOGIC_FILES]PROG_3.DAT /dev=CPU3 To download to the memory of a CPU of a model 135 programmable controller connected directly to the CP-535 card, type the following: DCM> DOWNLOAD SIE_135 DUA0:[LOGIC_FILES]PROG_ONE.DAT 3.2.2.6 Read Status The read status function issues a diagnostic status request to the device, interprets the device response, and returns the interpretation as a character buffer. An error message is displayed if a device definition does not match the device in the device response. If this occurs, you must correct the device definition before you can perform an upload function or download function for the device. The following are the steps for the status operation. First, the common steps listed above are sequentially executed. The common steps above return quite a lot of status information to the user. If the transport connection can be established then the programmable controller is available on the Ethernet, and at least the CP-535 card is functional. If the CPU can be reached, then the CP-511 card Using the DAS for Siemens H1 Protocol 3-9 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions or the CPU or the Coordinator are properly connected to the CP-535 and they are all functional. Next, one can determine if the CPU is properly communicating if it returns the type of the CPU and the version level of its software. Following this, one can determine if the CPU is runnning or stopped. Then, one may request the memory layout of the CPU. This information is useful to quickly glance at the programs and data stored in the programmable controller. This is done by requesting the directory information of all data areas of the programmable controller. Read_Status_Qualifiers_____________________________________ Qualifier________Value_______Description___________________ QUALIFIER CPUn For the model S135U, this specifies the CPU to read status from. MEM Directory layout of memory is returned. CPUn,MEM For the model S135U, this specifies the CPU to return _____________________________directory_information_for.____ When using the MEM qualifier, one should also specify /FULL to display the entire status. CLI examples To display the current status of device SIE_ONE type the following: DCM> READ STATUS SIE_ONE This produces a display similar to the following: Status of device SIE_ONE at 29-DEC-1992 12:15:58.26 The CP511 board is available PLC 135U Type R PLC Sftwr v9.0 Comm Sftwr v9.0 PLC is stopped To display the current status of the second CPU of a model 135 programmable controller and to display the memory layout of the CPU, type the following: 3-10 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions DCM> READ STATUS SIE_ONE /QUAL=(CPU2,MEM) /FULL This produces a display similar to the following: Status of device SIE_ONE at 29-DEC-1992 12:15:58.26 The CP511 board is available PLC 135U Type R PLC Sftwr v9.0 Comm Sftwr v9.0 PLC is stopped PB> 10:0007 FB> 10:0010 11:0072 12:00AD 13:00C4 120:0107 FB> 121:012B 122:014F 123:0173 124:018B 125:01A0 FB> 126:01B5 127:01CD OB> 1:01E5 13:01F2 20:0227 21:0238 22:0249 DB> 0:DD85 10:025A 11:0273 12:0377 100:047B DB> 101:0580 3.2.3 Read and Write Data Use the read data and write data functions to read data from and write data to a specific address in device storage. Address display is specific to each device or device family. To read data, one has to define the READ TSAP. This is done with the /NETADDR definition of the Siemens device. If not already established, the DAS for Siemens H1 Protocol establishes the Transport connection to the READ TSAP of the programmable controller. Next, the DAS for Siemens H1 Protocol sends a request to the programmable controller to receive the data. When the programmable controller responds, the DAS for Siemens H1 Protocol interprets the response, extracts the data from it, converts it from programmable controller format to host understandable format, and returns the converted data to the requesting application. For Siemens, the only conversion necessary is to swap the order of the bytes when receiving word type data. From the programmable controller's point of view, the CP-535 card receives the request for data from the user connected to the Ethernet. When the data is available, it is returned to its requestor. The CP-535 card and the CPU communicate via a dual-port RAM which must be Using the DAS for Siemens H1 Protocol 3-11 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions properly synchronized between the two. Refer to Siemens documentation for more detailed information. To write data, one has to define the WRITE TSAP. This is done with the /NETADDR definition of the Siemens device. If not already established, the DAS for Siemens H1 Protocol establishes the Transport connection to the WRITE TSAP of the programmable controller. Next, the DAS for Siemens H1 Protocol converts the data from the application to a format understandable by the programmable controller, and encapsulates it in a request to the programmable controller to write data. For Siemens, the only conversion necessary is to swap the order of the bytes when receiving word type data. Next, the DAS for Siemens H1 Protocol sends this request to the programmable controller to write the data. When the programmable controller responds, the DAS for Siemens H1 Protocol determines if the data was written successfully. From the programmable controller's point of view, the CP- 535 card receives the request to modify data from the user connected to the Ethernet. The result of the operation (successful or not) is then returned to its requestor. The CP-535 card and the CPU communicate via a dual-port RAM which must be properly synchronized between the two. Addressing Syntax programmable controllers memory locations can be addressed according to the following syntax: : : or : Table 3-2 shows allowed values for PC_block, block_number and block_offset. 3-12 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions Table_3-2_Data_Block_Addressing____________________________ Block_______Block_Numbers____Block_Offset_____Format_______ DB 1-255 0-2047 WORD DX 1-255 0-2047 WORD DE 1-255 0-2047 WORD FB 0-255 BYTE IB 0-127 BYTE OB 0-127 BYTE PB 0-127 BYTE CB 0-255 WORD TB 0-127 BYTE RF 0-127 WORD AS 0-65535 WORD __EB__________0-255___________________________BYTE_________ CLI examples To display the current status of device SIE_ONE type the following: DCM> READ DATA S135/ADDR="DB:100:0"/FORMAT=ARRAY[10]:WORD DCM> WRITE DATA S150/ADDR="OB:10"/FORMAT:ARRAY[2]:BYTE 3.2.4 Operations on the Unsolicited TSAP To do all the operations described below, one has to define the UNSOLICITED TSAP. This is done with the /NETADDR definition of the Siemens device. 3.2.4.1 Send and Receive Data To send data, the application program calls routine ILAN$DEVICE_SPECIFIC specifying function code 51 and a buffer containing the data packet to be sent. The DAS for Siemens H1 Protocol then writes this buffer on the unsolicited channel. To receive data, the application program calls routine ILAN$DEVICE_SPECIFIC specifying function code 50 and a buffer to receive the data packet. Using the DAS for Siemens H1 Protocol 3-13 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions The DAS for Siemens H1 Protocol then tries to read data from the unsolicited channel. When the programmable controller sends its data packet, the read operation completes and the data is returned to the application program. ________________________ Note ________________________ You cannot use the ILAN$DEVICE_SPECIFIC routine to send and receive data on a device defined as unsolicited. ______________________________________________________ See Appendix B for program examples. 3.2.4.2 Read and Write Data You can also get data from or send data to the programmable controller using the BASEstar Classic device connection management read data and write data functions. On the UNSOLICITED TSAP, the read data and write data functions allows you to do an acknowledged write, an unacknowledged write or a read operation. The address data does not match a specific address in device storage; it specifies what kind of operations (read /write acknowledged/unacknowledged) has to be performed. Acknowledged write To perform an acknowledged write, the data address qualifier must have the following format: /ADDRESS=ACK:xxxx Where xxxx is any positive integer value that fits in a longword. This value is called a "message id". For example: DCM> WRITE DATA SIE_ONE/ADDRESS=ACK:587/FORMAT=STRING The DAS for Siemens H1 Protocol sends a buffer to the programmable controller to write the data. 3-14 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions This buffer consists of a message header followed by the data to be written. The message header has the following format: o First longword : the message id as given in the /ADDRESS qualifier. o Second longword: the request id, internally allocated by the DAS. The data part of this buffer has been converted to a format understandable by the programmable controller. The programmable controller must be programmed to understand the message header and to acknowledge the data written by sending back the message header. The message id can be used to find out what kind of data has been written. When the programmable controller responds, the DAS for Siemens H1 Protocol checks if the message id and the request id match a pending write request. If a matching write request has been found, the DAS will consider it as acknowledged and will return the acknowledgment to the application. See Appendix C for a complete description of data exchange over the UNSOLICITED TSAP. Unacknowledged write To perform an unacknowledged write, the data address qualifier must have the following format: /ADDRESS=NAK:xxxx Where xxxx is any positive integer value that fits in a longword. This value is called a "message id". For example: DCM> WRITE DATA SIE_ONE/ADDRESS=NAK:15349/FORMAT=ARRAY[10]:WORD The DAS for Siemens H1 Protocol will send a buffer to the programmable controller to write the data. Using the DAS for Siemens H1 Protocol 3-15 Using the DAS for Siemens H1 Protocol 3.2 Supported Functions This buffer consists of a message header followed by the data to be written to the programmable controller. The message header has the following format: o First longword : the message id as given in the /ADDRESS qualifier. o Second longword: 0 The data part of this message has been converted to a format understandable by the programmable controller. In this case, when the second longword of the message header has been set to 0, the programmable controller must understand that it has no acknowledgement to return to the DAS for Siemens H1 Protocol. See Appendix C for a complete description of data exchange over the UNSOLICITED TSAP. Acknowledged Read A read operation is always acknowledged. To perform a read operation, the data address qualifier must have the following format: /ADDRESS=ACK:xxxx Where xxxx is any positive integer value that fits in a longword. This value is called "message id". For example: DCM> READ DATA SIE_ONE/ADDRESS=ACK:1/FORMAT=STRING The DAS for Siemens H1 Protocol will send a request to the programmable controller to receive the data. This request only consists of a message header having the following format: o First longword : the message id as given in the /ADDRESS qualifier. o Second longword: the request id, internally allocated by the DAS. 3-16 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.2 Supported Functions The programmable controller must be programmed to understand the message header. In this case, when the message received by the programmable controller is only 2 longwords long, it has to answer by returning to the DAS the message header, followed by the requested data. The message id may be used by the programmable controller to find out what kind of data has been requested. When the programmable controller responds, the DAS for Siemens H1 Protocol will check if the message id and the request id match a pending read request; it will extract the data from the response, convert it from programmable controller format to host understandable format and return the converted data to the requesting application. For Siemens, the only conversion necessary is to swap the order of the bytes when receiving word type data. See Appendix C for a complete description of data exchange over the UNSOLICITED TSAP. ________________________ Note ________________________ These operations are only allowed on an unsolicited device. ______________________________________________________ 3.3 Automatic Data Collection 3.3.1 Unsolicited Data Unsolicited data involves a device sending data to a physical point in BASEstar Classic device connection management BASEstar Classic device connection management requesting it. BASEstar Classic device connection management can accept unsolicited values from any device, as long as the device is defined as unsolicted and physical points are defined with unsolicited information. All unsolicited data is sent over the UNSOLICITED TSAP, as defined with the /NETADDR definition of the Siemens device. Siemens devices are capable of sending unsolicited messages to the host. The DAS for Siemens H1 Protocol allows you to define BASEstar Classic device connection management physical points for collecting unsolicited data. If the Using the DAS for Siemens H1 Protocol 3-17 Using the DAS for Siemens H1 Protocol 3.3 Automatic Data Collection device sends an unsolicited message, the DAS forwards the message to BASEstar Classic device connection management. An unsolicited message consists of a message header followed by the unsolicited data. The message header must have the following format: o First longword : any positive integer value o Second longword : 0. To define a physical point having an unsolicited id, use the following qualifier: /UNSOLICITED=xxxx Where xxxx is any positive integer value that fits in a longword and that will uniquely identify an unsolicited message. The /ADDRESS qualifier of an unsolicited physical point can contain any valid point address (See Section 3.2.3). Unsolicited messages are received in the DAS by posting an unsolicited read on the UNSOLICITED TSAP. When the device sends an unsolicited message over this TSAP, the read is completed and sent to BASEstar Classic device connection management. If the first longword of the received message matches a physical point unsolicited ID and if the second longword of the received message has been set to 0, then the BASEstar Classic device connection management will be updated with the data part of the message. 3.3.2 Pollsets BASEstar Classic device connection management physical points may be grouped together into pollsets to optimize data collection. Data can be polled on the READ TSAP or on the UNSOLICITED TSAP. Pollsets created for the Siemens devices have the following limitations: o Physical points of differing data types cannot be part of the same pollset. 3-18 Using the DAS for Siemens H1 Protocol Using the DAS for Siemens H1 Protocol 3.3 Automatic Data Collection For example, a physical point of type WORD and a physical point of type BIT cannot be members of the same pollset. Physical points of the same data type with varying element counts can reside in the same pollset. o A pollset used with the UNSOLICITED TSAP can only contain one physical point. For more information on physical points, see the BASEstar Classic Command Line Interface User's Guide. Using the DAS for Siemens H1 Protocol 3-19 A _________________________________________________________________ DAS for Siemens H1 Protocol Returned Values and Associated Error Messages This appendix contains returned values and associated error messages specific to the DAS for Siemens H1 Protocol. A.1 NI Related Returned Codes ILAN$_NIABORTING, NI aborting connection to device., Explanation: Error. During Connect, unable to establish a transport connection to the READ, WRITE, or UNSOLICITED TSAPs of the programmable controller. During Read, when operation completes with network errors. During Write, when operation completes with network errors. User Action: Determine the cause of the network error and then repeat the operation. ILAN$_NIERRLP_IOSIZ, Unacceptable IO_SIZE line parameter., Explanation: Error. The IO_SIZE line parameter of the path definition is not large enough. Typically, the value of this parameter should be about 1024 bytes. User Action: Disable the device, modify the IO_SIZE to be a larger value, and then reenable the device. ILAN$_NIINVNETADDR, The device network address specified is invalid., Explanation: Error. Unable to parse the network address of the Siemens programmable controller. User Action: Check Device address format to determine that the address syntax is correct. Check the TSAPs in the programmable controller to ensure that they match those defined in the network address. Siemens H1 Protocol Returned Values and Associated Error Messages A-1 DAS for Siemens H1 Protocol Returned Values and Associated Error Messages A.2 PE Related Returned Codes A.2 PE Related Returned Codes ILAN$_INVADDRESS, An invalid device address was specified., Explanation: Error. For Read or Write, the specified data address can not be parsed, or fails the bounds limit check. User Action: Check Section 3.2.3 and then correct the syntax for the address being used. ILAN$_DVBUSY, Device is busy completing previous operations., Explanation: Error. The previous control operation (upload, download, start, stop, status) has not yet finished. User Action: Wait for the previous operation to complete. Then retry the operation. ILAN$_PECHECKLOG, PE-specific error. Check log file., Explanation: Error. Occurs when special error messages are written to the BASEstar Classic log file. User Action: Examine the BASEstar Classic history file and take action based on the message logged. ILAN$_PEERRADDRESS, Specified register address is not valid for this protocol., Explanation: Error. The physical point block type does not match the pollset's block type. User Action: Create a new pollset for this physical point or place this physical point into a pollset that matches it's block type. ILAN$_PEERRCOUNT, Element count is negative or exceeds maximum range for PE., Explanation: Error. The COUNT parameter for the read or write operations is too big. User Action: Modify the size of the physical point being read/written. ILAN$_PEERRDEVFILE, Error accessing device file., Explanation: Error. Attempted to download an OpenVMS file which does not contain a program from a Siemens programmable controller. User Action: Download a file that had previously been uploaded from the programmable controller. A-2 DAS for Siemens H1 Protocol Returned Values and Associated Error Messages for Siemens H1 Protocol Returned Values and Associated Error Messages A.2 PE Related Returned Codes ILAN$_PEINVFMT, PE does not support this format., Explanation: Error. The FORMAT parameter for a read or write operation is not compatible with the specified data address. User Action: Consult Section 3.2.3 and then use a format /address pair that are valid. ILAN$_PEUNSPFNC, PE does not support this function., Explanation: Error. ILAN$DEVICE_SPECIFIC called with an unspecified function code. User Action: Use a valid function code when calling ILAN$DEVICE_SPECIFIC. See Appendix B for an example. ILAN$_PEUNXREPLY, Unexpected reply received from device., Explanation: Error. The programmable controller detected an H1 protocol error and returned an error. User Action: Check the history file for messages and take action on the error returned. Siemens H1 Protocol Returned Values and Associated Error Messages A-3 B _________________________________________________________________ Sending and Receiving Data Using ILAN$DEVICE_SPECIFIC This service is used to send or receive data packets to or from Siemens programmable controllers. To send or receive data, one has to define the UNSOLICITED TSAP. This is done with the /NETADDR definition of the Siemens device. ________________________ Note ________________________ You cannot use the ILAN$DEVICE_SPECIFIC routine to send and receive data on a device defined as unsolicited. ______________________________________________________ You can use the following program to send data to the programmable controller, using an UNSOLICITED TSAP. program SEND_A_DATA_PACKET implicit integer*4 (a-z) include 'SYS$LIBRARY:ILANDEFS.FOR' parameter (SINEC$K_SEND = 51) integer*2 request_buffer_len,ret_len character*4 device_name character*40 request_buffer device_name = 'S135' status = ILAN$ACCESS_DEVICE(channel,%descr(device_name)) if (.not. status) call LIB$STOP(%val(status)) request_buffer = 'This buffer will be sent to device S135 ' request_buffer_len = 40 function = SINEC$K_SEND Sending and Receiving Data Using ILAN$DEVICE_SPECIFIC B-1 Sending and Receiving Data Using ILAN$DEVICE_SPECIFIC status = ILAN$DEVICE_SPECIFIC 1 (%ref(channel),, 2 %ref(function), 3 %ref(request_buffer_len), 4 %ref(request_buffer),0,0, 5 %ref(ret_len)) if (.not. status) call LIB$STOP(%val(status)) END You can use the following program to receive data from the programmable controller, using an UNSOLICITED TSAP. program RECEIVE_A_DATA_PACKET implicit integer*4 (a-z) include 'SYS$LIBRARY:ILANDEFS.FOR' parameter (SINEC$K_RECEIVE = 50) integer*2 results_buffer_len,ret_len character*4 device_name character*200 results_buffer device_name = 'S135' status = ILAN$ACCESS_DEVICE(channel,%descr(device_name)) if (.not. status) call LIB$STOP(%val(status)) results_buffer_len = 200 function = SINEC$K_RECEIVE 100 status = ILAN$DEVICE_SPECIFIC 1 (%ref(channel),, 2 %ref(function),0,0, 3 %ref(results_buffer_len), 4 %ref(results_buffer), 5 %ref(ret_len)) if (.not. status) call LIB$STOP(%val(status)) END B-2 Sending and Receiving Data Using ILAN$DEVICE_SPECIFIC C _________________________________________________________________ Data exchange using the UNSOLICITED TSAP Data exchange using the UNSOLICITED TSAP depends whether the device as been defined as unsolicited or not. If the device is not an unsolicited device, one can send or receive data to or from Siemens programmable controllers using the UNSOLICITED TSAP with the ILAN$DEVICE_SPECIFIC routine. Refer to Appendix B for more information. If the device is defined as unsolicited (by the /UNSOLICITED qualifier in the CREATE DEVICE command), the UNSOLICITED TSAP can be used: o By the DAS for Siemens H1 Protocol to perform a read operation, an acknowledged write operation or an unacknowledged write operation. o By the programmable controller to send unsolicited data to the DAS for Siemens H1 Protocol. All these operations are described in this appendix. ________________________ Note ________________________ For all the following operations, the device must be defined as unsolicited. One also has to define the UNSOLICITED TSAP. This is done with the /NETADDR definition of the Siemens device. ______________________________________________________ When the DAS for Siemens H1 Protocol uses the UNSOLICITED TSAP to exchange data with a device defined as unsolicited, it sends for each request a message header, made of 2 longwords, that may be followed by some specific data. Data exchange using the UNSOLICITED TSAP C-1 Data exchange using the UNSOLICITED TSAP The programmable controller must be programmed to understand this message header, and to cooperate with the DAS for Siemens H1 Protocol. C.1 Read Operation For example: DCM> READ DATA S135/ADDR=ACK:xxxx/FORMAT=ARRAY[10]:WORD The Siemens sends the following buffer to the programmable controller over the UNSOLICITED TSAP: Where: o xxxx is any positive integer value that fits in a longword. This value is given by the /ADDR qualifier. It is called the message id. o request_id is the identifier for the read request block, as it has been allocated by the DAS for Siemens H1 Protocol. The message id "xxxx" may be used by the program in the programmable controller to find out what kind of data is expected by the DAS for Siemens H1 Protocol. The programmable controller must answer by returning the message header sent by the DAS, followed by the requested data: C-2 Data exchange using the UNSOLICITED TSAP Data exchange using the UNSOLICITED TSAP C.2 Acknowledged Write Operation C.2 Acknowledged Write Operation For example: DCM> WRITE DATA S135/ADDR=ACK:xxxx/FORMAT=ARRAY[3]:WORD The Siemens sends the following buffer to the programmable controller over the UNSOLICITED TSAP: Where: o xxxx is any positive integer value that fits in a longword. This value is given by the /ADDR qualifier. It is called the message id. o request_id is the identifier for the write request block, as it has been allocated by the DAS for Siemens H1 Protocol. o data represents the data sent to the programmable controller. Inin our example, it would be a 3 words long buffer. The message id "xxxx" may be used by the program in the programmable controller to find out what kind of data has been sent by the DAS for Siemens H1 Protocol. The programmable controller must acknowledge the write request by returning the message header: Data exchange using the UNSOLICITED TSAP C-3 Data exchange using the UNSOLICITED TSAP C.3 Non Acknowledged Write Operation C.3 Non Acknowledged Write Operation For example: DCM> WRITE DATA S135/ADDR=NAK:xxxx/FORMAT=ARRAY[5]:LONGWORD The Siemens sends the following buffer to the programmable controller over the UNSOLICITED TSAP: Where: o xxxx is any positive integer value that fits in a longword. This value is given by the /ADDR qualifier. It is called the message id. o data represents the data sent to the programmable controller In our example, it would be a 5 longwords long buffer. When the second longword sent by the DAS for Siemens H1 Protocol is set to 0, the programmable controller must understand that this involves a non acknowledged write operation, and that it has not to return any answer. The message id "xxxx" may be used by the program in the programmable controller to find out what kind of data has been sent by the DAS for Siemens H1 Protocol. C.4 Unsolicited messages Unsolicited data involves a device sending a physical point to BASEstar Classic device connection management without BASEstar Classic device connection management requesting it. BASEstar Classic device connection management accept unsolicited values from any device, as long as the device is defined as unsolicted and the physical point is defined with unsolicited information. C-4 Data exchange using the UNSOLICITED TSAP Data exchange using the UNSOLICITED TSAP C.4 Unsolicited messages When the device sends an unsolicited message, it must use the following format: Where: o xxxx is any positive integer value that fits in a longword. o the second longword of the message header must be set to 0. o data represents the unsolicited data sent by the programmable controller. When the DAS for Siemens H1 Protocol receives a message on the UNSOLICITED TSAP, it first checks the second longword of this message: if it is zero, the message is unsolicited. The DAS for Siemens H1 Protocol then checks if a physical point has been defined with an unsolicited id equal to "xxxx", first longword of the unsolicited message header. If this is the case, the data part of the unsolicited message is copied into the physical point. Such a physical point could have been created with following command: DCM> CREATE PHYP U1/DEV=S135/UNSOLICITED="xxxx" ... Data exchange using the UNSOLICITED TSAP C-5 _________________________________________________________________ Index A Device Access Software _______________________________ (cont'd) Accessing DAS functions, 3-1 installion of, 2-1 Addressing syntax, 3-12 overview, 1-1 Automatic data collection, supported devices, 1-2, 3-2 3-17 supported functions, 1-2, pollsets, 3-18 3-2 unsolicited, 3-17 using, 3-1 Device address format, 2-11 C______________________________ Device records, 2-11 Configuration file Devices device records, 2-11 communications, 1-1 example, 2-13 Disk space required, 2-3 path records, 2-10 Download function, 3-8 type records, 2-9 Configuration File F______________________________ editing, 2-9 Files Control Operations, 3-5 created during installation, Common Steps, 3-6 2-6 Communications, 3-5 Functions, 1-3, 3-1 Model S135U, 3-6 download, 3-8 read data, 3-11, 3-14 D______________________________ read status, 3-9 DECnet/OSI parameters, 2-14 start, 3-7 DECnet/OSI Parameters: stop, 3-7 DECnet/OSI, 2-15 upload, 3-8 Device Access Software write data, 3-11, 3-14 accessing functions, 3-1 description of, 1-1 devices, 1-3 functions, 1-2 installation requirements, 2-1 Index-1 addressing syntax, 3-12 H______________________________ Read data function, 3-11, 3-14 Hardware Read status function, 3-9 required, 2-2 Receiving Data, 3-13 I S______________________________ _______________________________ Sending Data, 3-13 Installation, 2-1 Software files created, 2-6 required, 2-2 messages, 2-7 SPT block usage, 2-18 post installation tasks, 2-9 Start function, 3-7 procedure, 2-4 Stop function, 3-7 requirements, 2-1 M T______________________________ _______________________________ Type records, 2-9 Messages installation, 2-7 U _______________________________ P______________________________ Unsolicited data, 3-17 Path records, 2-10 Unsolicited TSAP, 3-13 Plant floor equipment Upload function, 3-8 setting up, 2-19 W Pollsets, 3-18 _______________________________ Post installation tasks, 2-9 Write data addressing syntax, 3-12 R______________________________ Write data function, 3-11, Read data 3-14 Index-2