Professional Documents
Culture Documents
REV 1 [2008-09-18]
ERNST.VANWYK@WONDERWARE.CO.ZA
Objectives
The objective of this training is to focus attention on project building by touching on all steps required and explaining some of the best practices and reasoning behind it. This training is not intended as a first glance at InTouch or ArchestrA. In fact: It is recommended that the student have at least some familiarity with the IDE, InTouch as well as ArchestrA graphics.
Table of contents
Module 1 _________________________________________________________________ 5
1. The Basics _________________________________________________________________ 5
1.1. Base object derivation ____________________________________________________________ 5 1.1.1. Base level _________________________________________________________________ 5 1.1.2. Master Level _______________________________________________________________ 6 1.1.3. Application Level ___________________________________________________________ 6 1.2. Toolset Organisation _____________________________________________________________ 8 1.3. S95 __________________________________________________________________________ 8
2.
Module 2 ________________________________________________________________ 19
3. The Application and Types of System objects ___________________________________ 19
3.1. The Application Level___________________________________________________________ 3.2. PLC IO addressing _____________________________________________________________ 3.3. System Objects ________________________________________________________________ 3.3.1. $Area ___________________________________________________________________ 3.3.2. $WinPlatform _____________________________________________________________ 3.3.3. $AppEngine ______________________________________________________________ 3.3.4. $ViewEngine _____________________________________________________________ 3.1. 3.2. 3.3. 3.4. Creating the System Objects ______________________________________________________ Create Application level objects ___________________________________________________ Implement auto IO addressing_____________________________________________________ Set-up Redundancy _____________________________________________________________ 19 19 19 20 20 20 21 22 24 24 26
4.
Instantiate the Top level and System objects __________________________________________ Instantiate One Mix Line_________________________________________________________ Utilise galaxy dump/load_________________________________________________________ Set up the deployment ___________________________________________________________
29 29 30 31
Module 3 ________________________________________________________________ 33
5. Graphics _________________________________________________________________ 33
5.1. 5.1. 5.2. 5.3. 5.4. 5.5. 5.6. 5.7. 5.8. 5.9. 5.10. Graphic Toolbox _______________________________________________________________ 33 Create a Panel standard __________________________________________________________ Build Button standard ___________________________________________________________ Build Valve standard ____________________________________________________________ Build a Level Transmitter Standard_________________________________________________ Build Master level Control Valve __________________________________________________ Build Master level, Solenoid Valve _________________________________________________ Build Master level, Level Transmitter _______________________________________________ Build Application level tank graphic ________________________________________________ Preparing to create InTouch Screens ________________________________________________ Create the Overview graphics _____________________________________________________ 35 37 39 40 40 41 41 41 42 42
6.
Module 4 ________________________________________________________________ 48
7. Assistant Graphics _________________________________________________________ 48
7.1. 7.2. Create an assistant Button ________________________________________________________ 49 Using an assistant button _________________________________________________________ 49 Show symbol__________________________________________________________________ 50 InTouch Windows______________________________________________________________ 50 Creating the popups_____________________________________________________________ Creating object specific pop-ups ___________________________________________________ Change Equipment Symbols ______________________________________________________ Enable the Level Transmitters popup _______________________________________________ 51 53 54 54
8.
Module 1
Derivation and Model
1. The Basics
Before a project is attempted it is necessary to perform some basic steps. This will result in a base galaxy that should always be the starting point of a new project. These steps require some thought and include the following: Base object derivation Toolset organisation Modelling standard
Best Practice
Never instantiate objects directly from top level (default) templates
Top level (default) templates cannot be modified this means that all changes must be made in instances (of which there may be many)
It should always be remembered that derivation implies the sharing of functionality. Derivation view indicates which objects share functionality and capability with which. A parent objects capabilities are inherited by a child object.
Master objects are the standards of the enterprise. They are prefixed with an m_. Master objects are derived from base objects and not from top-level (default) objects. Master objects are normally enforced Standards (e.g. what properties should at a minimum be present in the template) or Enterprise specific standards (i.e. an object representing a physical asset that is used in all parts of the enterprise and should be standard e.g. $m_LIMS). Master objects can also be lower derivatives of the abovementioned objects, but should contain no Application specific functionality (e.g. $m_Valve $m_ControlValve).
Generally IO assignment can be viewed as Application specific (since various sites/applications might have different PLCs). IO assignment can be present in Master templates, however, if the method of this assignment should be standardised. Note that if a complex object is required to be standard across all Applications, it should be built in the Master level. This means that Master level templates can already be containers with contained objects.
assignment) exists for a master object another a-level derivation is needed. In other words: If all pumps in this application have something in common (such as PLC addressing) but differ from pumps in other applications in the enterprise then an $a#_Pump is required. In this case the derivation will look as shown.
In the following example System Integrator A (SIA) designed a Mixing Tank with an Agitator. They designed their own Agitator with their custom code ($a0_Agitator). Later System Integrator B (SIB) designed a Reactor for the company it also requires an Agitator, but this one has some differences to that of SIAs. Even though both SIs standardised on $m_Agitator, they have made different implementations of it.
Best Practice
Create three levels of derivation (Base, Master and Application)
Base level templates allow propagation of asset independent functionality across the entire galaxy/enterprise. Master level templates allow the setting of standards without restricting the implementation of those standards. Application level standards allow the individual implementation of master level standards while also providing for splitting different implementations
Best Practise
Create Numbered Toolsets and hide unused toolsets
Numbered Toolsets can be sorted alphabetically Navigation to standardised tools are easier if they organised into a well-defined structure Hiding unused toolsets prevents the usage of incorrect templates
1.3. S95
It is desirable to have a standard for modelling and the S95 standard is recommended for the top levels.
The concept is implemented in the three levels (Base, Master and Application). The Base level has no relevance here except for the fact that a decision needs to be made as to which S95 levels should derive from $b_Area and which ones from $b_UserDefined. Usually the distinction is made between Work Centres and Work Units in the S95 model,
8
with Work Centres and higher hierarchical objects deriving from $b_Area and Work Units and lower objects from $b_Userdefined.
Best Practice
Implement the S95 standard for the plant model
This standard is international and will make an application more understandable for other users/developers. The standard has been well thought through and alleviates the developer from this responsibility.
10
Move $InTouchViewApp into the 0. Base Templates |1. System Toolset (this template is the InTouch application and can only be derived once) Hide the Original System toolset o Right-click the System toolset o Click Hide Hide the other original toolsets: o Application o Device Integration
11
From $b_Area derive a $m_Enterprise with the following procedure: o Right-click $b_Area o Click on New | Derived Template o Change the name to m_Enterprise Derive the following S95 templates from $b_Area o $m_Site o $m_Area o $m_WorkCentre Derive the following S95 templates from $m_WorkCentre: o $m__ProcessCell (Notice the double Underscore) o $m__ProductionLine o $m__ProductionUnit o $m__StorageZone Derive the following from $b_UserDefined o $m_WorkUnit o $m__ControlModule o $m__EquipmentModule o $m__Transmitter Derive the following from $m_WorkUnit o $m__ContinuousUnit o $m__StorageCell o $m__Unit o $m__WorkCell Move the Templates to their correct toolsets as shown Notice that the double underscore used in some of the templates will ensure that those templates always appear at the top of the particular toolset.
12
Sherwood Forest one has four designated S_E_MX001 to S_E_MX004). Each mixing line has two tanks used to premix extracts used in production. A P&ID is shown for one mix line (all four are identical). The client also supplied a list of PLC blocks for the various equipment types. Notice that the Solenoid Valve PLC block does not calculate the travelling time. The client has however requested that this calculation be made in the ArchestrA framework. The client has also indicated that other Sites have tanks that contain more or less inlet valves. The PLC block naming scheme is built using one or two letter acronyms for Process cells (PC), Units (UN), Control Modules (CM) and Transmitters (TX) and three figure numbers for each of these (###). These numbers are separated by underscores. A generic example would look as follows: PC###_UN###_CM### Some of the acronyms are listed below Mixing Line = MX Tank = T Inlet Valve = IV Outlet Valve = OV Level Transmitter = LT
13
Control Valve
Inputs
Cmd.Position
Outputs
Status.Position Status.Open Status.Closed Status.TravellingTime
Solenoid Valve
Inputs Cmd.Open Cmd.Close Outputs Status.Open Status.Closed
2.3. Transmitters
2.3.1. Level Transmitter
Transmitter
Inputs Outputs PV
From the PLC block it is evident that all transmitter types look the same.
14
From the clients request it is also implied that the travelling time should be present in both the valve types. These three properties should be added to a template (called $m_Valve). From this template the Control and Solenoid valves can be derived. A well-defined naming convention should be used for attributes. A suggested naming convention is provided on the next page.
Best Practice
Use a well defined naming convention for all attributes
This will help identify the purpose of an Attribute. It will also identify its context which will assist with the security assignment. It will also allow better sorting (for instance when locating all UDAs that must be configured in design time)
15
Description Set-up parameter set during design time (Typically Startup scripts use them) Configurable parameter Object must be set off scan to change (typically OnScan scripts use them) Engineering Set Point Only certain personnel can change these Calculate value Cannot be changed by anything but a script Set point Operational set points that can be changed by operators Commands When set to TRUE, a function is performed. On completion the value returns to FALSE Mode Select Indicates a specific mode. Stays in state until mode is changed. Process value Typically an Analogue value that is measured with and instrument. Status value Indicates status of something in the field (typically not an Analogue value) Alarms flag Indicates that something is in alarm Interlock flag Indicates that something is interlocked Simulation Attributes Used to simulate something. An object should still be functional if all Simulation Attributes and Scripts are removed
Cfg. [Attribute].Parameter
Cfg.[OrderDataBase].ServerName (Connection is established every time the Engine goes on Scan)
Configure
Eng. [Attribute].SetPoint
Eng.[Feeder].Speed.Maximum (Only Tune permitted users can change the maximum speed)
Tune
Calc. [Attribute].Parameter
Calc.[Cable].Length (Length is calculated from measured weight)
Calculated
SP. [Attribute].SetPoint
SP.[Feeder].Speed (Operating set point speed of feeder)
Operate
Cmd.[Attribute].Command
Cmd.[Feed].Start (Start the Feed sequence)
Depends on command
Select.[Attribute].Mode
Select.[Mode].Auto (Selects the Auto mode)
Depends on mode
[Attribute].PV
[Level].PV (Process value of the Level)
Object Writable
Status.[Attribute].Status
Status.[InletValve].Open (Indicates when the valve is open)
Object Writable
[Attribute/Status/PV].AlarmType.Alarm
[Tank].Level.High.Alarm (Indicates Tank is in alarm because level is high)
[Attribute/Status/PV].InterlockType.Interlock
[Pump].ValveClosed.Interlock (Indicates Pump is interlocked because valve is closed)
Sim.RestofNameparts
Sim.Eng.SimulatedPV.Maximum (Change the maximum simulated PV value)
16
17
Click on the Object Information tab and supply a valid description Click on the UDAs tab Create a Status.TravelTime UDA with the following procedure: o Click the button o Type the name Status.TravelTime o Select the data type as ElapsedTime.
Save and close $m_Valve Open $m_ControlValve Add an Analogue (Float) Field Attribute called Cmd.Position Enter a Description Make the Engineering Units % Add another Analogue (Float) Field Attribute called Status.Position Change the access mode to Input Enter a Description Make the Engineering Units % Save and close $m_ControlValve Open $m_SolenoidValve Add a Discrete Field Attribute called Cmd.Open Enter a Description Add an identical Field Attribute called Cmd.Close Save and close $m_SolenoidValve Open $m__Transmitter Add an Analogue (Float) Field Attribute called PV Change the access mode to Input Enter a Description Make the Engineering Units Litres Save and close $m__Transmitter
18
Module 2
Functionality and Deployment
3. The Application and Types of System objects 3.1. The Application Level
The next step is the implementation of the Application level templates. The Application level templates implement functionality specific to the application. The application can be interpreted as an implementation: By the same System Integrator For the same PLCs For the same Project For the same Area/Type of plant
The lowest level in the Master level should always be derived as the top level of the Application level. At this level the tank can now also be assembled with its contained control modules and transmitters. The Container template should contain only one of each type of control module or transmitter. The tanks in this system contain one or more identical inlet valves, one outlet valve and a level transmitter. The Application level tank template should only contain one inlet valve. This will allow the developer to instantiate the number of valves required while maintaining a derivation structure that does not become unmanageable.
19
Galaxy Repository At least one Application Server At least one View Client
3.3.1. $Area
A $m_SystemsArea template (with its corresponding $a0SystemsArea) is required. This template will be used to house the system objects (Platforms, Engines etc.) in the model view.
Best Practice
Create a Systems Area on an engine running on the GR to contain system objects
This allows rolling up diagnostic data It also provides a logical place for system objects in the model (which would otherwise be hosted under Unassigned Area)
3.3.2. $WinPlatform
There should be at least the following Master level derivations of $b_WinPlatform: $m_GRPlatform $m_AppServerPlatform $m_ViewClientPlatform
Following the BMA derivation scheme this means that the at least the same set of Application level derivations should be made.
3.3.3. $AppEngine
Several types of application engines are also needed. The most obvious is the $m_AppEngine with its corresponding $a0_AppEngine. Two other engines are also required: $m_GREngine ( $a0_GREngine): This engine will house the centralised objects (S95 Enterprise, may be the S95 Site as well as the Systems Area). This engine can also be used to calculate some diagnostic data on the system objects $m_TestEngine ($a0_TestEngine): This engine is used to temporarily host areas with objects still being tested. This engine has a big advantage in that objects can be tested in an environment that can interact with the real environment while only risking the Test Engine and in extreme cases the server hosting the Test Engine. The Test Engine can usually be run on the Galaxy Repository, since the system can function without the Galaxy repository for a fair period of time.
All engines should have a tag pointing to its corresponding Device Integration Object.
20
3.3.4. $ViewEngine
The $b_ViewEngine is derived twice once to the Master level and then to the Application level in keeping with the BMA derivation scheme.
21
Derive $m_DreamPLCClient from $b_OPCClient and open it. o Leave the Server Node name blank (this will use the local machine) o Drop down the Server name and select ArchestrA.DreamPLC.1 o Lock the two attributes mentioned above as per Figure on the next page
22
Derive $a0_DreamPLCClient_ExtractMixing from $m_DreamPLCClient. Open $a0_DreamPLCClient_ExtractMixing Click on the Scan Group Tab Add a new ExtractMixing Scan group using this procedure: o Click the button o Type ExtractMixing o Leave the update interval at 500ms
23
24
o o
IF me.Script.IOAssign.ExecutionCnt >= me.Cfg.IOAssign.ScanCycle THEN DIM ThePrefix AS STRING; ThePrefix = myEngine.Cfg.DIObjectName + "." + me.Cfg.IOAssign.Prefix + StringRight(me.Tagname,StringLen(me.Tagname)-4)+"."; {Add Template specific code here} me.Status.IOAssign.Complete = TRUE; ENDIF; Add the specific code pieces as indicated: o Control Valve
'FA Inputs me.Cmd.Position.Input.InputSource = ThePrefix + "Cmd.Position"; me.Cmd.Position.Output.OutputDest = ThePrefix + "Cmd.Position"; 'FA Inputs me.Status.Position.Input.InputSource = ThePrefix + "Status.Position"; me.Status.Closed.Input.InputSource = ThePrefix + "Status.Closed"; me.Status.Open.Input.InputSource = ThePrefix + "Status.Open"; 'UDAs me.Status.TravelTime.InputSource = ThePrefix + "Status.TravelTime"; o Solenoid Valve
'FA In and Outs me.Cmd.Open.Input.InputSource = ThePrefix + "Cmd.Open"; me.Cmd.Open.Output.OutputDest = ThePrefix + "Cmd.Open"; me.Cmd.Close.Input.InputSource = ThePrefix + "Cmd.Close"; me.Cmd.Close.Output.OutputDest = ThePrefix + "Cmd.Close"; 'FA Inputs me.Status.Closed.Input.InputSource = ThePrefix + "Status.Closed"; me.Status.Open.Input.InputSource = ThePrefix + "Status.Open";
25
Level Transmitter
Best Practice
Prefix all Scripts with an identifier such as Script. and give descriptive names
The prefix will help identify scripts (and sort them together) in Object Viewer. Descriptive names always give a first indication as to the purpose of a script
26
Best Practice
Use Galaxy load function with minimum columns to create multiple instances
This method allows a developer to leverage the power of Excel to design the model. The method also provides better consistency as it is easier to recognise discrepancies in Excel.
The Galaxy load function will also assist in getting the correct contained names of objects. All objects have at least one name called the Tag name. Contained objects also have a second name called the Contained name. When referencing any object or tag in an ArchestrA galaxy the first object of the reference should always be a Tag name except if the reserved relative referencing words are used (me, mycontainer, myarea, myEngine etc). Only one Tag name can be used in a reference. An example would be: ATagname.ContainedName1.ContainedName2.ContainedName3.Attribute The tag name is the objects identity no other object may have the same tag name. A tag name uniquely identifies an object in the galaxy. A solid naming convention is highly recommended. A good example of this would be the ANSI ISA S5.1/1984 (R1992) standard. A contained name uniquely identifies an object within its container other objects in the galaxy may have the same contained name but not if they are in the same container. It is desirable to make the contained name descriptive of its role or function in the container e.g. Fan_Motor, Jacking_Oil_Pump, Inlet_Valve etc.
Best Practice
Make contained names descriptive
This allows a user to easily navigate into an object without the need to know the exact name of the contained object e.g. T001.Level might mean more than LT003
Best Practice
Always instantiate objects from the Application level
This is done for consistency It also helps future proof the solution by always providing a level for implementing a standard and a level for implementing specific customisation.
4.2. Deployment
Once the galaxy is in a state to commence with the first deployment, consideration should be given to future performance. System Platform can utilise multiple CPUs and CPU cores on a server and the best way of leveraging that capability is to split instantiate two engines per CPU core (these include backup engines). Ensure that each engine has its own OPC client to the PLC.
28
o Right-click S_ExtractMixing o Click Set as Default Derive the following Instances: o From $a0_MixLine S_E_MX001 [MixLine_001] note that it appears under S_ExtractMixing Set S_E_MX001 as default o From $a0_Tank S_E_MX001_T001 note that the Inlet, outlet valves and transmitters are automatically created S_E_MX001_T002 o From $a0_Tank.InletValve S_E_MX001_T001_IV002 [InletValve_002] S_E_MX001_T002_IV002 [InletValve_002] Drag S_E_MX001_T001_IV002 into S_E_MX001_T001 Drag S_E_MX001_T002_IV002 into S_E_MX001_T002 Rename o InletValve_001 to S_E_MX001_T001_IV001 Change Contained name to InletValve_001 o InletValve_002 to S_E_MX001_T002_IV001 Change Contained name to InletValve_001 o Level _001 to S_E_MX001_T001_LT001 o Level _002 to S_E_MX001_T002_LT001 o OutletValve_001 to S_E_MX001_T001_OV001 o OutletValve_002 to S_E_MX001_T002_OV001 o Make sure that the two second InletValves have the correct contained Names Note that errors are present o Right-click any object with an error (e.g. S_E_MX001_T001_OV001) o Click Properties o Click on the Errors/Warnings Tab o Note the warning states that the Cfg.DIObjectName could not be found on myEngine. This is because these objects have not been assigned to an Engine yet (i.e. myEngine does not exist for them).
30
Caution
Double-clicking a CSV file to open in Excel can sometimes take a very long time to open. This is due to a bug that was re-introduced into the Office suite with version 2007. Do not attempt to close the Excel as it will continue loading the document and then when it is done close
Select the A column by clicking on the A On the menu click Data In the Data Tools Group, click Text to Columns Select the Delimited option Click Next Select the Comma delimiter Click Finish For multiple instantiation, everything up to column E (Contained Name) is required delete the rest they are optional The Excel file can now be manipulated to create multiple named instances.
Caution
The initial export is done in Unicode but Excel does not save the Unicode in the same format. One should always use the Save as function and select the output type as CSV.
Creating the Excel file can be time consuming so a pre-built CSV is supplied under My Documents\The Lazy Folder Import the ExtractMixing.CSV file into the Galaxy with these steps o Click on Galaxy on the Menu o Navigate to and click Import | Galaxy Load o When completed check in Mixing line 001 objects
Drag ViewEnginew_001 onto ViewClient_01 Drag and drop the OPC clients to their respective Application Engines Open each engine end ensure that the Cfg.DIObjectName on each engine is set to the respective OPC client. o DreamPLCClient_Test onto TestEngine_001 o DreamPLCClient_GR onto GREngine o DreamPLCClient_001 onto AppEngine_001 o DreamPLCClient_002 onto AppEngine_002 o DreamPLCClient_003 onto AppEngine_003 o DreamPLCClient_004 onto AppEngine_004 Drag the following areas onto the GREngine o GummiBearsInc o SherwoodForest o S_ExtractMixing o SystemsArea The Areas would normally now be split between the Application engines to even the load among the Engines. However, since only a Galaxy Repository Server is available, all the areas will be deployed to the Test Engine on the Galaxy Repository. o Drag and drop the four mixing lines (S_E_MX001 to S_E_MX004) onto the TestEngine_001. At this point the Simulation is also required Import the simulation objects into the galaxy with these steps: o Click on Galaxy o Navigate to Import | Objects o Navigate My Documents\The Lazy Folder o Double-Click Simulation.aaPkg Right-Click on the GRPlatform Click Deploy Ensure Cascade Deploy is selected Click OK
32
Module 3
Graphics
5. Graphics 5.1. Graphic Toolbox
All graphics should begin their lives in the Graphic toolbox. The Graphic Toolbox contains, by default, the ArchestrA Symbol Library. This library should be left intact and a new library should be created and appropriately named. This library can contain several types of graphics. A simple division of the toolbox would look as follows: Independent Graphics: These graphics have specific functions but work independently from the ArchestrA Galaxy. Typically navigational tools are examples of these. Standard Graphics: These graphics are used as parts or components of Independent graphics or object specific graphics. These graphics are built as self contained graphics exposing only those custom properties required to use the graphic. Assistant Graphics: These graphics are typically implemented standard graphics which require additional action scripting as such the scripting in the standard needs to be exposed to the end-user. This is accomplished by reapplying the standards scripting on the standard (which is set to be treated as an icon which will override the original scripts). This is then stored as an assistant graphic. To use it: Embed it, Convert it to a group and ungroup it.
Best Practice
Create self contained graphics in the graphic toolbox with only one level of custom properties exposed
This allows the implementation of standards changes are made in a central place These graphics are embedded wholly into objects and only configured there this allows the developer to set the owning object of the graphic thereby making it dynamic Custom properties from embedded graphics should be propagated to the main graphic and marked as private in the embedded graphic This will hide confusing multi-level properties from end-users.
Graphics can have multiple levels of embedment. Although this is a very powerful function, it presents some opportunities for confusion if not treated with respect. The following is a list of things to do when working with graphics: Always name elements (embedded graphics or graphical elements) with descriptive names Supply descriptions for graphics
33
If a graphic that is embedded has public custom properties, create those properties in the outside graphic and let the embedded graphic reference those properties mark them as private in the embedded graphic Always supply descriptions with custom properties especially public properties.
These same rules can be applied to using graphics from the ArchestrA Symbol Library.
Best Practice
If a symbol library symbol is used as a standard and changes are to be made to it, make a copy of the symbol and use the copy. If no changes are to be made: use the symbol directly
Using a symbol directly allows the user to benefit from any future upgrades made to the symbol by Wonderware
34
Click the arrow next to the Click the More Gradients item Set up the colours as shown
35
36
Rename the Panel to UnPressedButton Set its width to 150 Set its height to 50 Double-Click the UnPressedButton Panel Click the button to add an animation Select the Visibility animation Set the Expression to Pressed Select the False option (This panel is visible when the button is not pressed) o Click OK Duplicate the UnPressedButton by selecting it and pressing Ctrl+D Name the new button to PressedButton Turn it 180 Send this panel to the back by pressing F9 Double-click the PressedButton o Change the visibility animation to True (This panel is visible when the button is pressed) o o o o o o o o
37
Use the Textbox tool and create a Textbox of size 150 50 Type #### Centre the text by Clicking the button Select the centre, centre button
Change the textboxs name to something descriptive such as txtbx_ButtonText Change the line thickness to No Line Change the Fill Colour to No Fill Double-click the Textbox and add an Action Script o Drop down the Trigger Type and select On left click/Key Down o Add this script: Pressed = TRUE; o o o o o o o o Drop down the Trigger Type and select On left /Key Up Add this script: Drop down the Trigger Type and select On Mouse Over Change the After value to 1 ms Add this script: Drop down the Trigger Type and select On Mouse Leave Change the After value to 1 ms Add this script:
Pressed = FALSE;
MouseOver = TRUE;
MouseOver = FALSE; Add the following Animations to the Textbox and configure them as shown:
o o
Location Vertical
Value Display
Select all three elements (PressedButton, UnPressedButton and the txtbx_ButtonText) by pressing the F2 key Centre all three elements by pressing the button. Save and Exit from the graphic
39
Change the FillColor to Blue (Notice the extreme usefulness of attribute descriptions) Change the FillColor Visibility to Private (this valve will always fill blue) For the value property select the --- in the Default Value box Click the Ellipse () In the Elements Panel click the S_Valve On the right side pane click Value Click OK Change the Value Visibility to Private (the ValveSSBasics Value attribute always references the outer S_Valves Value attribute)
40
Click OK Select the visibility as Private Click OK Save and Close the Graphic
41
42
Select all of the components and group them Duplicate the group three times and space evenly on the background Ungroup all the graphics Change the owning instances so that Mixing Line 1 and 2s tanks are on the page Put a Text box with a heading on the page
43
6.1. Navigation
The navigation system can be built completely in InTouch, but this bypasses some of the ArchestrA graphic capability which is usually not desirable. To leverage the full graphic capability, the navigation system can be built around a trigger system. Since ArchestrA graphics can reference InTouch tags, it is possible to pass a requested window name to an InTouch tag and then trigger a condition (or data change script) to show the requested window. Other requests can be made in the same way (e.g. Window position, Headings, Messages, Current showing window, Owning object etc.). In its simplest form it consists of two InTouch tags: Trigger_ShowWindow (a Memory Discrete) and Requested_WindowName (Memory Message).
44
45
Click OK
Under 1. Independent Graphics | 1. Navigation Graphics create a graphic called Navigationbar and open it (Remember the description) Embed an S_BackGround standard and change its size to Width = 1024, Height = 100 Embed an S_ShowWindowButton and place it on the Navigation Bar Rename it to ShowMixLine1And2 Configure the Cfg_WindowName property to contain the following text: WIN_MixLine1And2 Duplicate the ShowMixLine1And2 button and name it ShowMixLine3And4 Configure its Cfg_WindowName property to contain the following text: WIN_MixLine3And4 Save and Exit
47
Module 4
Advanced Graphics
7. Assistant Graphics
Graphics often contain scripts and/or other action animations. When these graphics are embedded somewhere but require additional action animation, they need to be set to be treated as an icon. This means that any added action animation will override the original. This can sometimes be a problem (as has been shown in the labs). To overcome this problem one can easily add the required scripts to the embedded symbol however, this can be very tedious and repetitive if several different types of buttons are required. For this reason, it is sometimes necessary to create Assistant graphics. These graphics are prefixed with an A_ and are embedded as per usual. The embedded graphic is then converted into a group and ungrouped. This leaves a graphic that already has the required scripting. The best way to demonstrate is with a Lab.
48
Lab 7 Creating and using an Assistant graphic 7.1. Create an assistant Button
Create a graphic called A_Button under the 3. Assistant Graphics | 1. Buttons toolset. Embed an S_Button on it Change the name to ChangeMyName On the right-hand properties pane, locate the Treat as Icon attribute (under Runtime behaviour) Double-click the Button and add the Action Script animation o Drop down the Trigger Type and select On left click/Key Down o Add this script: Pressed = TRUE; o o o o o o o o Drop down the Trigger Type and select On left /Key Up Add this script: Drop down the Trigger Type and select On Mouse Over Change the After value to 1 ms Add this script: Drop down the Trigger Type and select On Mouse Leave Change the After value to 1 ms Add this script:
Pressed = FALSE;
MouseOver = TRUE;
8. Popup graphics
Some of the most important graphics are popup or faceplate graphics. These are usually control panel or information display panels that are displayed when a specific piece of equipment is clicked. With ArchestrA graphics there are two ways to handle these graphics.
50
Visibility = Private Create a Open Command button with these steps o Embed an A_Button o Convert it to a group o Ungroup o Change the name to CmdOpenButton o Change the action script for On Left/key up by adding the following script: CmdOpen = TRUE;
Create a Close Command button with the same steps (script below) CmdClose = TRUE;
Change the ButtonText propertys of both command buttons to a hardcoded text of Open and Close respectively. Create a Textbox and add the value display animation (string) to it to show the Heading attribute Add a Textbox and add the value display animation (time) to it to show the TravellingTime attribute Add descriptive text for the following: o Green button Open o Red button Closed o TravellingTime textbox Travelling Time Arrange the popup more or less as shown:
52
Save and Close Import the P_Popups.aaPKG in the My Documents\The Lazy Folder o Creates a S_AnalogueDisplay o Creates a P_ControlValve graphic o Creates a P_Level_Transmitter graphic
Caution
Custom Properties of type string, time and elapsedtime have to set to reference/text mode explicitly by clicking the or buttons. The issue is when a reference is typed but the property is in text mode, no error will be thrown (as a reference is a valid string) but the property will off course have the wrong value.
53
Do the same for the $m_SolenoidValve template. In WindowViewer Press F5 and test the faceplates
54
Add the following Custom Properties: o Cfg_OwningObject Type = String Description = Configured popup's owning object o Cfg_PopupName Type = String Description = Configured popup to display o INT_Requested_OwningObject Type = String Description = InTouch Tag for the requested owning object Reference = InTouch:Requested_OwningObject o INT_Requested_PopupName Type =String Description = InTouch Tag for the requested popup name Reference = InTouch: Requested_PopupName o INT_TriggerPopup Type = Boolean Description = InTouch Tag used to show a popup Reference = InTouch: Trigger_ShowPopup Double-click the element and add this action script to the Right-Click event IF INT_TriggerPopup THEN IF INT_Requested_PopupName == Cfg_PopupName THEN INT_Requested_OwningObject = Cfg_OwningObject; ENDIF; ELSE INT_Requested_PopupName = Cfg_PopupName; INT_Requested_OwningObject = Cfg_OwningObject; INT_TriggerPopup = TRUE; ENDIF;
Save and close Open the LevelTransmitter in the $m_Level_Transmitter Click on the embedded S_Level_Transmitter and change its properties as follows: o Cfg_OwningObject Visibility = Private Reference = me.Tagname o Cfg_PopupName Visibility = Private POP_LevelTransmitter o All the rest should just be set to private Open the LevelTransmitterPopup in the $m_Level_Transmitter Add the following Custom Properties: o Cmd_SetOwningObject Type = Boolean Description = Internal command that forces the owning object to be set o INT_Requested_OwningObject Type = String Description = InTouch Tag for the requested owning object Reference = InTouch:Requested_OwningObject o INT_TriggerPopup Type = Boolean Description = InTouch Tag used to show a popup Reference = InTouch: Trigger_ShowPopup
55
Click on the embedded Graphic and edit the following Property (Ctrl+M) CmdClose = INT_TirggerPopup Click anywhere on the blank canvas of the graphic and press F10 to add some graphic scripts Under Predefined scripts ensure the trigger type is OnShow and add the following script IF NOT Cmd_SetOwningObject THEN Cmd_SetOwningObject = TRUE; ENDIF;
Add a script and call it OwnObjectChange and configure it as follows: o Expression = INT_Requested_OwningObject o Trigger = DataChange o Script IF NOT Cmd_SetOwningObject THEN Cmd_SetOwningObject = TRUE; ENDIF;
Add another script and call it SetOwningObject and configure it as follows: o Expression = Cmd_SetOwningObject o Trigger = WhileTrue o Period = 50ms o Script IF IsGood(INT_Requested_OwningObject) THEN IF INT_Requested_OwningObject <> "" THEN P_LevelTransmitter1.OwningObject = INT_Requested_OwningObject; Cmd_SetOwningObject = FALSE; ENDIF; ENDIF;
Save and close In WindowMaker create a new Window and call it POP_LevelTransmitter Add a Window script to the POP_LevelTransmitter Window and configure it as follows: o Trigger = OnHide o Script Trigger_ShowPopup = 0; On this window embed the LevelTransmitterPopup graphic contained in S_E_MX01_T001_LT001 Note: this is a specific instance (the owning object will be changed by the popup itself) Close and save all windows Close and Open WindowViewer, Press F5 and test the Level Transmitter by rightclicking on it.
56