Howto Wincc v6 Ingearopc

Embed Size (px)

Citation preview

  • 7/27/2019 Howto Wincc v6 Ingearopc

    1/21

    How to Connect WinCC V6 to the InGear OPC Server

    The purpose of this paper is to demonstrate how to connect Siemens WinCC V6 to theINGEAR OPC Server. This example uses the INGEAR AB OPC Server connecting to aControlLogix, but the same steps are used to connect to other PLCs supported by the INGEARAB OPC Server or to any of the other INGEAR OPC Servers.

    The information provided here is not a substitute for your WinCC V6 documentation. We arecovering how to do this in order to show a complete connection, not to provide comprehensivetraining on how to build WinCC V6 screens.

    1) Configuring the INGEAR OPC ServerOpen the OPC Server from the Windows Start menu as shown below.

    When the INGEAR AB OPC Server opens you will see the Quick Start dialog below. Detailson configuring the other INGEAR OPC Servers can be found in their respective help files.Tags dont have to be entered into the OPC Server as done in this example. Dynamic tags canbe added from within WinCC as long as a Driver, (under EditComm Settings on theINGEAR AB OPC Server Menu) and Device are configured first in the INGEAR OPC Server.

    The use of dynamic tags is covered at the end of this document.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 1 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    2/21

    How to Connect WinCC V6 to the InGear OPC Server

    Click on the OK button on the Quick Start Configuration screen.When configuring a ControlLogix you can import the tags from the AB RSLogix 5000 PLCprogramming software if you have saved this file as an .L5K file. The L5K file can be createdin RSLogix 5000 by choosing File, Save As and choosing to save your project as a L5K

    extension. If youre connecting to something other than a ControlLogix then click on the QuickStart button as shown below.

    Once you click on Open L5K you can browse to the L5K file as seen below.

    Click Open and the OPC Server will begin importing the tags. The L5K Import Status willpop-up as shown below while the tags are imported.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 2 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    3/21

    How to Connect WinCC V6 to the InGear OPC Server

    When the OPC Server is done importing the tags, the name of the device as pulled from theL5K file can be seen in the tree window to the left as seen below. In this case the device iscalled SWTBtestCPU. You can click on the + sign to expand the tree and see all the tags andgroups imported from the L5K file. Tag groups and tags that wont be used can be deleted.

    The first thing to do is to check to make sure the right IP address was imported. This is done bygoing to the Edit menu and choosing Comm Settings as shown below.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 3 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    4/21

    How to Connect WinCC V6 to the InGear OPC Server

    When entering Dynamic tags only without the L5K import, selecting EditComm Settings

    would be the first step to configure a Driver so that the OPC server knows how it will

    communicate to your PLC.

    The Driver Selection dialog will open showing the configured drivers. If your IP address is

    shown correctly simply click Cancel. If its wrong or you are not sure click on Configure. Youcan change your IP address to the correct one and close the dialog.

    When manually configuring the Driver because you are using Dynamic Tags or manually

    setting up the OPC server for some other reason, you will click on the drop-down under

    Supported Drivers, choose the driver for the type of connection you are using and click on the

    Add button. Once a Driver is installed you can go to Add and choose NewDevice to manually

    add a device as shown below or Click on the Quick Start Configuration to guide you through.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 4 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    5/21

    How to Connect WinCC V6 to the InGear OPC Server

    Next we will check the device configuration by right clicking on the device name as shownbelow (SWTBtestCPU in our case) and choosing Properties.

    When manually configuring the OPC Server or doing Dynamic tags we suggest that you add at

    least one tag to check communications. This would be done by choosing New Tag from this

    same menu above. The Tag Properties window will open as shown below. See the INGEAR

    OPC Server help file or press on the Help button shown in the InGear OPC Server for detailsabout these settings.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 5 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    6/21

    How to Connect WinCC V6 to the InGear OPC Server

    The Device Properties window will open as shown below. Check to make sure the Driver thatwe configured above is selected. Verify that the PLC Node is the same as the Slot number thatyour ControlLogix CPU is located in. Check the INGEAR AB OPC Server help file if yourControlLogix is on a different rack from the Ethernet module you are using. In this case a routepath will have to be entered and specifics on creating a route path for various types of

    configurations, including ControlLogix Gateway, are included in the INGEAR AB OPC Serverhelp file. The help file is accessible from the Help button on the Device Properties dialog asshown below.

    Once these items have been verified click OK.

    When Manually configuring or doing Dynamic tag this screen will need to be configured as

    discussed above. The Driver in the drop down will need to be selected (the available selections

    will depend on what you have configured for Installed Drivers under the EditComm Settings

    options) as well as the PLC type by selecting the appropriate radio button. See the help file for

    more information about the PLC Node address or ControlLogix route address.

    The final part of configuring the OPC Server is to test the Connection. This can be done now or

    at a later time when you are connected to the PLC. This next step can be done as long as atleast one tag is configured in the OPC Server. As previously stated, we suggest having a singletag configured just for basic success/fail testing, even if all the other tags are addedDynamically from WinCC.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 6 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    7/21

    How to Connect WinCC V6 to the InGear OPC Server

    Select a group under the device as shown below. In this case a group named Dint wasselected. The tags configured under this group are shown in the right pane.

    Click on the Debug icon to the far right as shown below. This can also be done by clickingView|Monitor on the OPC Server menu. This starts the connection to the PLC. Under theStatus heading in the Event pane on the bottom of the Server. If there are errors these will beshown here along with the Last error. The INGEAR OPC Server Help file lists the errors underthe Troubleshooting section.

    Once the connection to the PLC has been made the Value for the tags will show under theValue column as shown above.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 7 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    8/21

    How to Connect WinCC V6 to the InGear OPC Server

    2) Configuring WinCC V6

    Open WinCC V6 and Create a New project (oropen an existing one) and click OK.

    Name your project aclick Create or selecprevious project.

    ndt a

    ightThe screen will then return to WinCCExplorer. R

    click on Tag Management and choose, Add NewDriver as shown below.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 8 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    9/21

    How to Connect WinCC V6 to the InGear OPC Server

    Choose OPC.chn from the Add new Driver bin list and click Open.

    Expand the Tag Management tree as seen below and right click on OPC Groups.

    The Channel unit properties dialogwill open. Click on the New button

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 9 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    10/21

    How to Connect WinCC V6 to the InGear OPC Server

    Name your Connection under the Connection properties dialog and choose Properties

    Under the OPC Server Name enter:CimQuestInc.IGOPCAB.1 for the INGEARAB OPC Server and click OK. This iscalled the ProgID and can be found in thehelp file for any INGEAR OPC Server aswell as below.

    ProgIDs

    INGEAR AB-CimQuestInc.IGOPCAB.1INGEAR Modbus-CimQuest.IGMBOPC.1INGEAR GECimQuest.IGGEOPC.1INGEAR OmronCimQuest.IGOMOPC.1

    Click OK

    Click OK on the Connection propertiesdialog.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 10 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    11/21

    How to Connect WinCC V6 to the InGear OPC Server

    Click OK on the Channel unit propertiesdialog.

    Expand the OPC Groups Icon in WinCCExplorer and Rclick on the Connection you created following the stepsabove. Choose New Group from the drop down as shownbelow.

    ight

    The properties of the tag group will open as shown below.

    Name your group and click OK.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 11 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    12/21

    How to Connect WinCC V6 to the InGear OPC Server

    The group name is somethingmeaningful to your project.

    We can now begin adding Tagsto the project.

    OPC Tag Browsing

    Expand the Connection Icon from in theWinCCExplorer tree and right click on theICON Called OPC Groups then chooseSystem Parameter as shown here.

    The OPC Item Manager will open.

    If you are connecting to an OPC

    Server on a different PC you will

    need to configure DCOM on both

    PCs. Please seehttp://www.opcactivex.com/dcomfor details on DCOM

    configuration. This website will

    direct you to DCOM

    configuration information for all

    Windows Operating Systemsincluding free tutorial videos.

    You will need Administration

    rights on both PCs to make these

    changes.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 12 -

    http://www.opcactivex.com/dcomhttp://www.opcactivex.com/dcom
  • 7/27/2019 Howto Wincc v6 Ingearopc

    13/21

    How to Connect WinCC V6 to the InGear OPC Server

    Expand and browse for the INGEAR Servers ProgID as shown below. Highlight the ProgIDand click on the Browse Server button.

    ProgIDsINGEAR AB

    CimQuestInc.IGOPCAB.1

    INGEAR Modbus -CimQuest.IGMBOPC.1

    INGEAR GE CimQuest.IGGEOPC.1

    INGEAR Omron CimQuest.IGOMOPC.1

    The Filter Criteria dialog will open after you click on the Browse server button above. See yourWinCC V6 for information on the Filter Criteria.

    You must click on the check boxes if you want tofilter based on the tags Read and Write accessunder Access Authorization before you click onthe Next button.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 13 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    14/21

    How to Connect WinCC V6 to the InGear OPC Server

    The Browse Window above will open after clicking Next on the Filter Criteria dialog whichwill allow you to browse for the tags you want added to your project. In this example we willbrowse for tags under the ControllerTags group

    Under the ControllerTags Group in our PLC there is a group called DInt that we highlight. Allthe tags in the DInt Group will be listed in the panel on the right as shown above. To highlightmore than one tag at a time simply hold down on the Shift key and scroll to the end of the itemsyou would like to add. In this example we will add all tags in the DInt array by highlightingthem all and clicking on the Add Items button.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 14 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    15/21

    How to Connect WinCC V6 to the InGear OPC Server

    The Add Tags dialog will open once youclick on the Add Items button on thebrowse window. The Add Tags dialoglets you modify the tag name as read fthe server when imported into WinCC

    V6. You can add any Prefix or Suffixthat will help distinguish the tags in yourproject. See the WinCC V6 help formore information if needed.

    rom

    In this example we will add SWTB to thePrefix. Now click Finish.

    Before click the Finish button it is important you highlight thegroup you want to add the tags to as shown to the right. You canhave more than one group, but you have to pick one to add thechosen tags to. A warning that you need to choose a group willappear if this is not highlighted first. Once you highlight your group click the Finish button

    The dialog showing Please wait will show the progress

    of adding all the tags that have been selected.

    Once the tags are added, the Please wait dialog will close and you can close the browsewindow by clicking on the X as shown below or add more tags to the same or different groupsfollowing the same method just shown.

    Once the browse window is closed you can close the OPC ItemManager as show to the right or click on the Exit button.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 15 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    16/21

    How to Connect WinCC V6 to the InGear OPC Server

    We can now return to the WinCCExplorer and see the tags that have been added by highlightingour group as shown below.

    We can now start work in Graphic Designer

    Connecting with Graphic Designer

    We can now open Graphics Designer and test our tag connection as seen below.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 16 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    17/21

    How to Connect WinCC V6 to the InGear OPC Server

    In this example we will choose an I/O Field on the Object Palette and place it on the form

    The I/O Field configuration will open. Click on the button to select a tag.

    See your WinCC V6 documentation for the otherconfiguration items in the I/O-Field Configurationdialog not covered directly in this document.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 17 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    18/21

    How to Connect WinCC V6 to the InGear OPC Server

    Expand the tree to the tag group configure and choose the tag we created above.

    The update rate that the tag should be scanned atcan be selected here. The Update rate is the ratethe OPC Server will scan the PLC/device. This

    rate is controlled by WinCC V6 and not the OPCServer. For more information on Update rate

    configuration see your WinCC V6 documentation.

    The Update rate does not guarantee that the

    updates will return in this time, only that the OPC

    Server will attempt to read them at this rate. There

    are many factors involved in the rate tags can be

    read and is outside the scope of this paper.

    Click OK once finished.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 18 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    19/21

    How to Connect WinCC V6 to the InGear OPC Server

    Click on the Run button to start WinCC runtime as shown below.

    The WinCC Runtime Screen will open and the value in the PLC can now be seen in the I/OField as seen below.

    You are now done with the example in this document. Please see your WinCC V6documentation or any additional features or functions beyond the I/O field connection shown inthis document. The Dynamic Tag Configuration that follows is only needed if you are notbrowsing for tags as shown in this example.

    Dynamic Tag Configuration:

    If tags are not added into the OPC Server or you prefer not to browse for tags for some reasonyou can configure Dynamic tags in WinCC V6 using PLC/Device addresses. If using DynamicTags, a Driver must still first be configured under EditComm Settings and a new device mustbe configured in the OPC Server at a minimum.

    Start by right clicking on the Group as we createdabove in WinCCExplorer. Choose New tag fromthe options as shown to the right.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 19 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    20/21

    How to Connect WinCC V6 to the InGear OPC Server

    Enter a name for this Tag that will beused in WinCC V6 then click on SSee your WinCC V6 about any of theother options on this dialog.

    elect.

    This Item Name,SWTBtestCPU.Tag2@DInt[0]|VT_I4,would be used to connect to a tag DInt[0]in the PLC. Click OK when finished

    At this point this tag can now be accessedinside Graphics Designer as shown earlierin this document above when connectingto browsed tags.

    Meaning of the parts of the Dynamic Tag/Item Name Entered above:SWTBtestCPU is the device name in the OPC ServerTag2 is a name given to the tag and can be any name your choosing.@Dint[0] is the actual PLC address being read|VT_I4 is the data type for this address (a full listing of these data types are in the INGEAROPC Server help file)

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.- 20 -

  • 7/27/2019 Howto Wincc v6 Ingearopc

    21/21

    How to Connect WinCC V6 to the InGear OPC Server

    This matrix below will help you to match the data type suffix used in Dynamic Tags to theWinCC V6 data typeOPC Native Type WinCC V6 Data Type Range

    VT_BOOL Boolean (bit value) True / FalseVT_BOOL | VT_ARRAY Array of Booleans

    VT_I1 Signed Byte (8 bit value) 128 to 127VT_I1 | VT_ARRAY Array of Signed BytesVT_UI1 Unsigned Byte (8 bit value) 0-255VT_UI1 | VT_ARRAY Array of Unsigned BytesVT_I2 Signed Short (16 bit value) -32786 to 32767VT_I2 | VT_ARRAY Array of Signed ShortsVT_UI2 Unsigned Short (16 bit value) 0 65535VT_UI2 | VT_ARRAY Array of Unsigned ShortsVT_I4 Signed Long (32 bit value) -2147483648 to 2147483647VT_I4 | VT_ARRAY Array of Signed LongsVT_UI4 Unsigned Long (32 bit value) 0 to 4294967295

    VT_I4 | VT_ARRAY Array of Unsigned LongsVT_R4 Float (IEEE Single Precision

    Real)1.40239846E-45 to3.40282347E+38

    VT_R4 | VT_ARRAY Array of FloatsVT_BSTR ASCII String Length Option required

    More detailed information on the syntax of Dynamic tags is show below.

    Dynamic Tags Fully Qualified Path Syntax

    The client specifies the Dynamic Tag in its OPC Item Address field in WinCC flexible

    Syntax: ..@|DATA_TYPE,

    . This is the name of the Device to receive the dynamic tag. The devicemust exist in the OPC Server Project Workspace

    . (optional) A device subgroup may be specified as part of the dynamictag. The device subgroup must exist in the OPC Server ProjectWorkspace

    This is the name of the tag the client will dynamically create. If the namealready exists in the OPC Server Workspace, the existing tag is used,otherwise a new tag is created.

    @ This is the data source of the tag. If the Device is a ControlLogix, this isthe atomic name of the tag. If the Device is a PLC / SLC / Micrologix,this is the data table file address

    |DATA_TYPE This is the data type of the tag. Valid types are VT_I1, VT_UI1, VT_I2,VT_UI2, VT_I4, VT_UI4, VT_R4, VT_BSTR

    , (optional) This is the length of the tag, and is used to specify thenumber of ASCII characters of the tag is a VT_BSTR type or the numberof elements if the tag is a VT_ARRAY.

    Copyright Software Toolbox Inc. 2002-2006, All Rights Reserved Worldwide. All trademarks are property of their respective owners.