Você está na página 1de 31
al Chapter 10: Commu ‘This chapter explains how you enable InduSoft Web Studio applications to communicate (exchange data values) with other applications, remote devices (such as a PLC or transmitters), and any devices that implement OPC or DDE Servers, To enable communication, you configure the task worksheets provided by IWS. Instructions for configuring these worksheets are provided the following sections: + Configuring a Driver: Explains how to configure a Driver worksheet to implement a communication protocol (OPC, TCP/IP, or DDE). Configuring OPC: Explains how to configure an OPC worksheet to manage communication between local or remote OPC Clients and Servers. + Configuring TCP/IP: Explains how to configure a TCP/IP worksheet to manage communication between two IWS applications. Configuring DDE: Explains how to configure a DDE worksheet to manage communication between local or remote DDE Clients and Servers. Use the Comm tab to access all worksheets configured to establish communication with another device or software using available protocols. © ives sao Bree Gove Eh [Eee lee. Workspace: Comm Tab ‘The folders on the Comm tab are described on the following pages. TnduSon Web Studio v6.1 SP6 104 IWS Users Guido Communication Configuring a Driver A communication driver is a DLL containing specific information about the remote equipment and implements the communication protocol. To develop a new communication driver, InduSoft provides a driver toolkit. Consult InduSoft for further information. The Drivers folder allows you to define the communication interface (or interfaces) between the project and remote equipment; such as a PLC, a single-loop, and transmitters. = Not Consult the Help menu for a description of the functions and characteristics that| are standard for all drivers. When developing an application, you can also refer| to the specific documentation provided with each communication driver. This documentation is usually located in the DRY directory. To configure a communication driver, you must specify the interface parameters (for example, the station address and the baud rate), specify the equipment addresses, and then link them to InduSoft tags. Use one of the following methods to add or remove a configured dri + Right-click on the Drivers folder + Select Insert —> Drivers from the menu bar Both methods open a Communication Drivers dialog, which displays a list of available drivers, vabledivare: DL Descigtion “ ‘ABP Alen Bade Ebest OP Peel AT /2000P/CE) ‘ADEN, ‘Aden Bn. ABT7SUNETENI Gade (N72. ‘ABICP Ale Bley Eberet OFT Poel PLC2, PLCS ar SL ADI ACEUSHRT- Szannes tees a0 M2 and W24 NT. ACS AES, Unace Dea fe 200)1.97 ‘ADAM ADVANTECH O16 ADAM 4000 vin (T9200. ‘ADAM2 — ADVANTECH Seine 40005000 ord camps (2. ‘ADAM: ADVANTECH Sete 400/000 ard camps (NZ ‘ADML. —GEFRAW-Adanel(hT 200) (1.13) | [ices Selected: Descnten ‘Communication Drivers dialog Use the parameters on this dialog, as follows: + Available Drivers field: Lists all available drivers and a brief description of each. + Help button: Click to open the Help menu, which contains detailed configuration instructions for the driver currently highlighted in the Available Drivers field + Select>> button: Click to select the driver currently highlighted in the Available Drivers field. 102 TnduSon Web Studio v6.1 SP6 Communication IWS Users Guide + Selected Drivers field: Lists all selected drivers and their descriptions (if available) + Remove button: Click to remove a driver currently highlighted in the Selected Drivers field When you click OK in the Communications Driver dialog, you create a subfolder for the selected driver(s) in the Drivers folder located on the Comm tab. You can right-click on a driver subfolder to access the Settings option, which opens the Tommunications Parameters dialog. Stopte|1 Boule: (9800 Paty (None pasts [2 Verio: 228 Bcc ‘Sample Communications Parameters dialog + Sorial Encapsulation field: Enables serial drivers to communicate with modem, TCP/IP or UDP connections. This setting is supported only for serial drivers developed with the UNICOMM library, which includes most of the serial drivers available in the product. }> Caution: The option Modem is not supported for Pocket PC v3.00 or older, ET > Note ‘This section covers only the Direct option, which enables the driver to connect using a normal serial channel. Please refer to Using TCP/IP and UDP Encapsulation and Using Modem Connections below for more information on| other encapsulation modes. “Serial Encapsulation Tests” lists the drivers that have been tested with modem, TCP/IP and UDP connections. + COM field: Click to select a serial communication port. + Baud Rate, Data Bits, Stop Bits, and Parity fields: Click to select parameters for a serial port configuration, + Longt, Long2, String, and String? fields: These fields are driver custom settings. In the example above, the the driver uses Long! to set up the error detection method and String! to define the PLC family type. TnduSof Web Studio v6.1 SP6 10-3 IWS Users Guido Communication + Advanced button: Click to open the Advanced settings dialog. Use this dialog to change the default driver parameters. Advanced settings 204 3} Stat message | Enimessape: 0 Intevalbeteen char |S0 ‘wat cre: [100 Hordstake CdiesleoTr Ena Ptoel Staton Rete: [0 Ble nthe ComaiRTs: 0 Tater [542 Veiy CTS: [po Anbu (512 Sinatonons Rgnte Advanced Settings dialog Specify or change the default driver parameters as follows: + Timeout (ms) area = Start Message field: Specify the timeout for the message start. — End Message field: Specify the timeout for the message end. Interval between char ficld: Specify the timeout between cach character. = Wait CTS field: Specify the timeout for the Clear to Send wait. "Handshake area = Control RTS drop-down list: Specify whether to use the “Request to Send” control, Verify CTS drop-down list: Specify whether to use the “Clear to Send” type of, verification. ble DTR check box: Click (enable) this box to disable the DTR function (the driver will not set the DTR signal before starting the communication). + Enable IR check box (available on the Windows CE platform only): Click (enable) this box to enable the serial driver to use an Infrared interface (COM2 port) instead of a standard serial port to communicate with the device (such as the PLC, 1/0, hand-held computers, and so forth). + Protocol area = Retis field: Type a numeric value to specify how many times the driver will attempt to execute the same communication command before considering a communication error for this command. = Station field: Some slave drivers such as the Modbus Slave (MODSI} require a slave network address. Use this field to specify the slave address. "Buffers length (bytes) area - Tx Buffer field: Specify the transmission buffer length (in bytes). = Rx Butler field: Specify the reception buffer length (in bytes). 10-4 TnduSo Web Studio v6.1 SP6 Communication IWS Users Guide + Simultaneous Requests area (available only on selected drivers} - Maximum field: Specify the maximum number of requests that may be sent simultaneously to all connected devices. — Maximum per station field: Specify the maximum number of requests that may be sent simultaneously to a single device. ps Note: ‘The maximum number of simultaneous requests depends on the device and protocol specifications. Please consult the device manufacturer's documentation. IWS provides two interfaces, which you can use to configure the driver (associating tags from the InduSoft application to device addresses): + MAIN DRIVER SHEET: Provides the easiest method for configuring communication between InduSoft application tags and device addresses. This interface allows you to automatically group tags to provide the best performance during runtime. You cannot use this interface to control the time needed to scan a group of tags. individually. + STANDARD DRIVER SHEETS: Allows you to control the time needed to scan a group of tags individually. You can use both sheets at the same time. USING TCP/IP AND UDP ENCAPSULATION Most of the serial drivers available in IWS allow the use of TCP/IP or UDP/IP encapsulation. The encapsulation mode has been designed to provide communication with serial devices connected to terminal servers on your ethernet or wireless networks. A terminal server can be seen as a virtual serial port, It converts TCP/IP or UDP/IP messages on your Ethernet or Wireless network to serial data. Once the message has been converted to a serial form, you can connect standard devices that support serial communications to the terminal server. The following diagram provides one example of applying this solution: TCPAP or UDP Lint Terminal Server Serie Connection TCPIP Encapsulation TnduSof Web Studio v6.1 SP6 10-5 IWS Users Guido Communication You can enable the encapsulation by following the steps below: Right-click on the driver’s folder, and select Settings form the menu that displays. This will give you access to the communication parameters: CL - « = Project: Example APP In the Serial Encapsulation field, select TCPIP or UDPIIP: Seid Encapadatine Heme IP Addees: (0009 Pa Nueber.1b001 Stowe Tag sens Mode Verso: Selecting a Serial Encapsulation The following fields are available: + IP Address field: Specify the IP Address for the Terminal Server. This field accepts tags between curly brackets. + Port Number field: Enter the TCP/IP or UDP/IP port number. + Status Tag field: This field is available only when using TCP/IP. The tag on this field receives the value 1 when the TCP/IP connection is established; otherwise, it receives 0. + Server Mode field: The TCP/IP encapsulation allows the Server Mode, making the remote client responsible for establishing the connection to enable the communication. 10-6 TnduSon Web Studio v6.1 SP6 Communication IWS Users Guide USING MODEM CONNECTIONS. Most of the serial drivers available in IWS allow the use of modem connections. The modem connection has been designed to enable communications with remote serial devices connected through a phone line. The following diagram provides one example of applying this solution: Soria Carnection . P=] £ Modem Connection You can enable the modem connection by following the steps below: @_ Right click on the driver's folder, and select Settings from the menu that displays. ‘This will give you access to the communication parameters: = Project: txample APP Z Selecting a Modem TnduSoft Web Studio v6.1 SPO 107 IWS Users Guide Communication > Caution: The option Modem is not supported for Pocket PC v3.00 or older. @ The following fields are available: + Name drop-down li : Select the modem that the driver will use to establish the connection. If you do not know the modem name, use the Auto Detect option. ‘The ‘Auto Detect 1 will use the first modem available, Auto Detect 2 will use the second, Auto Detect 3 will use the third, and Auto Detect 4 will use the fourth. Phone field: Enter a phone number that the driver will use to connect to the remote device. This field accepts tags between curly brackets. Settings button: Click on this button to configure the modem settings. The window ‘that displays when you click on this button depends on the operating system that you are using and on the modem type. > Caution: The settings configured by clicking on this button are not saved with your application, The information is saved on the operating system registry, and they are valid only in the computer that you are interacting with. If you install your application on another computer, you will have to reconfigure these settings Connection button: Click to open the Connection Control window. The default connection settings should suffice for most of the applications. However, you can take full control over the connection, and also enable incoming calls, by clicking on this button. Cennaction Control tala Hoe rang upuiaier: Plato conect-Retrytrkeval [120 (DDoecont alia for morathan | 120 (Does neonangcate Cat Coe Connection Control log Dial outrigger field: When the value of the tag configured in this field changes, the driver will try to connect to the remote device. If the connection has already been established, the command is ignored. You do not have to use this field if, you are using Auto Connect = Hang up trigger field: When the value of the tag configured in this field changes, the driver will disconnect from the remote device. If the device is disconnected the command is ignored. You do not have to use this field if you are using Disconnect calif idle for more than. Auto Connect field: When this option is enabled, the driver will try to connect to the remote device before sending any information. If the connection fails, the next attempt will be made after the Retry Interval has expired. 10-8 TnduSon Web Studio v6.1 SP6 Communication IWS Users Guide Disconnect calif idle for more than field: When this option is checked, the driver will automatically disconnect from the remote device if no communication is performed after the time you specified. Enable incoming calls field: Check this option if you want to enable the driver to receive calls from the remote device. You can use the Hang up trigger to drop the call once it has been established. Notice that one driver can use both incoming calls and outgoing calls. + Status area Code field: Enter with a tag that will receive one of the following codes when the driver is running: ca Pe (0 | Disconnected 1 | Connected 2 | Daiing 3_| Dropping 4_[ Closing ine Description field: Enter with a tag that will receive a complete description of the current status. The description is associated with the Code field; however, it brings some additional information about the current status. SERIAL ENCAPSULATION TESTS Most of the serial drivers should work with every serial encapsulation mode. However, most of the drivers were developed before encapsulation modes had been created. The following table lists the drivers fully tested with certain encapsulation modes; if the driver that you intend to use is not listed and you are unsure if it will work, please contact your distributer. rg Modem 0 Ca MODSL @ @ wi ‘ABKE | a a i MoDBU | cs] oa @ over | _ a a [BI= item has been tested = Item has not been tested InduSoft Web Studio v6.1 SP6 10-9 IWS Users Guido Communication Configuring the Driver Worksheets ‘This section explains how to configure the MAIN and STANDARD DRIVER SHEETS (or ‘Communication tables) to associate application tags with the device addresses. You can configure multiple Driver worksheets—each of which is divided into a Header section and Body section. The MODBU driver will be used for demonstration purposes, = Note: Not all drivers require a MAIN DRIVER SHEET. Some drivers only require one ‘Standard Worksheet. Consult the driver documentation for specific instructions. CONFIGURING THE STANDARD DRIVER WORKSHEET Use the following steps to create a new Standard Driver Worksheet: From the IWS development environment, select the Comm tab, located below the Workspace pane. % Im the Workspace pane, expand the Drivers folder and right-click the MODBU subfolder. When the pop-up menu displays, select the Insert option: Egy Project Totorat ar Gy Drivers © 2 Meat gor Airertr moe fae tle Inserting a Driver Worksheet ‘The Driver worksheet (.drv) contains two sections: + Header: Contains all the information about the reads and writes commands + Body: Contains the operator’s addresses 1010 TnduSon Web Studio v6.1 SP6 Communication IWS Users Guide Configuring the Header The Driver worksheet header contains configuration information required for the driver’s functions. Initially, you must create a new Driver Configuration worksheet for each area with which you want to communicate. Pesce a fee erinPmnlym ce FeniCoreond: Ronson ‘eta cab widetetee Sac) welll se vs r — | | —— Header Section of Driver Worksheot The header contains the following fields: + Description: Type a description of the worksheet, such as area types, their ranges, and if the worksheet is Read, Write, or Both. This description displays in the Workspace, in the Drivers folder. + Increase read priority: For read worksheets (and there can be more read worksheets with the same read trigger or enabled when idle) and a write event happens, the ‘worksheet with the highest priority will be the first worksheet on the next reading called by the read trigger or the “read when idle” event. + Read Trigger: Contains a tag that always generates a read event when value of the ‘tag in the field changes. + Enable Read when Idle: Contains a tag or value that always enables a continuous read when it the value is greater than zero. + Read Completed: Contains a tag value that toggles when a read event is finished. "Read Status: Contains a tag that always has its value filled with an integer value, when a read event finishes. If this value equals zero, the event is completed successfully. If any other value displays, the event completed with an error. You can view the error message in the Logwin module (for NT/2000) or check the MODBU.MSG file in the InduSoft Web Studio's oRV directory. + Write Trigger: Contains a tag that generates a write event for the entire worksheet, whenever the value of the tag changes. Oo > IMPORTANT! When using this feature, the driver writes the tag value to the PLCs memory, ‘This operation writes using blocks, from the first worksheet operator up to the last. If there is an operator that has not been declared in the worksheet, and its address is between the first and the last block, the tag will receive the| value zero. Therefore, be sure about what you want to write when using this trigger, and verify whether there is any kind of hole in the worksheet that can| cause problems for the system or the PLC's program. TnduSon Web Studio v6.1 SPO 10-11 IWS Users Guido Communication Enable Write on Tag Change: When the value of one of the tags in the body is different from the write trigger, IWS writes the changed tag in the worksheet (its value is. greater than zero), Write Completed: Contains a tag value that toggles when a writing event finishes, Write Status: Contains a tag that always fills with an integer value, when a reading event finishes. If this value is equal to zero, the event is successful. Any other value indicates an error. You can view the error message in the Logwin module (for NT/2000) or check the OMPLC.MS¢ file in the InduSoft Web Studio's \DRV directory. Station: Must [if indicated in the driver's help file) contain the CPU's ID, Unit Number, or PLC Address it relates to this specific worksheet. Each driver has a different syntax for this field. For example, the GE Fanuc SNP driver allows you to identify the PLC using all ASCII characters, but the OMRON Host Link Protocol allows from only 1 to 31 addresses called Unit Numbers. ‘Typically, you use the address of the PLC in a device network. You can also enter a tag between curly brackets (for example: (tag)) poses apo enter a tag Petwcen curly brackets Hor xempics (eag)) > Notes: * You cannot test the existence of tags entered inside curly brackets (or entered in a different form from tags in other fields), because they have not| been created in the Tags database yet. In other words, if you type an uncreated tag, the system cannot work properly. * Station is a string field and must be filled in correctly or the driver will not work properly Header: Must contain the worksheet header. This field is extremely important. Each driver has a different syntax for this field; however, you must type something like the operator's type, followed by the initial address. ‘The following table contains some examples: pd He Co opus 4X:100_| 4X indicates that this worksheet will communicate withthe Holaing Registers, from the address 100 on n the AEG 984 case, from the address 400100 on. OMPLC (Host | IR:0 | IRindicates that this worksheet wll communicate wit the UO and intemal Link) Relays from the address 0 on. In the C200H case, from the address 100000 on, JUC(SNP) | SéM | 4M indicates that this worksheet will communicate withthe kM discrete internal operator. There's na intial address to this criver. ABKE (OF) N70 | N7 indicates that this worksheet will communicate with the N7 fie, from the address 0 on. In the PLC-5i40 case, rom the address N70 AS511 (Siemens | DB5:10 | DBS indicates that this worksheet will communicate withthe Data Block PG Port) number 5, from the Data word 10 on. 1012 TnduSof Web Studio v6.1 SP6 Communication IWS Users Guide So, for each driver this syntax can vary. Most of the time, this is the address of the PLC in a device network. For example, let's use the MODBUS syntax: : Where: is the reference with which you want to communic: For example, if the header is 4x:1, IWS will read the worksheet from 4000001 until the highest offset configured in the Address column. You can use the following references: 0X: Coil Status 1X: Input Status (read only} 3X: Input Register (read only) 4X; Holding Register ID: Report Slave (read only) ‘There are no limits for the initial address, but be careful when specifying address limits. For example, on the PLC there is no 30500. The Header field accepts the syntax 3x:500, but the runtime will not find this register. ‘Where Read Only is indicated, the write functions will not work. It is not safe to specify write for the Input Status, Input Registers, and the Report Slave functions. This field can also be filled with a tag between curly brackets (for example: (tag). = Note: As with the Station field, you cannot test the existence of tags entered inside curly brackets (or entered in a different form from tags in other fields), because| cy have not been created in the Tags database yet. In other words, if you type an uncreated tag, the system cannot work properly. When you first create a new Driver worksheet, the field is blank. After you place the cursor on this field (even you try to make it blank again) IWS automatically inserts the default 0X:1 string. From this point on, you cannot make the field blank again, You can however, change the value to another valid header. "Min/Max: Becomes enabled after you enable ([¥) the check-box. When selected, this, parameter enables a range of values that can be converted into an engineering format. These fields determine the minimum and maximum range of values. For example, memory holds values from 0 to 4095 meaning 0% to 100% in the user interface. This setting takes effect for all tags in the worksheet. In this example, the tag parameters Min and Max must be set 0 to 100 respectively. TnduSon Web Studio v6.1 SPO 10-13 IWS Users Guido Communication Configuring the Body The Driver workshect's body section assigns the PLC’s memory address to declared tags and handles the engineering units, Tages a est FrAsesea TAG_COBL fras.com Fras cert FrAS_CoB1 PRacar Body Section of Driver Worksheet ‘The Body section contains four columns: + Tag Name: Contains tags used by the communication driver + Address: Contains addresses to read and write tag values to in the equipment. ‘As with the Header field, this column is different for every driver. Typically, you type the offset from the initial address you configured for the Header field. In some cases, you can indicate the specific Address bit. For our driver example case, type the offset from the initial address you configured for the Header field. You cannot enter a negative offset—the value 0 will overwrite a negative value, + Div/ Add /Max /Min: Configure as follows: Aan Nica eka ou Div Any integer or Host value) | DIV Real In. write commands: Host value = Tag * DIV I Add | Anylntegeror | Inread commands: Tag = (Host value) + ADD Real In write commands: Host value = Tag - ADD os _ Min Any Integer or | Defines the minimum value assigned forthe tag, when the Real Corresponding host's value is equal othe value defined in the field Min ofthe Driver worcsheet's Header. Max | Any integeror | Defines the maximum value assigned forthe tag, when the Real Corresponding hos’s value is equal othe value defined inthe feld Max ofthe Driver worksheet’s Header. % Notes: For read operations: =(() / Div)+ Add For write operations: = ( - Add) * Div Ifyou do not configure the columns as specified in the preceding table, the columns will not be configured and the Driver worksheet tags will receive the| same value as the address configured T0414 TnduSon Web Studio v6.1 SP6 Communication IWS Users Guide Use the following steps to specify header tags: @_ Specify the following tags in the Driver worksheet Header fields. All of the tags will be arrays, and you must type each element on each worksheet. For example, Rd? [1] in the Read Trigger ficld of the ABKE0O1.DRV worksheet, and Rar [5] in the ABKEOOS.DRV worksheet, and so forth. a Ratr | 0 | Boolean | Boolean tag that will be on the "Read Trigger fields RdEn | 0 — | Boolean | Boolean tag that willbe on the "Enable Read when Idle" elds Rdcpl | 0 | Boolean | Boolean tag that willbe on the "Read Complete" fields. Rast | 0 Integer tag that will be on the "Read Status" elds Wrtr | 0 | Boolean | Boolean tag that willbe on the "Write Trigger” elds Wren | 0 | Boolean | Boolean tag that willbe on the “Enable Write when lal” felés Wrcpl | 0 | Boolean | Boolean tag that will be on the "Write Complete" felds west | 0 | Integer | Integer tag that wil be onthe "Write Status’ felis Station | 0 | Sting _| String tag that wil be on the "Header” fel Header | 0 | String | String tag that wil be on the "Staton" fel @ Specify 7ac_DRV as an Array tag, size 10, for the communication tags. TnduSon Web Studio v6.1 SPO 10-15

Você também pode gostar