Transcript
ABBArcnS CS31 ARCNET DDE Server for Microsoft Windows and InTouch Applications
User Manual Ver 1.x Rev 1.3 DR 010 35
KLINKMANN AUTOMATION P.O. Box 38 FIN-00371 Helsinki Finland tel. int. + 358 9 5404940 fax int. + 358 9 5413541 www.klinkmann.com
Klinkmann Automation ABBArcnS DDE Server
i
Table Of Contents What is DDE?................................................................................................................. 1 Accessing a Remote DDE Item from ABBArcnS............................................................ 2 Installing the ABBArcnS DDE Server ............................................................................. 2 Installing the ABB CS31 Example Program ................................................................... 4 Configuring the ABBArcnS Server.................................................................................. 4 DDE Server Settings Command .......................................................................... 5 Board Configuration Command ........................................................................... 6 Saving ABBArcnS Configuration File ................................................................... 8 Configuration File Location .................................................................................. 8 Topic Definition Command................................................................................... 9 ABB CS31 07 KT93 Program Description ...................................................................... 11 Host-PLC communication principles .................................................................... 11 PLC program detailed description........................................................................ 13 PLC program for communication with two PCs.................................................... 20 ABB CS31 07 KT97 Program Description ...................................................................... 21 Host-PLC communication principles .................................................................... 21 PLC program detailed description........................................................................ 22 Using the ABBArcnS Server with InTouch...................................................................... 28 Defining the Access Names................................................................................. 28 Defining the Tag names....................................................................................... 30 Monitoring the Status of Communication with InTouch........................................ 32 Item (Point) Naming........................................................................................................ 33 ABB CS31 07 KT93 Controllers........................................................................... 33 ABB CS31 07 KT97 Controllers........................................................................... 34 Item/Point Naming Examples............................................................................... 35 Monitoring and Controlling Communication with a PLC....................................... 35 SUSPEND item.................................................................................................... 35 Notes on Using Microsoft Excel...................................................................................... 36 Reading Values into Excel Spreadsheets ............................................................ 36 Writing Values to ABBARCNS Points .................................................................. 36 Troubleshooting.............................................................................................................. 38 WIN.INI entries .................................................................................................... 38 Troubleshooting menu ......................................................................................... 40
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
1
ABBArcnS CS31 ARCNET DDE Server The ABBArcnS DDE Server is a Microsoft Windows program that acts as a DDE (Dynamic Data Exchange) Server and allows other Windows programs to access to data from ABB CS31 07 KT93 and 07 KT97 Controllers. The ABBArcnS DDE Server requires a PC bus ARCNET adapter card (8 or 16 bit, e.g., ARCNET-PC130E Network Controller Board) based on the SMC ARCNET chip to communicate with ABB CS31 07 KT93 or 07 KT97 Controllers. Through this high speed communication network the Server can access up to 8 ABB CS31 07 KT93 or 07 KT97 Controllers. Program, running on the ABB CS31 07 KT93 or 07 KT97 Controller, must be developed so, that it ensures communication with the host PC through the ARCNET bus. The ABBArcnS DDE Server can be used on MS Windows NT, where WinRT kernel driver is used to access the ARCNET adapter card. The Server is primarily intended for use with Wonderware InTouch, but it may be used by any Microsoft Windows NT program that is capable of acting as a DDE Client.
What is DDE? DDE is a complete communication protocol designed by Microsoft to allow applications in the Windows environment to send/receive data and instructions to/from each other. It implements a client-server relationship between two concurrently running applications. The server application provides the data and accepts requests from any other application interested in its data. Requesting applications are called clients. Some applications such as InTouch and Excel can simultaneously be both a client and server. To obtain data from another application the client program opens a channel to the server application by specifying three things: the server application name, the topic name and the specific item name. For example, in the case of Excel, the application name is "Excel", the topic name is the name of the specific spreadsheet that contains the data and the item name is the specific cell on the spreadsheet. With InTouch the application name is "View", the topic name is the word "Tagname" when reading/writing to an InTouch tag name and the item name is a specific tag name in the InTouch Data Dictionary.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
2
When a client application sets up a link to another DDE program, it requests the server application to advise the client whenever a specific item's value changes. These data links will remain active until either the client or server program terminates the link or the conversation. They are a very efficient means of exchanging data because once the link has been established no communication occurs until the specified data value changes. InTouch uses DDE to communicate with I/O device drivers and other DDE application programs.
Accessing a Remote DDE Item from ABBArcnS The DDE protocol identifies an element of data by using a three-part address, including: Application, Topic and Item. Application refers to the name of the Windows program (server) that knows how to access the data element. In the case of data coming from or going to ABB CS31 07 KT93 or 07 KT97 Controllers, the application portion of the DDE address is ABBArcnS. Topic is an application-specific sub-group of data elements. The ABBArcnS Server considers each Controller to be a separate topic. The user creates meaningful name for each Controller and uses this name as the topic name for DDE references. Note: In some cases, the term "node" is used interchangeably with the term "topic". Item indicates a specific data element within the specified topic. With the ABBArcnS Server, an item is an individual point in the ABB CS31 07 KT93 or 07 KT97 Controller memory. Special items are used for communication control purposes. (The item/point names are fixed by the ABBArcnS Server as described in the Item (Point) Naming chapter.) Note: In some cases, the term "point" is used interchangeably with the term "item".
Installing the ABBArcnS DDE Server Install and configure the ABB CS31 07 KT93 or ABB CS31 07 KT97 hardware and ARCNET network according to the Operating Manual "ABB Procontic CS31 Automation System in Decentralized Structure". Install the appropriate ARCNET adapter card in the computer according to the "Configuration Guide for ARCNET-PC130E/PC270E". The ABBArcnS DDE Server must be installed from Administrator account or from other privileged account with Administrator rights. The ABBArcnS DDE Server installation package can be supplied: 1. As a self-extracting archive (01035xxx.EXE) if downloaded from Klinkmann’s web site (the xxx is the current (latest) version of the Server). 2. From installation on CD. 3. On two or three distribution disks (floppies). To install the ABBArcnS DDE Server from the self-extracting archive, run the 01035xxx.EXE and proceed as directed by the ABBArcnS DDE Server Setup program.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
3
To install the ABBArcnS DDE Server from CD or distribution disks (floppies), on MS Windows NT: 1. Insert the CD with Klinkmann Software into CD drive or insert ABBArcnS Disk1 into a floppy drive A: or B:. 2. Select the Run command under the Start menu. 3. Run STARTUP.EXE if installing from CD or SETUP.EXE if installing from distribution disks (floppies). 4. If installing from CD: select “Protocol Servers (DDE, SuiteLink, OPC)”, find “ABBARCNS DDE Server and click on “Setup…”. 5. Proceed as directed by the ABBArcnS DDE Server Setup program. You will need to reboot the computer after installation. When installation is finished, the subdirectory specified as a folder where to install the ABBArcnS DDE Server will contain the following files: ABBARCNS.EXE
The ABBArcnS Server Program. This is a Microsoft Windows 32-bit application program.
ABBARCNS.HLP
The ABBArcnS Server Help file.
ABBARCNS.CFG
An example configuration file.
LICENSE.TXT
Klinkmann Automation software license file.
WWCOMDLG.DLL
Dynamic Link Library necessary for ABBArcnS Server.
PROJEKT1.ZIP
Packed file containing ABB CS31 07KT93 example program for communication with one computer (one ABBArcnS Server).
PROJEKT2.ZIP
Packed file containing ABB CS31 07KT93 example program for communication with two computers (two ABBArcnS Servers).
KT97.ZIP
Packed file containing ABB CS31 07KT97 example program.
You will need to reboot the computer after installation. Before the ABBArcnS DDE Server is started, all connected ABB CS31 07 KT93 or 07 KT97 Controllers must be initialized for the communication by loading the PLC application program to each Controller. The example programs for ABB CS31 07 KT93 Controller to support communication with ABBArcnS DDE Server are packed as PROJEKT1.ZIP and PROJEKT2.ZIP files. These programs are developed by the 907 PC 331 programming software. See the chapter "Installing the ABB CS31 Example Program" how to install these example projects. The chapter "ABB CS31 07 KT93 Program Description" contains the detailed description of PROJEKT1 and PROJEKT2 projects. The example program for ABB CS31 07 KT97 Controller to support communication with ABBArcnS DDE Server is packed as KT97.ZIP file. The chapter "ABB CS31 07 KT97 Program Description" contains the description of project to use on ABB CS31 07 KT97 Controller. Program is developed by the 907 AC 1131 programming software.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
4
To uninstall the ABBArcnS Server, start Control Panel, select “Add/Remove Programs” and select the “ABBARCNS DDE Server” from the list of available software products. Click on “Add/Remove…” and proceed as directed by the UnInstallShield program. Note: The HASP key is needed for full time running of ABBARCNS Server. The HASP Driver setup is performed during the Server setup. Without HASP Driver installed, the ABBARCNS Server will run only 1 hour (with all features enabled).
Installing the ABB CS31 Example Program The ABB CS31 example programs for communication with ABBArcnS DDE Server are not installed by ABBArcnS Server installation program. The ABB CS31 example program can be installed by copying all 15 files contained in the \PROJEKT1 (or \PROJEKT2) subdirectory on the ABBArcnS DDE Server distribution disk to a subdirectory on your hard disk, where the Project Files for your ABB Procontic CS31 Programming System are located (default: \ABB-SPS\CS31\PROJEKT1 or \ABB-SPS\CS31\PROJEKT2 ). Before installing the ABB CS31 example program, you must install the ABB Procontic Programming System according to the Operating Manual. The following steps are taken to install the ABB CS31 example program \PROJEKT1: 1. 2.
Insert the ABBArcnS DDE Server disk into a floppy drive. At the DOS prompt type: COPY A:\PROJEKT1\*.*
and press Enter (default path: C:\ABB-SPS\CS31\PROJEKT1).
Before the ABBArcnS DDE Server is started, all connected ABB CS31 07 KT93 or 07 KT97 Controllers must be initialized for the communication by loading the PLC application program to each Controller (see chapters "ABB CS31 07 KT93 Program Description" and "ABB CS31 07 KT97 Program Description").
Configuring the ABBArcnS Server After the ABBArcnS Server is initially installed, a small amount of configuration is required. Configuring the Server automatically creates a ABBArcnS.CFG file which holds all of the topics (Controllers) definitions entered, as well as the communication port configurations. This file will automatically be placed in the same directory in which ABBArcnS is located unless the path where the configuration file will be placed is specified via the /Configure/Server Parameters command. To perform the required configurations, start up the ABBArcnS program. If the Server starts up as an icon, double-click on the icon to open the Server's window. The following will appear:
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
5
To access the commands used for the various configurations, open the /Configure menu:
DDE Server Settings Command A number of parameters that control the internal operation of the Server can be set. In most cases, the default settings for these parameters provide good performance and do not require changing. However, they can be changed to fine-tune the Server for a specific environment. To change the Server's internal parameters, invoke the DDE Server Settings... command. The "DDE Server Settings" dialog box will appear:
The following describes each field in this dialog box: Protocol Timer Tick This field is used to change the frequency at which the Server checks for data to process. This should be approximately 2 to 4 times the fastest rate desired to update data from the ABB CS31 07KT93 hardware. NetDDE being used Select this option if you are networking using NetDDE. Configuration File Directory The field is used to specify the path (disk drive and directory) in which ABBArcnS will save its current configuration file. ABBArcnS will use this path to load the configuration file the next time it is started. ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
6
Note: Only the "path" may be modified with this field. The configuration file is always named ABBArcnS.CFG. Note: There is no limit to the number of configuration files created, although each must be in a separate directory. When using the ABBArcnS Server with InTouch, it is good practice to place the configuration file in the application directory. When all entries have been made, click on OK.
Board Configuration Command ARCNET Network Board configuration for Windows NT version of ABBArcnS DDE Server must be done from Administrator account or from other privileged account with Administrator rights. To configure the ARCNET Network Board, invoke the Board Configuration... command. The "Adapter Board Settings" dialog box will appear:
Select the ARCNET Board and click on Modify to examine the characteristics of the selected Board. The "ARCNET Adapter Card Settings" dialog box will appear:
The following describes each dialog field in this dialog box: Board Name This field is used to enter the ARCNET Board name.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
7
Reply Timeout This field is used to enter the amount of time (in milliseconds) all Controllers using the selected communication Board will be given to reply to commands from the Server. Note: The default value of 1100 milliseconds should be sufficient for most configurations. Board Address This field is used to enter the PC identification number or node ID consistent with the corresponding settings on the ARCNET adapter card. Each node attached to the network must have a unique node ID. Board Address must much N00 parameter in the $AREC and the $ASEND CEs in ABB CS31 program (see chapters ABB CS31 07KT93 Program Description and ABB CS31 07KT97 Program Description). Board I/O Address This field is used to enter the I/O base address, in hexadecimal, of the ARCNET interface. The Board I/O Address must be consistent with the base address selected on the ARCNET adapter card. To select a necessary Board I/O Address click on the combo box button and make your choice from list box. Care should be taken to select a base address that will not conflict with other devices in the system. Note: The default Board I/O Address is 2E0. Board Memory Segment This field is used to enter the segment address, in hexadecimal, for the ARCNET chip buffers. The Board Memory Segment address must be consistent with the base memory (RAM) buffer address selected on the ARCNET adapter card. To select a necessary Board Memory Segment click on the combo box button and make your choice from list box. Note: The default Board Memory Segment address is D000. When all entries have been made, select OK to process the configuration for the ARCNET board. Select DONE in the "Adapter Board Settings" dialog box when all ARCNET boards have been configured. Note: For Windows NT version of ABBArcnS DDE Server to add new ARCNET board, remove existing ones, or change "Board I/O Address" or "Board Memory Segment" for existing ARCNET boards configuration must be done from Administrator account or from other privileged account with Administrator rights. Note: For Windows NT version of ABBArcnS DDE Server if you added new ARCNET boards, removed existing ones, or changed "Board I/O Address" or "Board Memory Segment" for existing ARCNET boards to activate board settings WinRT kernel device must be restarted. If ABBArcnS DDE Server fails to restart WinRT kernel device you will need to reboot the computer to activate board settings.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
8
Saving ABBArcnS Configuration File If the configuration file does not currently exist, or a new configuration path has been specified, the Server will display the "Save Configuration" dialog box:
This dialog box displays the path where the Server is going to save the current configuration file. The path may be changed if necessary. Also, the path can optionally be recorded in the WIN.INI file by selecting the "Make this the default configuration file" option. Doing so will allow the ABBArcnS Server to find the configuration file automatically each time it is started.
Configuration File Location When the ABBArcnS Server starts up, it first attempts to locate its configuration file by, first checking the WIN.INI file for a path that was previously specified. If the path is not present in the WIN.INI file, the Server will assume that the current working directory is to be used. To start the Server from an application directory configuration file other than the default configuration file a special switch (/d:) is used. For example, invoke the File/Run command from the File Manager or Program Manager and enter the following: ABBArcnS /d:c:\directoryname Note: There is no limit to the number of configuration files that may be created, although each must be in a separate directory.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
9
Topic Definition Command The user provides each Controller with an arbitrary name which is used as the DDE topic for all references to the Controller. The following steps are taken to define the topics (Controllers) attached to the network: 1.
Invoke the Topic Definition... command. The "Topic Definition" dialog box will appear:
2.
To modify an existing topic, select the topic name and click on Modify. To define a new topic, click on New. The "ABBArcnS Topic Definition" dialog box will appear:
3.
Enter the Topic Name which corresponds to the DDE Topic Name. (The DDE Topic Name is entered in the "DDE Access Name Definition" dialog box described in the Using the ABBArcnS Server with InTouch chapter.)
4.
Click on the Board Name combo box to associate an ARCNET Network Controller Board with the topic. (Additional topics may be associated with this same ARCNET Board at a later time.) Note: If this is the first time an ARCNET Board has been configured, the user will be prompted to save it to an existing directory.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
10
5.
Enter the value in the ABB Station Address field. (Refer to the ABB CS31 Operational Manual for correct address setting.) Note: Each Controller must have an unique non-zero address.
6.
Select the Controller type (KT93 or KT97).
7.
Set the Update Interval field to indicate the frequency the items/points on this topic will be read (polled).
8.
Enter the Job Number of data package configured for communication with your PC in the $AREC and $ASEND CE of ABB CS31 program (see chapters ABB CS31 07 KT93 Program Description and ABB CS31 07KT97 Program Description). For ABB CS31 this number must be from 0 to 31. Note: Each Controller must be assigned an unique Job Number.
9.
The AREC CE field is used to enter the number of user data words configured in the $AREC CE of ABB CS31 program for communication with your PC. This value matches the number of words in the request buffer reserved in the ABB CS31 program for the relevant part of ABBArcnS Server request command string (see chapters ABB CS31 07 KT93 Program Description and ABB CS31 07KT97 Program Description). Valid values are from 6 to 125. Value entered in this field affect only data writing speed and is not important for polling - to access high speed data polling it is enought if you reserve 6 words for DDE Server command string in ABB CS31 program. To perform writing of one value into controller memory by one DDE Server command - it is also enough to reserve 6 words. Only if you need to write a lot of values into controller memory by one command - then reserve greater buffer (for detailed explanation of data "multiwriting" see Troubleshooting chapter).
10. The ASEND CE field is used to enter the number of user data words configured in the $ASEND CE of ABB CS31 program for communication with your PC. This value matches the number of words in the response buffer reserved in ABB CS31 program (see chapters ABB CS31 07 KT93 Program Description and ABB CS31 07KT97 Program Description). Valid values are from 3 to 125. Value entered in this field serious affect data polling speed - the greater buffer is reserved for data response the more data the Server can receive in one Arcnet package. For data writing it is enough if 3 words are reserved for response buffer. Once all entries have been made, click on OK. Select Done in "Topic Definition" dialog box when configuration for all Topics has been performed.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
11
ABB CS31 07 KT93 Program Description ABB CS31 07 KT93 Controller’s ARCNET communication depends on the user developed PLC program. To access PLC memory areas from the ABBArcnS Server running on the host PC, user must develop own PLC application program or modify the existing program according to the terms explained in this chapter.
Host-PLC communication principles The ABBArcnS DDE Server sends requests to the PLC program. The request package (256 bytes) used in Host-PLC Arcnet communication contains the following data: Byte No 0 1 2 3 4 5 6
Contents(*) 01 02 03 7F 0A 00 01
7
00
8
01
9 10
00 02
11
3A
12
00
13
00
14 15 16
00 00 00
...
...
Description Station address of the sender (PC) Station address of the receiver (PLC) Continuous pointer (address of the first user data byte) DIN identification (always 7Fh) Low-byte of Job Number High-byte of Job Number (always 00h) Low-byte of the first word of user data read/write identification byte: = 01 for read; = 02 for write(**). High-byte of the first word of user data request identification byte (RID) generated by the Server. Possible values 00 ... 7Fh. Low-byte of request word number (for read) or write word number (for write). Possible values 1 ... 120. High-byte of request word number. Low-byte of offset address of the source area for read (the target area for write). High-byte of offset address of the source area for read (the target area for write). Low-byte of segment address of the source area for read (the target area for write). High-byte of segment address of the source area for read (the target area for write). Low-byte of the first write value (irrelevant data for read). High-byte of the first write value (irrelevant data for read). Low-byte of the second write value (irrelevant data for read). ...
*) values in column "Contents" are given for example. **) user data (starting from request packages byte #6) represent the relevant part of request package accessible by connection elements (CE) of the PLC program.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
12
The PLC program initializes ARCNET communication and waits for instructions from the Server. Instructions are included in the ARCNET data request package. If the data request command is received then the content of the relevant part of data package is copied into the request buffer reserved in the PLC memory. The first memory variable as well as the length of request buffer is set as $AREC CE's parameters in the PLC program. The request buffer length may be 6 ... 125 words. Memory variables from buffer are reserved for ARCNET communication purposes only and can not be used for other purposes in the PLC application. The PLC program recognizes whether it is a read data request or a request to write new value (values) into the PLC memory. If the read data request command is received then the PLC program copies requested data into the response buffer reserved in the PLC memory. The first memory variable as well as the length of response buffer is set as $ASEND CE's parameters in the PLC program. The response buffer length may be 3 ... 125 words. The response buffer can not be used for other purposes in PLC application. If the change value command is received then the PLC program copies writing values (from request buffer) into the target area in the controller memory. The request buffer first word is copied into the response buffer first word (for checking request correspondence to response) and the response buffer content is send to the host. The response package (256 bytes) used in Host-PLC Arcnet communication contains the following data: Byte No(*) 0 1 2 3 4 5 6
Contents(**) 02 01 03 7F 0A 00 01
7
00
8
00
9
00
10
00
...
...
Description Station address of the sender (PLC) Station address of the receiver (PC) Continuous pointer (address of the first user data byte) DIN identification (always 7Fh) Low-byte of Job Number (parameter #J00 of $AREC CE) High-byte of Job Number (always 00) Low-byte of the first word of user data read/write identification byte: = 01 for read; = 02 for write(***). High-byte of the first word of user data Request identification byte (RID). Value is equal to the same value in the correspondent request package. Possible values 00 ... 7Fh. Low-byte of the first read word value (irrelevant data for write). High -byte of the first read word value (irrelevant data for write). Low-byte of the second read word value (irrelevant data for write). ...
*) the first word of user data not always starts at byte #6. **) values in column "Contents" are given for example. ***) response buffer contents is copied into user data of the response package.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
13
Job number in response package is equal to job number in request buffer. To access high speed data polling it is enough if 6 words are reserved for request buffer in ABB CS31 program. To perform writing of one value into controller memory by one DDE Server command - it is also enough to reserve 6 words. Only if you need to write a lot of values into controller memory by one command - then reserve greater buffer (for detailed explanation of data "multiwriting" see Troubleshooting chapter) Note: Number of words reserved for request buffer must match to corresponding Topic configuration parameter value (see chapter Topic Definition Command). For data polling it is recommended to reserve 125 words in response buffer. The response buffer length seriously affects data polling speed - the greater buffer is reserved for data response the more data the Server can receive in one ARCNET package. For data writing it is enough if 3 words are reserved for response buffer. Note: Number of words reserved for response buffer must match to corresponding Topic configuration parameter values (see chapter Topic Definition Command).
PLC program detailed description The PLC example program represented in the Server distribution diskette as PROJEKT1 is prepared for controller communication with one PC. An example program is developed using ABB Procontic Programming System software (version 05 / 94). Full of PLC program text see using ABB Procontic Programming System CE editor. Note: Amount of comments in the PLC program is limited due to ABB Procontic Programming System editor features. For more information see CE's comments in this manual. Station address of the host PC is 1, station address of the controller (PLC) is 2. Two buffers in the controller memory are reserved for ARCNET communication purposes: - the request buffer; start address MW005,00, length - 125 words; - the response buffer; start address MW015,00, length - 125 words. The following word memory areas are reserved: MW251,00, ... , MW251,02 and MW251,08 - for constant values' storage; MW252,00, ... , MW252,05 - for $AINIT CE performance diagnosis; MW253,00, ... , MW253,04 - for constant values storage. The following flags are reserved: M255,15 - for $AINIT and $INITV CE's initialization with 0->1 edge; A62,00, ... , A62,03 - for $AINIT CE performance diagnosis; A62,04, ... , A62,05 - for $AREC CE performance diagnosis; M254,10, ... , M254,15 - used as control flags.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
14
The following connection elements (CE) perform Host-PLC Arcnet communication in the PLC program: CE $=S: Allow to avoid reinitialization of Arcnet in every PLC program cycle. $= M255,15 Flag for $AINIT M255,15 Flag for $AINIT CEs $INITV: Initialize word variables with numeric values (assign constants). $INITV 0-1 M255,15 Flag for $AINIT #W/B #00001 indicates that assign word values #n #00009 number of assigned variables in current CE #W00 #00999 VR00 MW253,00 Send TIMEOUT #W01 #00001 VR01 MW253,01 PC node number #W02 #15117 VR02 MW253,03 Segment of area MW005,00 (request buffer) #W03 #15137 VR03 MW253,04 Segment of area MW015,00 (response buffer) #W04 #00000 VR04 MW251,00 Constant value = 0 #W05 #00001 VR05 MW251,01 Constant value = 1 #W06 #00002 VR06 MW251,02 Constant value = 2 #W07 #00003 VR07 MW251,03 Constant value = 3 #W08 #00008 VR08 MW251,08 Constant value = 8 Segment of area MW005,00 address is calculated as follows: 3B03h (segment of area MW000,00 address) + 5h * 2h (group number of area MW005,00 (it's 5 = 5h) multiplied by 2h) = 3B0Dh = 15117 (decimal). Offset of area MW005,00 address in this case is 0h. Segment of area MW015,00 address is calculated as follows: 3B03h (segment of area MW000,00 address) + Fh * 2h (group number of area MW015,00 (it's 15 = Fh) multiplied by 2h) = 3B21h = 15137 (decimal). Offset of area MW015,00 address in this case is 0h.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
Assign 1 to bit M254,10. $INITV 0-1 M255,15 #W/B #00000 #n #00001 #W00 #00001 VR00 M254,10
15
Flag for $AINIT indicates that assign discrete values number of assigned variables in current CE Constant Bit = 1
CE for initialization of the ARCNET $AINIT: Initialize controller in the following way: - interrupt after reception of a data package; - only short package ( 256 bytes ); - data packages to all stations (broadcast). $AINIT #0/1 DONE TO ERR NODE parameter) STAT DIAG TOS operation TOND TOJN LEV RECO
M255,15 A62,00 MW253,00 A62,01 MW252,00
0->1 edge at M255,15 causes single initialization Initializ. has been terminated Send TIMEOUT ERR -controller not responded PLC node number after initialization (output
MW252,01 MW252,02 A62,02
content of status register content of diagnosis register Indic. timeout has occurred during send
MW252,03 MW252,04 MW252,05 A62,03
Node number of lost package job number of lost package level of sending buffer network reconfiguring itself
Note: Timeout TO - waiting time (in mSec) for sending data packages. Timeout value must be less than parameter Update Interval (see ABBArcnS Topic Definition dialog box in chapter Topic Definition Command) and parameter Replay Timeout (see Board Configuration dialog box in chapter Configure Board Command). CE $=1: Allocates control flag M254,12 as EXCLUSIVE OR of A62,00 (DONE bit of $AREC) and M254,10 = 1. $=1 A62,00 Initializ. has been terminated M254,10 Constant Bit = 1 M254,12 Binary flag - initializ. not performed
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
16
CE $ &: Allocates control flag M254,11 as logical AND of A62,00 (DONE bit of $AREC) and A62,01 (ERR bit of $AREC). $& A62,00 Initializ. has been terminated A62,01 ERR -controller not responded M254,11 init ERR flag CEs $SPBM: jump over CE for data package receiving $AREC if M254,11= 1 or M254,12= 1 $SPBM M254,11 init ERR flag MRK MRK 300 Mark before application specific CEs MRK
M254,12 MRK 300
Binary flag - initializ. not performed Mark before application specific CEs
CE for data package receiving $AREC: Reads the received data package and stores them into the request buffer. $AREC #JOB UJOB N00 #D00 #J00 #L00 MW00 #JR00
#00001 A62,04 MW253,01 #00127 #00010 #00125 MW005,00 A62,05
Total number of jobs configured Unknown job received Node number of sender (PC) DIN identification (always 127) Job number number of user data words USER 1st WORD Job received indication
Note: Assign direct constant value #1 to parameter #JOB - the controller operates with one job communicating with one PC. PC node number is previously assigned to MW253,01 in $AINIT CE. Assign Job number as direct constant to parameter #J00. For ABB CS31 this number must be from 0 to 31. This parameter value must be equal to the parameter Job Number (see ABBArcnS Topic Definition dialog box in chapter Topic Definition Command). The request buffer length is assigned to parameter #L00. The request buffer first memory variable (MW005,00) is assigned to parameter MW00 of $AREC CE. CE $=: Allocate A62,05 value to ASEND control flag M254,15. $= A62,05 Job received indication M254,15 ASEND enable flag
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
17
CE for the first user word bit pattern unpacking $UNPACK Extracts the Read control flag M254,13 and Write control flag M254,14 values from the first word of request buffer. $UNPACK WORT MW005,00 USER 1st WORD #n #00002 Number of extract bits BI00 M254,13 Read flag BI01 M254,14 Write flag Note: Read control flag gets value 1 if value of low-byte of the user first word is 1. Write control flag gets value 1 if value of low-byte of the user first word is 2. CE $SPBM: jump over data writing CEs if M254,13 = 1 $SPBM E M254,13 Read flag MRK MRK 300 Mark before application specific CEs The Server does not send read and write requests simultaneously in one package. If read flag M000,13 = 1 then jump over data writing CEs (to MRK 300) and perform application specific CEs. Reading CEs are performed after application specific CEs. Write data copy CEs Copy write data from the request buffer into the target area identified by memory offset (the third word in request buffer) and memory segment (the fourth word in request buffer). $COPY FREI M254,14 Write flag ANZ MW005,01 USER 2nd WORD (number of words to copy) QOFF MW251,08 Const.value = 8 (writing data offset in the request buffer is 8 bytes) QSEG MW253,03 Segment of area MW005,00 (start of request buffer) ZOFF MW005,02 USER 3rd WORD (Offset of area) ZSEG MW005,03 USER 4th WORD (Segment of area) Copy the first user word from the request buffer into the response buffer the first word. $COPY FREI M254,14 Write flag ANZ MW251,01 Constant value = 1 QOFF MW251,00 Constant value = 0 (offset in request buffer) QSEG MW253,03 Segment of area MW005,00 (request buffer) ZOFF MW251,00 Constant value = 0 (offset in response buffer) ZSEG MW253,04 Segment of area MW015,00 (response buffer) Low-byte of the first word of user data - read/write identification byte - and high-byte of the first word of user data -request identification byte (RID) - are used by the Server to check the response correspondence to the request.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
18
For write command response with correct read/write identification byte and RID means that write has been performed successfully. $MRK MRK MRK300 A place to insert application specific CEs. CE $SPBM: jump over data reading CEs if M254,12 = 1 Do not perform read if ARCNET is not initialized. $SPBM E M254,12 Binary flag - initializ. not performed MRK MRK 500 Mark after response send CEs $SPBM E MRK
M254,11 MRK 500
init ERR flag Mark after response send CEs
Do not perform read if Write flag M254,14 = 1. $SPBM E M254,14 Write flag MRK MRK 400 Mark before response send CEs Read data copy CEs Copy read data from the area identified by memory offset (the third word in request buffer) and memory segment (the fourth word in request buffer) into the response buffer. $COPY FREI M254,13 Read flag ANZ MW005,01 USER 2nd WORD (number of words to copy) QOFF MW005,02 USER 3rd WORD (Offset of area) QSEG MW005,03 USER 4th WORD (Segment of area) ZOFF MW251,02 Constant value = 2 (Offset for the second word is 2 bytes) ZSEG MW253,04 Segment of area MW015,00 (response buffer) Copy the first user word from the request buffer into the response buffer the first word. $COPY FREI M254,14 Write flag ANZ MW251,01 Constant value = 1 QOFF MW251,00 Constant value = 0 (offset in request buffer) QSEG MW253,03 Segment of area MW005,00 (request buffer) ZOFF MW251,00 Constant value = 0 (offset in response buffer) ZSEG MW253,04 Segment of area MW015,00 (response buffer) Low-byte of the first word of user data - read/write identification byte and high-byte of the first word of user data -request identification byte (RID) are used by the Server to check the response correspondance to the request.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
19
CEs for data package send $MRK MRK MRK400
Mark before response send CEs
$ASEND #JOB EN00 #n00 N00 #D00 #J00 #L00 ST00 MW00
Number of jobs configured in the block = 1 ASEND enable flag Number of receivers of data package Node number of receiver (PC) DIN identification Job number number of user data words Job has been stored in the storage buffer response buffer
#00001 M254,15 #00001 MW253,01 #00127 #00010 #00125 A62,15 MW015,00
Note: Assign direct constant value #1 to parameter #JOB - the Server operates with one job communicating with one controller. PC node number is previously assigned to MW253,01 in $AINIT CE. Assign Job number as direct constant to parameter #J00. This parameter value must be equal to Job number assigned in $AREC CE. Parameter value also must be equal to the parameter Job Number (see ABBArcnS Topic Definition dialog box in chapter Topic Definition Command). The response buffer length is assigned to parameter #L00. The response buffer first memory variable (MW015,00) is assigned to parameter MW00. $APOLL CEs for flags and buffers resetting to zero For program correct performance in the next cycle reset internal control flags and buffers to zero. $MRK MRK
MRK500
Mark after response send CEs
Initialize the first 5 words of receive buffer with zero. $INITS 0-1 A62,05 Job received indication #n #00005 Number of words to initialize VAR MW005,00 request buffer Initialize flags with zero $INITS 0-1 A62,05 #n #00003 VAR M254,13
ABBArcnS DDE Server User Manual Rev 1.3
Job received indication Number of flags to initialize Read flag
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
20
Program end CE $PE For more detailed CE parameter's explanation see "ABB Procontic Programming System Library of Connection Elements ABB Procontic CS31".
PLC program for communication with two PCs The PLC example program represented in the Server distribution diskette as PROJEKT2 is prepared for controller communication with two PCs. Station addresses of the host PCs are: 1 and 3, station address of the controller (PLC) is 2. Four buffers in the controller memory are reserved for ARCNET communication purposes: - the request buffer for communication with the first PC; start address MW005,00, length - 6 words; - the response buffer for communication with the first PC; start address MW015,00, length - 125 words. - the request buffer for communication with the second PC; start address MW025,00, length - 6 words; - the response buffer for communication with the second PC; start address MW035,00, length - 125 words. Additional word memory areas as well as flags are reserved for Arcnet communication purposes: $AREC CE is configured for operation with two jobs: #10 - for communication with PC1 and job #11 for communication with PC2. Two groups of CEs for read data copying as well as two groups of CEs for write data copying are included in the PLC program. Two groups of CEs for data package send are included in PLC program: the first - for communication with PC1 and the other - for communication with PC2. (Only one $ASEND CE may be used in a PLC program. To send additional packages - use $ASEND+.) Full of PLC program text see using ABB Procontic Programming System CE editor. Detailed explanation of this program is not presented in manual.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
21
ABB CS31 07 KT97 Program Description This chapter contains the description of the PLC program developed for ABB CS31 07 KT97 Controllers. Communication principles are generally the same as in case of ABB CS31 07 KT93 Controllers (see chapter "ABB CS31 07 KT93 Program Description" ). The differences are related to different addressing system of operand memory on KT93 and KT97 as well as to different PLC programming software (907 PC 331 programming software is used for 07 KT 93 programming, 907 AC 1131 programming software - is used for 07 KT 97 programming). 907 AC 1131 programming software's COPY function needs operands address presented as double word. Values of Binary variables are not accessible thrue address of variables. So, the Server does not support Binary variables in case of 07 KT 97. To access Binary variables reserve Word operands for Binary values packing. Use PACK function to set Binary values you need into reserved Word in PLC program. To poll Binary values - read reserved Word and extract Bits from Word in your application. To poke Binary values - pack them into Word in your application and trransfer value into reserved Word in PLC. Use UNPACK function to get Bits in PLC program.
Host-PLC communication principles The request packages (256 bytes) used in Host-KT97 PLC Arcnet communication differ from KT93 packages. The request package contains source address of read data (or destination address of write data) as double word, not segment and offset as in case of KT93. The double word address is presented the following way: low word of address bytes 10 and 11, high word of address - bytes 12 and 13. Word value in PLC program can not exceed 32767; so when low word of address is greater than 32767 then value of low word of address is summed of word value set in bytes 10 and 11 and word value set in bytes 14 and 15. The request package contains the following data: Byte No 0 1 2 3 4 5 6
Contents(*) 01 02 03 7F 0A 00 01
7
00
8
01
9 10
00 FF
11
7F
Description Station address of the sender (PC) Station address of the receiver (PLC) Continuous pointer (address of the first user data byte) DIN identification (always 7Fh) Low-byte of Job Number High-byte of Job Number (always 00h) Low-byte of the first word of user data Read/write identification byte: = 01 for read; = 02 for write(**). High-byte of the first word of user data Request identification byte (RID) generated by the Server. Possible values 00 ... 7Fh. Low-byte of request word number (for read) or write word number (for write). Possible values 1 ... 120. High-byte of request word number. Low-byte of low-word of address of the source area for read (the target area for write). High-byte of low-word of address of the source area for read (the target area for write).
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
12
1B
13
00
14
01
15
04
16 17 18
00 00 00
...
...
22
Low-byte of high-word of address of the source area for read (the target area for write). High-byte of high-word of address of the source area for read (the target area for write). Low-byte of low-word of address (addition) of the source area for read (the target area for write). High-byte of low-word of address (addition) of the source area for read (the target area for write). Low-byte of the first write value (irrelevant data for read). High-byte of the first write value (irrelevant data for read). Low-byte of the second write value (irrelevant data for read). ...
*) values in column "Contents" are given for example. **) user data (starting from request packages byte #6) represent the relevant part of request package accessible by the PLC program.
PLC program detailed description Two buffers in the controller memory are reserved for ARCNET communication purposes: - the request buffer; start address MW005,00, length - 125 words; - the response buffer; start address MW015,00, length - 125 words. The following word memory areas are reserved: MW252,00, ... , MW252,05 - for $AINIT CE performance diagnosis; MW253,00, ... , MW253,01 - for constant values storage. The following flags are reserved: M255,15 - for $AINIT and $INITV CE's initialization with 0->1 edge; A62,00, ... , A62,03 - for $AINIT CE performance diagnosis; A62,04, ... , A62,05 - for $AREC CE performance diagnosis; M254,10, ... , M254,15 - used as control flags. The PLC example program is developed in instruction list (IL) and all instructions are included in to POU PLC_PRG. The declaration part of POU is the following (global variables are not presented in description): PROGRAM PLC_PRG VAR INITVW16_0 : INITVW16; INITVB16_0 : INITVB16; AINIT_0 : AINIT; AREC_0 : AREC; UNPACK_0 : UNPACK; ASEND1_0 : ASEND1; INITSW_0 : INITSW; INITSB_0 : INITSB;
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
23
_DWORD_S_ADDR:DWORD; _DWORD_D_ADDR:DWORD; END_VAR The body of POU contains the following instructions: (* Set ARCNET Init-edge *) LDN M255_15 S M255_15 (* Assign constants: Send TIMEOUT = 999, PC node number = 1 *) CAL INITVW16_0(FREI := M255_15, N := 2, W0 := 999, W1 := 1, V0 := MW253_00, V1 := MW253_01) (* Assign TRUE to M254_10 *) LD M254_10 ADR ST INITVB16_0.V0 CAL INITVB16_0(FREI := M255_15, N := 1, W0 :=TRUE) (* ARCNET init *) CAL
AINIT_0(FREI :=M255_15, TOut := MW253_00)
LD ST
AINIT_0.DONE A62_00
LD ST
AINIT_0.ERR A62_01
LD ST
AINIT_0.NODE MW252_00
LD ST
AINIT_0.STAT MW252_01
LD ST
AINIT_0.DIAG MW252_02
LD ST
AINIT_0.TOS A62_02
LD ST
AINIT_0.TOND MW252_03
LD ST
AINIT_0.TOJN MW252_04
LD ST
AINIT_0.LEV MW252_05
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
LD ST
24
AINIT_0.RECO A62_03
(*Jump over AREC CE if ARCNET not initialized *) LD A62_00 ANDN M254_10 OR (TRUE ANDN A62_00 AND M254_10 ) ST M254_12 LD AND ST
A62_00 A62_01 M254_11
LD M254_12 JMPC MRK_ARCNET_PROCESS_END LD M254_11 JMPC MRK_ARCNET_PROCESS_END (* Get ARCNET request *) CAL AREC_0(N0 := MW253_01, D0 := 127, J0 := 10, L0 := 125, MW0 := MW05_00) LD ST
AREC_0.UJOB A62_04
LD ST
AREC_0.JR0 A62_05
(* Extract Read flag M254,13 and Write flag M254,14 values *) CAL UNPACK_0(E := MW005_00, n := 2) LD ST
UNPACK_0.B0 M254_13
LD ST
UNPACK_0.B1 M254_14
(* Jump to data reading CEs if M254,13 =TRUE *) LD M254_13 JMPC MRK_DATA_READ (* Jump to data writing CEs if M254,14 =TRUE *) LD M254_14 JMPC MRK_DATA_WRITE LD TRUE JMPC MRK_SEND_RESPONSE ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
25
MRK_DATA_WRITE: (* DATA WRITING PERFORMANCE *) (* COPY write data into the target area *) LD MW005_03 W2WDW MW005_02 ST _DWORD_D_ADDR LD ADD ST
_DWORD_D_ADDR MW005_04 _DWORD_D_ADDR
LD M254_14 COPY MW005_01,16#001B84AA,_DWORD_D_ADDR (* Source address (of request buffer area MW005,05 where the first word of write value is located) is calculated as follows: 001B8400h (address of MW000,00) + 5h * 10h * 2h (group number of area MW005,05 (it's 5 = 5h) multiplied by 10h and multiplied by 2h) + 5h * 2h (channel number of area MW005,05 (it's 5 = 5h) multiplied by 2h) = 1B84AAh When calculate destination address then PLC program takes values of words MW005,02 and MW005,03 and converts into double word and then adds value from MW005,04*) (* Copy write request ID into the response buffer *) LD M254_14 COPY 16#1,16#001B84A0,16#001B85E0 (* Low-byte of the first word of user data (read/write identification byte) and high-byte of the first word of user data (request identification byte (RID)) - are used by the Server to check the response correspondence to the request. For write command the response with correct read/write identification byte and RID means that write has been performed successfully. Source address (of request buffer area MW005,00 where write RID is located) is calculated as follows: 001B8400h (address of MW000,00) + 5h * 10h * 2h (group number of area MW005,00 (it's 5 = 5h) multiplied by 10h and multiplied by 2h) = 1B84A0h Destination address (of response buffer area MW015,00 where write RID is located) is calculated as follows: 001B8400h (address of MW000,00) + Fh * 10h * 2h (group number of area MW015,00 (it's 15 = Fh) multiplied by 10h and multiplied by 2h) = 1B84A0h *)
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
26
(* Jump over data reading block *) LD TRUE JMPC MRK_SEND_RESPONSE MRK_DATA_READ: (* DATA READING PERFORMANCE *) (* Copy read area into the response buffer *) LD MW005_03 W2WDW MW005_02 ST _DWORD_S_ADDR LD ADD ST
_DWORD_S_ADDR MW005_04 _DWORD_S_ADDR
LD M254_13 COPY MW005_01,_DWORD_S_ADDR,16#001B85E2 (* Destination address (of response buffer area MW015,01 where read data starts) is calculated as follows: 001B8400h (address of MW000,00) + Fh * 10h * 2h (group number of area MW015,00 (it's 15 = Fh) multiplied by 10h and multiplied by 2h) + 1h * 2h (channel number of area MW015,01 (it's 1 = 1h) multiplied by 2h) = 1B85E2h *) (* Copy read request ID into the response buffer *) LD M254_13 COPY 16#1,16#001B84A0,16#001B85E0 (* Low-byte of the first word of user data (read/write identification byte) and high-byte of the first word of user data (request identification byte (RID)) - are used by the Server to check the response correspondence to the request. *) MRK_SEND_RESPONSE: (* Send Response *) CAL ASEND1_0(EN := M254_10, D0 := 127, J0 := 10, L0 := 125, n := 1, N0 := MW253_01, MW := MW015_00) LD ST
ASEND1_0.STA A62_15
MRK_ARCNET_PROCESS_END: (* Initialize 7 words of request buffer and 3 words of response buffer*) LD 0 ST MW005_00 ST MW005_01 ST MW005_02 ST MW005_03 ST MW005_04 ST MW005_05 ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
ST ST ST ST
27
MW005_06 MW015_00 MW015_01 MW015_02
(* Initialize flags *) LD FALSE ST A62_05 ST A62_06 (* ARCNET communication process end *)
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
28
Using the ABBArcnS Server with InTouch
To access items/points on ABB CS31 07 KT93 and 07 KT97 Controllers from InTouch, the Access Names and Tag names should be defined in WindowMaker.
Defining the Access Names InTouch uses Access Names to reference real-time I/O data. Each Access Name equates to an I/O address, which can contain a Node, Application, and Topic. In a distributed application, I/O references can be set up as global addresses to a network I/O Server or local addresses to a local I/O Server. To define the Access Names in WindowMaker node invoke the /Special/Access Names... command. The "Access Names" dialog box will appear.
Click on Add…. The "Add Access Name" Dialog Box will appear:
Note: If Add is selected, this dialog box will be blank when it initially appears. Data has been entered here to illustrate the entries that are made. The following fields are required entries when entering an Access Name Definition:
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
29
Access Name In the Access Name box type the name you want InTouch to use to this Access Name. (For simplicity, use the same name that you will use for the Topic Name here.) Node Name If the data resides in a network I/O Server, in the Node Name box, type the remote node's name. Application Name In the Application Name box, type the actual program name for the I/O Server program from which the data values will be acquired. In case the values are coming from the ABBArcnS Server the ABBARCNS is used. Do not enter the .exe extension portion of the program name. Topic Name Enter the name defined for the topic in the ABBArcnS Server to identify the topic the ABBArcnS Server will be accessing. The Topic Name is an application-specific sub-group of data elements. In the case of data coming from ABBArcnS Server program, the topic name is the exact same name configured for the topic in the ABBArcnS Server. Note: This will usually be the same as the "Access Name", although, if desired, they may be different. However, it must be the same name used when the topics were configured in section Configuring the ABBArcnS Server. Which protocol to use Select the DDE protocol (ABBArcnS Server does not support Suite Link protocol). When to advise server Select Advise all items if you want the Server program to poll for all data whether or not it is in visible windows, alarmed, logged, trended or used in a script. Selecting this option will impact performance, therefore its use is not recommended. Select Advise only active items if you want the Server program to poll only points in visible windows and points that are alarmed, logged, trended or used in any script. Click OK to accept the new Access Name and close the “Add Access Name” dialog box. The “Access Names” dialog box will reappear displaying the new Access Name selected in the list. Click Close to close the “Access Names” dialog box.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
30
Defining the Tag names
To define the Tag names associated with the new "Access Name", invoke the /Special/Tagname Dictionary... command (in WindowMaker). The "Tagname Dictionary" dialog box will appear:
Click on New and enter the Tag Name. (The tag name defined here is the name InTouch will use. The ABBARCNS Server does not see this name.) Select the tag type by clicking on the Type:… button. The "Tag Types" dialog box will appear:
To access ABBArcnS items, the type must be I/O Discrete or I/O Integer. Select the Tag type. The "Details" dialog box for the tag name will appear:
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
31
Select the Access Name for ABBArcnS Server by clicking on the Access Name:… button. The "Access Names" dialog box will appear:
Select the appropriate Access Name and click on Close. (If the Access Name has not been defined as previously described, click on Add and define the Access Name now.) The "Details" dialog box will appear displaying the selected Access Name:
For integers fill in the Min EU, Max EU, Min Raw and Max Raw fields. These fields control the range of values, which will be accepted from the Server and how the values are scaled. If no scaling is desired, Min EU should be equal to Min Raw and Max EU equal to Max Raw. Enter the ABBArcnS item name to be associated with this tagname in the Item: field in the "Details" box:
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
32
(Refer to the Item (Point) Naming section below for complete details.) Where applicable, the Use Tagname as Item Name option may be selected to automatically enter the tag name in this field. Note: The tag name can only be used if it follows the conventions listed in the Item (Point( Naming section. Once all entries have been made, click on the Save button (in the top dialog box) to accept the new tagname. To define additional tagnames click on the New button. To return to the WindowMaker main screen, select Close.
Monitoring the Status of Communication with InTouch InTouch supports built-in topic name called DDEStatus, which can be used to monitor the status of communication between the Server and InTouch. For more information on the built-in topic name DDEStatus, see your online “InTouch User’s Guide”. The status of communication between the Server and InTouch can be read into Excel by entering the following DDE reference formula in a cell on a spreadsheet (in following examples node2 is the Topic Name configured for ABBArcnS Server): =view|DDEStatus!node2
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
33
Item (Point) Naming Within the ABBArcnS Server, item/point naming depends on ABB Procontic CS31 system operand naming conventions. The tables below list the item/point names supported by the ABBArcnS DDE Server.
ABB CS31 07 KT93 Controllers BINARY points Item name K E A M S
Description BINARY indirect constant BINARY input BINARY output BINARY flag BINARY step
DDE Tag Type Discrete Discrete Discrete Discrete Discrete
Range K00,00...K00,01 E00,00...E63,15 A00,00...A63,15 M000,00...M255,15 S00,00...S127,15
DDE Tag Type Integer Integer Integer Integer
Range KW00,00...KW39,15 EW00,00...EW07,15 AW00,00...AW07,15 MW000,00...MW255,15
WORD points Item name KW EW AW MW
Description WORD indirect constant WORD input WORD output WORD flag
DOUBLE WORD points Item name KD MD
Description DOUBLE WORD indirect constant DOUBLE WORD flag
DDE Tag Type Range Integer KD00,00...KD07,15 Integer
MD00,00...MD31,15
The ABBArcnS Server accesses theABB Procontic CS31 07KT93 PLC memory areas using the following start addresses: Memory area K00,00 KW00,00 KD00,00 E00,00 EW00,00 A00,00 AW00,00 M000,00 MW000,00 MD00,00 S00,00
ABBArcnS DDE Server User Manual Rev 1.3
Offset 000EH 0000H 0000H 0000H 0000H 0000H 0000H 0000H 0000H 0000H 0000H
Segment 38F2H 38F3H 3943H 3963H 39A3H 39B3H 39F3H 3A03H 3B03H 3D03H 3D83H
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
34
The range of values is the following: binary points 0,1; words -32768 ... +32767; double words -2147483648 ... +2147483647. It is recommended that consecutive addressing is used for item/point naming (for example, MW001,01, MW001,02, MW001,03, etc.). This will greatly increase the performance of ABBArcnS DDE Server.
ABB CS31 07 KT97 Controllers WORD points Item name KW EW AW MW
Description WORD indirect constant WORD input WORD output WORD flag
DDE Tag Type Integer Integer Integer Integer
Range KW00,00...KW89,15 EW00,00... EW207,15 AW00,00... AW207,15 MW000,00...MW511,15
DOUBLE WORD points Item name KD MD
Description DOUBLE WORD indirect constant DOUBLE WORD flag
DDE Tag Type Range Integer KD00,00...KD23,15 Integer
MD00,00...MD63,15
The ABBArcnS Server accesses the ABB Procontic CS31 07KT97 PLC memory areas using the following start addresses: Memory area MW00,00 MD00,00 KW00,00 KD00,00 EW00,00 AW00,00
Address 001B8400H 001BC400H 001BD400H 001BDF40H 002F8300H 002FC300H
The range of values is the following: words -32768 ... +32767; double words -2147483648 ... +2147483647. It is recommended that consecutive addressing is used for item/point naming (for example, MW001,01, MW001,02, MW001,03, etc.). This will greatly increase the performance of ABBArcnS DDE Server.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
35
Item/Point Naming Examples The following examples show the correct format for item/point names (Binary points are relevant only for CS31 07 KT93 Controllers): E01,15
BINARY Input (CS31 bus), Group number 1, Channel number 15;
A03,00
BINARY Output, Group number 3, Channel number 0;
M113,13
BINARY Flag, Group number 113, Channel number 13;
K0,0
BINARY Constant, Group number 0, Channel number 0;
EW02,01
Analog WORD Input, Group number 2, Channel number 1;
AW3,2
Analog WORD Output, Group number 3, Channel number 2;
MW255,11
WORD Flag, Group number 255, Channel number 11;
KW38,04
WORD Constant, Group number 38, Channel number 4;
Monitoring and Controlling Communication with a PLC For each topic there is a built-in discrete item that indicates the state of communication with Controller. The discrete item (STATUS) is set to 0 when communication fails and set to 1 when communication is successful. From InTouch the state of communication may be read by defining an I/O Discrete tagname and associating it with the topic configured for the PLC and using STATUS as the item name. From Excel, the status of the communication may be read by entering the following formula in a cell: =ABBARCNS|topic!STATUS where topic is a name of topic (e.g. node1) configured for this Controller.
SUSPEND item Special write-only Discrete Item SUSPEND may be used to control communication with a separate topic (Controller(. If application changes the SUSPEND value from 0 to 1 - then communication with topic is suspended. If SUSPEND value is changed back to 0, communication with topic is resumed. Note: When topic is suspended by setting SUSPEND item to 1, the Server rejects all writes to this topic.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
36
Notes on Using Microsoft Excel Data from ABBArcnS topics (Controllers) may be accessed from Excel spreadsheets. To do so, enter a formula like the following into a cell on the spreadsheet. =ABBARCNS|topic!item Sometimes, Excel requires the topic and/or item to be surrounded by apostrophes. In the formula, topic must be replaced with one of the valid topic names defined during the Server configuration process. Replace item with one of the valid item names described in the Item (Point) Naming section.
Reading Values into Excel Spreadsheets
Values may be read directly into Excel spreadsheets by entering a DDE formatted formula into a cell, as shown in the following examples: =ABBARCNS|'node2'!'EW7,15' =ABBARCNS|'node3'!'M10,0' =ABBARCNS|'node10'!'MW100,04' Note: Refer to the Microsoft Excel manual for complete details on entering Remote Reference formulas for cells.
Writing Values to ABBARCNS Points Values may be written to the Server from Microsoft Excel by creating an Excel macro that uses the POKE command. The proper command is entered in Excel as follows: channel=INITIATE("ABBARCNS","topicname") =POKE(channel,"itemname", Data_Reference) =TERMINATE (channel) =RETURN() The following describes each of the above POKE macro statements: channel=INITIATE("ABBARCNS ","topicname") Opens a channel to a specific topic name (defined in the Server) in an application with name ABBARCNS (the executable name less the .EXE) and assigns the number of that opened channel to channel. Note: By using the channel=INITIATE statement the word channel must be used in the =POKE statement instead of the actual cell reference. The "applicationname" and "topicname" portions of the formula must be enclosed in quotation marks. =POKE(channel,"itemname", Data_Reference) POKEs the value contained in the Data_Reference to the specified item name (actual location in the PLC) via the channel number returned by the previously executed INITIATE function. Data_Reference is the row/column ID of the cell containing the data value. For "itemname", use some of the valid item names specified like described in the Item Names section.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
37
=TERMINATE(channel) Closes the channel at the end of the macro. Some applications have a limited number of channels. Therefore they should be closed when finished. Channel is the channel number returned by the previously executed INITIATE function. =RETURN() Marks the end of the macro. The following is an example of Excel macro used to poke value from cell B2 to topic node2 item MW100,11: PokeMacro -Ctrl a =INITIATE("ABBARCNS","node2") =POKE(A2,"MW100,11",B2) =ON.TIME(NOW()+0.01,"TerminateDDEChannel") =RETURN() TerminateDDEChannel =TERMINATE(A2) =RETURN() Note: Refer to the Microsoft Excel manual for complete details on entering Remote Reference formulas for cells.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
38
Troubleshooting WIN.INI entries The first time you run the ABBArcnS DDE Server configuration, most of the items in the following list will automatically appear in the WIN.INI file. It is usually in the C:\WINDOWS directory. It is an ASCII file and can be altered manually if you wish with any text editor, e.g., MS Windows Notepad (do not use a program that formats text, such as MS Word or Write unless the file is saved as DOS text). The following is a typical entry for the ABBArcnS DDE Server: [ABBArcnS] ProtocolTimer=50 RequestTimer=1000 ValidDataTimeout=60000 DDEBlockSize=4096 WriteRetryIndefinitely=0 ConfigurationFile=C:\ABBArcnS\ WinIconic=0 WinFullScreen=0 WinTop=112 WinLeft=0 WinWidth=200 WinHeight=168 DebugMenu=1 ShowSend=0 ShowReceive=0 ShowErrors=1 SlowPollInterval=10 MultiWrite=0 ConsecutiveWriteErrors=3 The MultiWrite entry is used to enter the data writing principles for the Server. The following values can be entered. (1) If MultiWrite=0 then for each new write value a separate write message is created. The values in the PLC are changed by the Server in the same sequence as they are changed in the user (client) application. In this case the data update rate is low if application changes values very frequently. (2) If MultiWrite=1 then the same message can be used for the writing of new values into the consecutive memory addresses for the same memory area (for example, into AW00,09, AW00,10, AW00,11...). Number of values which may be included in the same write command depends on request buffer length reserved in the PLC program (see chapter ABB CS31 07KT93 Program Description and ABB CS31 07KT97 Program Description). The new value can be added only to the end of last write message (last message in the list of pending write messages). Therefore some values may be written into the PLC memory simultaneously even if the client application changes them step-bystep. In this case the writing speed can be seriously increased. ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
39
For example, the request buffer length in PLC program is 125 words, the client application sequentially changes the values of following 120 items: MW100,00, MW100,01, ... , MW107,07 and then the values of following 120 items: AW00,00, AW00,1, ... , AW07,07. In this case the Server creates only two write messages to write the new values for all the changed items. If the values of the same Items are changed in the following sequence: MW100,00, AW00,00, MW100,01, AW00,01, MW100,02, ... then Server creates a separate write message for the each new write value. (3) If MultiWrite=2 then Server tries to include the new write value into the some of previously created messages ignoring the sequence of data changing in the client application. Important! If MultiWrite=2 then maximum writing speed is achieved, but this option is not recommended if data changing sequence is important for PLC program! The ConsecutiveWriteErrors entry is used to enter the number of consecutive unsuccessful write retries for one write command. If after ConsecutiveWriteErrors the write command still is not executed then write command is deleted from the list of active (pending) write messages and write is finally rejected. If the total amount of messages in the list of active write messages exceeds 300 then every write message is performed only once not taking into account the ConsecutiveWriteErrors value. The SlowPollInterval entry is used to enter the slow poll mode update interval (in seconds). The slow poll mode will be set for the topic which either does not respond or for consecutive response errors. The default values (they are used if WIN.INI file does not contain these entries) are the following: ConsequtiveWriteErrors=3, SlowPollInterval=10 and MultiWrite=0.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
40
Troubleshooting menu The following debugging choices are appended to the Server’s System Menu (the menu that appears when you click the “-” box in the upper left hand corner of the Server window): Suspend Protocol / Resume Protocol - these choices permit you to turn protocol processing on and off, what means that you can suspend access to the PLCs. Show Send - if checked then outgoing data is logged in hexadecimal format. Show Receive - if checked then incoming data is logged in hexadecimal format. Show Errors - if checked then errors are logged. ShowEvents - if checked then Server logs the information about situations when the total number of active (pending) write messages exceeds 300. It may happen when the Server has timing problems when executing write commands. When such warnings appear then it is recommended to modify the Server timing settings or to reduce the total amount of write data in the client application. Otherwise the possibility of loosing write data increases. Information about suspended and resumed topics (if application changes special Item's SUSPEND value) is logged if ShowEvents is checked. ShowBadWrites - if checked then Server displays information about all situations when data write commands are not executed successfully and after ConsecutiveWriteErrors retries the write is rejected and write message is deleted from list of active (pending) write messages. This option (if checked) is effective even if other error logging is stopped. Verbose - if checked then all information about errors (except errors indicated in other choices) is displayed. Dump - displays all information about board, active topics and data items. DumpScreen - if checked information about active topics and messages is displayed in ABBArcnS main window. All debug information (except Dump Screen) is displayed via the Wonderware Logger, which must be active for these commands to work. Warning: if you check Show Send and/or Show Receive debug output grows very fast. Note: When a new PLC program is developed or corrected the previously developed PLC program, it is strongly recommended to check the Server communications with a PLC. To do it - debug request and response packages and check contents of them. If error messages appear or responses and/or requests are incorrect - then correct PLC program and/or change Server settings.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc
Klinkmann Automation ABBArcnS DDE Server
41
KLINKMANN AUTOMATION ABBArcnS DDE Server Revision History Mar 97 Aug 97 Apr 2000 Mar 2002
Rev 1.0 Rev 1.1 Rev 1.2 Rev 1.3
First Release Manual text modified. Manual file name changed. Support for ABB CS31 07 KT97 Controller added. Installation from CD information added.
ABBArcnS DDE Server User Manual Rev 1.3
01030M13.doc