Home

ProcSee Tutorial

image

Contents

1. For more information on compiling see Application Program mers Interface Manual pages Compiling and Linking Win dows in the Proc See Reference Manual 8 7 Testing Dynamics 62 Now its time to start the program you wrote in chapter 8 The Simulator on page 51 This program is a console application so it will run in a Command Prompt window The program can ei ther be started by double clicking on it in the NT explorer or if using Visual Studio to run it You can also start it from a Com mand Prompt At your shells command line write the program name Tutorial ProcSee Tutorial or run your program from Visual Studio Either by selecting Start Debugging or Start without Debugging from the De bug menu or by pressing F5 or Ctrl F5 If the program is working correctly it will reply with the follow ing messages in the terminal window Enter Pf variable variable variable loop vl state added tl level added v2 state added If you are loading the picture in GED set the editor in test mode Open valve V1 Close valve V2 Watch the level of tank T1 in crease Close valve V1 The tank level stops increasing Open valve V2 Watch the level of tank T1 decrease Open valve V2 The level of tank T1 stabilizes The Simulator 63 64 ProcSee Tutorial Historic Trend The aim of this chapter is to give a brief description of the ProcSee trend logging system Historical data can be displaye
2. GED Picasso Graphical Editor CHE x File Windows Options Help Current Scope E New Tute Expand Collapse E Cursors Dialogues Fonts Functions Libraries E LineStyles Others Patterns Pictures Processes Structs Windows y In the top of the main GED window there are pull down menus indicated by the File Windows Options and Help menu Under the menu is a tree view of the contents of the Run Time Manager In this tree view you can select what to edit A menu of available actions for the item that is selected will pop up when the right mouse button is clicked This menu will change depending on what you have selected in the tree The File menu in the menu bar changes to the same menu as this popup menu but in addi tion also includes an Exit choice Examples of such menus are By selecting the Applications node you can create a new application or open an application from file If you select a named application you can save the applica tion to file document the application remove the application from the memory of the RTM or print all the pictures displayed by the application at the moment Nearly the same actions are available on pictures in addition you can open a Picture editor by choosing Edit The two fields at the bottom of the main window are for input and output purposes After you have choose Open a new window will pop up the Open window Go to wh
3. L MaxLevel if L 0 L20 return L MaxLevel 91 Click on the Compile button and if Compiled OK appears in the output field close the Function Editor window by pressing the OK button Do the same operation with the second function according to the input frame below char InstName return name returns the name of the picture object 40 Remove the Class Properties window by either pressing the Class Properties button or pressing the X button in the Class Properties window ProcSee Tutorial draw shapes 6 5 Textl Graphic Attributes Selected Properties Then draw six shapes roughly according to the numbered illus trations below two rectangles two opposite ellipse arcs and two text instances Put them together to form a tank When drawing I If the shapes from number 1 6 are put together it willlooklike a partially filled Wy 5 EL 4 Text2 Text2 elliptic arcs be aware that the operation is separated into three parts First you draw an ellipse with the wanted the size then you pick and move the square handles on the ellipse to set the orientation and opening angle of the arc Bring up the Graphic Attributes window see Figure 10 on page 20 and select the numbered shapes from 1 to 6 1 Set Line Pattern to None and Fill Foreground to colour medBlue black is 0 2 Set Line Pattern to None and Fill Foreground to colour lightSkyBlue 3 Set
4. f changeValveState f Zs J Y varName J Compile Messages Compile Cancel Help Click on the Compile button If the output field shows Compiled OK remove the window with the OK button 6 3 The Tank Class Start building a new class by pressing the New button Configure the new drawing the same way as in section 6 2 on page 32 with the listed parameters e World X 100 World Y 100 World Width 750 World Height 500 Snap Interval X 10 Y 10 e Background colour ex grey50 see Figure 9 on page 17 Save the tank by selecting the Insert As option in the File menu and name it Tank Class Properties Bring up the Class Properties window see Figure 21 on page 35 and create two attributes for the tank class Click on the New but ton and type the pTalk expression in the Attribute Editor win Design of Classes 39 dow according to the input frame below see Figure 22 on page float MaxLevel 1000 35 Click on the Compile button and if Compiled OK appears in the output field close the Attribute Editor window by pressing the OK button Do the same operation with the second attribute ac cording to the input frame below float Level 0 In the same Class Properties window select Functions and click on the New button In the Function Editor window type in the p TALK expression according to the input frame below float WaterLevel float L Level if L MaxLevel
5. hist 10800 lo 9999999 hi 9999999 pcc myVars Tdoc The ICycle attribute of the trend variable t1 level says that it is to be logged every second The hist attribute is the time span of which values are logged 10800 1 gives 10800 values to be logged in a ring buffer Attribute type has a value of 5 which means the actual value of the variable is logged lo and hi reflects the lower and upper range of the trended value This file must now be run through pcc to get the myVars ptrv file This is done by clicking on the file in the Windows explorer with right mouse button and chose Compile in the pop up menu The application Tutorial pctx can now be reloaded from GED Click on the Application chose Open and select Tutori al pctx in the Open window coming up After selected the Tuto rial pctx file press the Open button Historic Trend 69 9 3 Trend Curves 70 Up to now we have been looking at how to define an internal trend logger Now it is time to present data in a ProcSee picture To define a trend select the trend tool in the Tools menu in the Drawing editor and move the cursor to position 300 40 and press the left mouse button The trend graphic shape will appear in the window with a default width and height As default one time label shape is placed above the trend diagram Now it s time to change the width and height of the trend Select the Selected Properties menu from the Tools menu and choose the wid
6. m if state amp 16 128 printf Lost contact with process 7s proc nDisConnect else if state amp 8 printf Failed to connect to Process s proc J else if state amp 512 printf Incompatible SWBus versions Chech 7s proc else printf WATH IS GOING ON OK Do a Save and Document on the Tutorial in the main ged tree Make a frame work 75 10 3 Extend the TutorPic Open the TutorPic and add from the library Buttons the Push Button in e g coordinate 540 300 In the attribute char Ac tion 64 type the following myProcessQuit Do the Compile and OK In the attribute char LabelText 32 type the following Quit Process Do the Compile and OK Add the same dialogue on the picture level as in Figure 38 on page 74 Save and document the picture 10 4 Extend the program In the Tutorial c add the following Add the declaration of the myProcessQuit to the simulator program PROGRAM int changeValveState int32 void int myProcessQuit int32 void Registerfunction called from rtm In the up0 function do the following Register myProcessQuit function to the simulator program PROGRAM PfRegisterFunction changeValveState f changeValveState numArgs args if apiError OK printf Failed to register changeValveState n numArgs 0 PfRegisterFunction myProcessQuit myProcessQuit numArgs args if apiError OK
7. tl level gt MAX LEVEL Tank is full tl level MAX LEVEL Finally we tell ProcSee about the change of the value We use the flag from the connection callbacks to determine if the Proc See connection is working If the connection is ok the value is put into the send buffer with the function PfSend PfSend uses the id of the variable that was returned by PfCreat eVarin the up function When all the values has been put into the send buffer the buffer is transmitted to the rtm with the PfFlush function PROGRAM continued if isConnected PfSend tl id Make the changes known to ProcSee PfSend v1 id PfSend v2 id PfFlush return OK End of repeater The Simulator 61 The function changeValveState will be called every time one of the valve is clicked on with the left mouse button PROGRAM continued int changeValveState int32 numArgs void data int32 size type id void theData int value if numArgs 1 return OK theData PfGetFuncArg amp data amp type amp size if type PfCUnsignedChar size gt 64 return OK id PfId PfLocalProcess char theData if apiError OK value int PfData id value value return OK End of changeValveState This function toggle the state of the two valves in the process pic ture 8 6 Compiling In Visual Studio Select Build Tutorial exe from the Build menu
8. ProcSee Tutorial Introduction This chapter is a general description of this tutorial with a presentation of the contents and a description of the different conventions used in this document 1 1 Whatis a Tutorial Complete System Description SO Tutorial A tutorial in our case is a compressed documentation of how to create one or several complete applications using the ProcSee system It is the intention to give the beginner a hands on experi ence of ProcSee and present terms and procedures to touch most of the different parts of the system The tutorial will simpli fy the introduction to the system and it is recommended that the user works through it before retrieving more detailed informa tion from the User s guide and the Reference manual The tutorial is based on generating pictures to be used for process control applications Note that ProcSee can be used to generate user interfaces for any type of application In most tutorials the goal is to work through one or more exam ples based on prepared files delivered with the system These files are used to build a working application In addition to give a brief introduction to the system it is also useful for the user to test out other more complex functionality by appending functions to the already working example Using the working example as a template makes it efficient to test and debug added functionality The tutorial is divided into differe
9. Trigger pop up menu Then type the statement in the Action input field as shown in Figure 26 Dialogue Editor Tutorial TutorLib ___ged_classPic_2 0x18000005 Xl Trigger buttonPressed gt Action ChangeV alveState State Compile Messages The ChangeValveState is a function and is unknown for the rtm until it has been made it is the next thing to do Click on the Compile button Remove the window with the OK button An error window will pop up telling you that the compile failed asking if the editor window shall be closed answer yes Click on the Class Properties button as brought up the window to re move the window The ChangeValveState function is created selecting the Function node in the tree on the application level Select New Later on page 62 we will explain how to make the register function in the program Putting the register function in an execute function makes the compile OK This is done because the function is not ProcSee Tutorial yet known in the rtm It will first be known when the program is connected to the rtm For more information about execute see the Reference manual The function is shown in Figure 27 Figure 27 Function Editor Tutorial ChangeValveState x Function void ChangeValveState char varName if processlsConnected Tutorial The Function Editor window print The process is not connected J return execute
10. TutorLib 44 save 37 U UMIS User Interface Management System 7 up 56 function 55 update 6 upperLImit trend attribute 70 User Interface Management System UIMS 7 User s Guide 84 V ValveColour 36 variable environment 4 trend attribute 70 View menu Class Properties 34 Class Properties 40 Pictures New 44 visibility attribute 21 79 80 Visual Studio 52 new file 53 74 new project 52 W weight font 28 widt Index attribute 20 window Attribute Editor 39 Background 17 Class Properties 34 34 39 Class Settins 33 create 48 Editing Options 17 Function Editor 40 Graphic Attributes 34 41 48 Instantiate Class 44 Select Trend 70 Selected Properties 21 36 41 47 70 71 Selected Trend 71 Windows menu 11 VII VIII ProcSee Tutorial
11. a small simulator program The program was written in C language using the ProcSee Application Programmer s Interface API The purpose of this simulator was to update the database variables to the RTM used in the tutorial picture Chapter 9 Historic Trend An internal trend logger were added The level of the tank was logged and displayed in a trend diagram as a function of time Chapter 10 Make a Frame Work A start picture was made Quit process button and shut down dialogues was added Chapter 11 Further Enhancements Some ideas on how to build further on your application A list of subjects with more detailed description of the different expansions possibilities is included 12 2 Where to go From Here 84 When you are going to build your own application this docu ment will work as a good start reference Use the different build ing blocks made in the tutorial as a basis ie the simulator program could be expanded with more variables and the class li brary is also suited for reuse and expansion To get more detailed information on the ProcSee system refer to the two other manuals delivered with the system The ProcSee User s Guide and The ProcSee Reference Manual ProcSee User s Manual Index Symbols pctx 5 26 pdat 69 ARCH 52 53 PROCSEE DIR 52 53 A angle font 28 opening 19 20 81 start 19 20 API 51 54 84 Application Programmer s Interface 5 host 56 prefix Pf 56 API functi
12. done by click ing on the file in the Windows explorer with right mouse button and chose Compile in the pop up menu This file will be loaded into the RTM making the trend logger to start The next step is to add the myGlobalTime variable to the simu lator program Add the time variable as described below PROGRAM float tl level int tl id int v1 id int v2 id int time id Add variable to the simulator program The application variables int vl state 0 int v2_state 0 int myGlobalTime 0 telling trend logger current time Id s for the variables MAX LEVEL id for time added Historic Trend 67 The variable must then be created Initialize and create the time variable in the API PROGRAM myGlobalTime time NULL time id PfCreateVar myGlobalTime PfCInt NULL 1 amp myGlobalTime if apiError OK printf variable myGlobalTime added n PfSend We have now created the variables necessary to setting time in the trend logger In the first version of the simulator we only up dated the level of the tank t1 level This time we also need to up date the value of myGlobalTime This is done by calling the function PfSend again with time id as parameter The repeater function will now look like The repeater function now updating more than one variable PROGRAM int32 repeater int32 i if v1 state 0 tl level V1 FLOWRATE if v2 s
13. main program The Simulator 57 When the program connects to ProcSee the connection callback up is called This is the natural place to create register functions and process variables PROGRAM continued void up int32 status char msg This callback is called each time the Proc See connection is estab lished The register function need two parameters PROGRAM continued int32 numArgs 1 PfTArg args PfCUnsignedChar 0 To know whether to create the register function and variables or not we check the status parameter PROGRAM continued if status amp PfCrtmResume printf Connection re established In return printf Connection established n If the PfCrtmResume bit is set this routine has already been ex ecuted and ProcSee remembers it If not we go on creating PfRegisterFunction PROGRAM continued PfRegisterFunction changeValveState f changeValveState numArgs args if apiError OK printf Failed to register changeValveState n 58 ProcSee Tutorial The parameters in the PfRegisterFunction is the name of the function the function itself the number of arguments and the argument description The changeValveState function have 1 ar gument the name of the variable to be toggle Continue to create the variables PROGRAM continued vl id PfCreateVar v1 state PfCInt NULL 1 amp vl state if apiError OK prin
14. piled OK click on the OK button to exit the window The next Figure 23 xi Function intIsOpen return State The Class Properties Function Editor window El Compile Messages Compied OK a om o function to create is for deciding the valve colour int ValveColour if IsOpen return green else return red Selected Properties To define dynamic shapes in the valve class bring up the Select ed Properties window either by pressing the Selected Properties button as illustrated in the left margin or select it from the View menu This window is shown in Figure 24 36 ProcSee Tutorial Figure 24 This figure is illustrating the Selected Properties window for the selected shape Figure 25 The Selected Properties Attribute Editor window Polygon Oxe000002 Rename Attributes Functions Dialogues int backaroundColour int backgroundFillColour int fillPattern int foregroundColour int foregroundFillColour int linePattern float linewidth float rotation amp ngle int visibility float Reference zj flnat xSraleF antar If the window is empty select the polygon shape by pressing the left mouse button on the polygon shape The properties of the polygon will be displayed in the window Use the scrollbar for the attributes and select the foregroundFillColour as illustrated in Figure 24 Click on the edit button and change the predefined assignment as d
15. to same as 1 4 Set to same as 1 5 Set Line Foreground to white and Font to helv_b_14 6 Set to same as 5 Bring up the Selected Properties window see Figure 24 on page 37 and select the numbered shapes from 1 to 6 over again Edit the different shape attributes to get a tank Use float in front of all the attributes except for theText and format that uses char 1 Editto X 0 Y 50 width 100 height 90 2 Edit to X 2 Y 50 91 WaterLevel width 96 height WaterLevel 3 Editto X 50 Y 50 xRadius yRadius 37 startAngle openingAngle 180 Design of Classes 41 42 4 Editto X 50 Y 140 xRadius 50 yRadius 37 startAngle 180 openingAngle 180 5 Editto X 27 Y 40 theText Level format 6 1f 6 Editto X 37 Y 165 theText InstName format s Insert the drawing and leave the drawing editor Save and Document the library in the main editor s File menu by selecting TutorLib with the right mouse button With the left button click on Save and Document in the pop up menu ProcSee Tutorial The Picture In this chapter a picture is built using the classes defined in Chapter 6 Design of Classes and the database definition created in Chapter 8 The Simulator 7 1 Database Definition The picture that we shall create will show three process varia bles The tank and the two valves The three
16. with the API function PfInitialize Note that all the API functions have the prefix Pf The Pf is an abbreviation for Proc See function PROGRAM continued PfInitialize Tutorial Tutorial rtm NULL 0 0 up down applName processName rtmName controlHostName cacheSize master up down PfInitialize takes eight parameters The name of the application Our application is called Tutorial Several tasks can be running under the same application with different process names The name of the process Our process is called Tutorial Several tasks can connect to ProcSee with the same application name but the combination of application and process names must be unique If NULL the name entered in applName is used The name of the ProcSee run time manager If NULL the de fault name of the RTM which is rtm is used Name of the host where Control is running If NULL the envi ronment variable SCONTROLHOST is used Unused for the moment use 0 as default value Unused for the moment use 0 as default value The function to be called when our task connects to ProcSee The function to be called if the ProcSee connection is broken If something went wrong in the initialization routine this will be registered in the apiError variable and can be displayed through PfPrintSystemError The same procedure can be used after call ing other API functions PROGRAM continued if apiError OK printf C
17. 300 reference point of the class Snap interval Background Colour Polygon 1 1 pixels unit E Update Mode Fui Rese Mode 7 Editing Backarcuna Walon DK Cancel Help When you have typed the right values into the World X Y Width and Height and selected Update Mode to Full click on the OK button to confirm the changes To set a snap interval chose the Options menu and select Edit ing See Figure 8 on page 17 Chose the Options menu and select Background See Figure 9 on page 17 Chose the Polygon tool as described in 4 2 5 on page 19 Place four corners of the polygon by referring to the x y output in the information field below the File menu 1 first point x 40 y 30 2 second point x 40 y 30 3 third point x 40 y 30 4 fourth point x 40 y 30 Design of Classes 33 Line Ellipse Graphic Attributes Class Properties 34 wl Then press the right mouse button to end the shape drawing Continue drawing the valve s handle by pressing the Line tool see 4 2 6 on page 19 Place two points the same way as with the polygon Remember to terminate the line after two points by clicking on the right mouse button 1 first point x 0 y 0 2 second point x 0 y 30 Chose the Ellipse tool as described in 4 2 4 on page 18 Press the left button down in position x 0 y 40 and keep it down while dragging the cursor to
18. 33 Background 44 Class Settings 33 Snap 44 ProcSee Tutorial P PATH 4 83 pattern 6 21 default 29 line 41 Solid 34 pec 67 myVars Tdoc 69 Tutorial Tdoc 67 PfCFloat 59 PfCInt 59 PfClose 57 PfCreateVar 59 69 PfCrtmResume 58 PfCUnsignedChar 62 PfData 62 PfEndLoop 77 PfExecute 76 PfFlush 61 68 PfFlushCreateVar 59 PfGetFuncArg 62 PfId 62 PfInitialize 56 57 PfMainLoop 57 PfPrintSystemError 56 PfRegisterFunction 58 76 changeValveState 55 myProcessQuit 74 PfGetFuncArg 62 PfTArg 58 PfSend 61 68 PfSetProcessHandler 57 PfTArg 58 picture 6 16 design 5 document 23 name 23 new 44 save 22 Save As 22 picture editor command line 47 pie circle 19 ellipse 20 Polygon tool 19 33 predefined colour 27 Index font 28 Presentation button 70 process editor 26 processName 56 processNotify 75 ProcSee connection 6 PROCSEE DIR 5 7 26 83 environment variable 4 program name 62 program source Tutorial c 54 67 76 properties system 7 pTALK 83 constructor 74 displayPicture 49 74 execute 38 74 load 49 74 shutdown 74 system 74 update 38 R Rectangle tool 18 Reference Manual 84 rename Selected Properties 45 repeater function 68 resource 6 rtm 56 83 rtm run time manager 4 9 rtmName 56 run time manager rtm 4 9 25 43 running application 5 S save class 32 picture 22 Tutorial Tdoc 67 TutorLib 37 Save As 48 picture 22 Select Mode 18 Select tool Tools menu 46 S
19. Bor Restifid Dynhamices 4 s ae ose Sate Shee ae EIE 62 9 Historic Trend s rer Re eo x 65 9 1 Internal Trend Logger os xod ERE REDE d mex au 65 9 2 Trending Variables s xoxo G86 ad Sop a are 930m om 66 83 Trend GutVesic u woo ega a on Se me ote dd oa hk e A 70 10 Make a Frame Work 73 10 1 Make a start picture 55e a a leal nati ok 73 10 2 Usethelibrarie Buttons 73 10 3 Extend the TutorPic de AA AA Ea 76 10 4 Extend the program e e 76 11 Further EnhancementsS 79 11 1 Picture update mode s vp zo See EM ee ee Rae 79 11 2 Window title 1 xo 3 ds ec ate e ee a de mon Be wt ee mcm sd 79 Mia Trend extensions uctor wh ca we eee ste oc e SR wa t E 79 11 4 Plotthe picture o s tg Aste aa A oe EUR ELE Xu 79 11 5 Run two RTM son the same Tutorial 80 11 6 Use a data configuration file 80 Tick WP CMOMNANCE onda a A ee ela Ps cos 80 11 8 More Process Units 2 202004 80 11 9 Extend the Picture 20 4 65 04 Rm ke a mmm 80 11 10 More Process Variables 80 TPA cales tia ues a A AA a 81 Aled FUNCIONS i e ian a A TURAE 81 Tibe TexPESIBlds i cra oea aa Bike re ooh c Ro oed ed e oce es 81 12 SUMMA es DERE ed sue RS ERA 83 12 1 Whatis Covered of the ProcSee System 83 12 2 Where to go From Here o 84 o A e ne det d e nag de
20. ED Save the pic ture as pictures TutorPic using Save As in the File menu The classes may be presented in either an Instantiate Class win dow or in a ClassBrowser window The selection is done in the Options pull down menu The Instantiate Class window will be used if Use ClassBrowser is not selected see Figure 28 This se lection must be done before the Instance tool is selected Instantiate Class Lx js Uptions Libraries Classes Picture Settings Ctrl No LL Editing Background v Auto Update Now you can start making instances of the Valve and Tank class es you created in chapter 6 Design of Classes on page 31 Select the Instance tool in the drawing editors Tools menu If Use ClassBrowser is selected a browser with available librar ies and classes appears Select the library TutorLib first Then se lect the class Tank Move the cursor to approximately the middle of the picture e g coordinate 180 110 and click on the left mouse button An instance of the tank will appear in the picture ProcSee Tutorial Selected Properties f 1 Select the Selected Properties from the property window buttons located in the lower left corner of the drawing editor The Select ed Properties window appears Select Rename in this window to give your instance a name Place the cursor in the empty text field in the appearing dialogue box and write the name T1 Then press OK Repeat the instan
21. Preferably call the directory test Tutorial It is also recommended that files like pictures libraries and data bases has their own directories Go to the testTutorial folder Make a new folder and name it pictures Make a new folder and name it libraries Make a new folder and name it databases ProcSee Tutorial Starting Up This chapter describes what to be started in the ProcSee system and how it is done The completed application picture will also be presented 3 1 What to Start There are two main programs in the ProcSee system that must be running to be able to make a new application their names are abbreviated to e RIM Run Time Manager e GED Graphics Editor When the system is installed a system service called control is also installed A graphics illustration of the connection between the two main programs and the control server in the ProcSee system is pre sented in Figure 2 on page 10 GED is itself an application just as the Appl1 and Appl2 applica tions They are communicating through the Software Bus using the API library To give some ideas about what such applications as Appll and Appl2 could be refer to Chapter 8 The Simulator on page 51 describing a simulator application The container next to the RTM is illustrating that the RTM is stor ing and retrieving information about the user interface for the two applications in a database file In addition a server program called Control is u
22. This is done by selecting the Tutorial application and Save in the popup menu that is displayed when right clicking on the library node 5 3 Colours A ProcSee delivery includes a set of predefined colours These colours may be edited deleted and new colours may be added The colours are described by colour name A segment of the de fault colour palette is shown in Figure 15 Figure 15 c Colours Segment of the predefined colour palette 27 5 4 Fonts A ProcSee delivery also includes a set of predefined fonts These fonts may be edited deleted and new fonts may be added A segment of the predefined fonts is shown in Figure 16 Figure 16 cour 12 Segment of the predefined cour 14 fonts cour 18 cour b 12 cour b 14 cour b 18 helv 12 helv 14 helv 18 helv 24 helv b 10 helv b 12 helv b 14 helv b 18 helv b 24 helv b 34 helv bo 12 helv bo 14 helv bo 18 helv bo 24 time 12 kima 1a The name of the fonts has been chosen so that they describe the font name angle weight and size font description The first four letters describes the font name aria arial cour courier helv helvetica e time times The intermediate item describes the font angle and weight no item normal font e b bold font e i italic font e bi bold and italic font 28 ProcSee Tutorial The numbers last item gives the font size in points If a font is not present on your system the closest matchin
23. and chose Settings and Control Panel In the Control Panel window select System and in the System Properties win dow chose Environment or Advanced and then Environment Variables depending on the operation system on your com puter as shown in Figure 1 on page 8 Figure 1 This is the System Properties window with Environment variables Important variables for ProcSee is ARCH Path and the PROCSEE DIR 2 clickine on the ifferent Variables the m ble Value is displayed in the Value window Environment Variables E 3 x User variables For arild Variable Environment ari C Program Files InstallShield InstallShie INCLUDE C Program FilesiProcSeetinclude LIB C Program Files ProcSeeVibwinArch Path C Program Files InstallShield InstallShie TEMP C Documents and Settings arild Local 5 New Edit Delete System variables ARCH windrch ComSpec CA WINNT system32lcmd exe NUMBER OF PR 1 OS Windows NT Os2LibPath CAWINNT system32 os2 dll T Edit Delete Cancel Copying Files For convenience and separation of the different applications it is recommended to create a new directory for this tutorial It is up to the user where to create this directory Use the file manager explorer to create a new directory and copy the file Tutorial pctx from the ProcSee tutorial directory to your own directory Change the permission from Read only
24. awn rectangle In the Attributes chose float height and click on the Edit button The Attribute Editor window will pop up on the screen see Figure 12 on page 22 Attribute Editor Tutorial NoName1 0xe000001 height E Attribute float height 109 predefined a Compile Messages Compiled OK OK Compile Cancel Help Type the desired value for rectangle height e g 109 and click on the Compile button If compilation is OK a message Compiled OK will arrive in the Compile Message window Then click on the OK button and the rectangle will have the new height If you only click on the OK button you will not be able to read the com pile message if something went wrong 4 3 3 Save and Document save 22 In order to store the picture for later use it has to be named and saved Save the picture with a new name by pressing the File menu and chose the Save As option A standard file save window appears on the screen see Figure 13 Check that the directory is where ProcSee Tutorial you want to save the picture go to the pictures directory Write the picture name in the File name text field and click on the Save button to save the picture o TTT 2x Save in pictures E3 The Save As window File name Examples Save as type Picture Files ppic Cancel 7 document Save the picture as an ascii file by pressing the File menu and chose the D
25. ck quotes signifies a dynamic assignment The tank level will change whenever the quoted statement changes value Figure 30 n E The drawing editors a command line is situated V2 State v2 state below the drawing T window v2 state Test mode Before you continue test the dialogue of the valves Set the editor in test mode by selecting the Test Mode in the Tools menu st A Change the states of the valves by write in the drawing editors command line w vl state v2 state on PR The valves should switch colours between red and green signi fying closed and open Also test if the dynamics on the tank is working In the drawing editors command line write tl level 500 0 Then press Return A light blue rectangle should now cover half of the tank The Picture 47 Let us add some more dynamics in the picture Chose the Select Mode and select the line connecting V1 and T1 Enter the graphic attributes window Select Line Foreground In the text edit field at the bottom of the window write Vl IsOpen lightSkyBlue white When typing is finished press Return to insert this dynamic into the selected shape Select the line connecting T1 with V2 Repeat the procedure but this time write Tl Level gt 0 lightSkyBlue white Set the editor in Test Mode and test the new dynamics by open ing and closing the valves as described above using v1 state and v2 state Save your pic
26. cument this picture Select the Function node in the Tu torial tree and choose the constructor function Right click on it and click on Edit Change the content as follow Do the Compile and OK void constructor load pictures TutorPic ppic load pictures StartPic ppic displayPicture winl StartPic ProcSee User s Manual Figure 39 The Function Editor window Figure 40 The Function Editor window Figure 41 The Function Editor window Then select Function and New node in the tree Type the func tion text as displayed in Figure 39 Do the Compile and OK Se Function Editor Tutorial OnConnect X Function void O nConnect displayPicture win1 TutorPic Compile Messages Compile Cancel Help lect Function and New node in the tree Type the function text as displayed in Figure 40 Do the Compile and OK This two func x Function Editor Tutorial OnDisConnect Function void OnDisConnect displayPicture winl StartPic Compile Messages Compile Cancel Help tions are called from a function called processNotify which is a user defined callback function Select Function and New Type the function text as displayed in Figure 41 Do the Compile and x Function Editor Tutorial processNotify void processNotify int state char proc fl state amp 1 printf connect to s established proc OnConnect
27. d as curves in trend diagrams referred to as Trend Display Trend logging in our terms means the process of collecting and administrating data 9 1 Internal Trend Logger Many applications need to store and display historical data The number of variables to be trended vary a lot Thus the design of the ProcSee trend logger had to be as flexible as possible to meet a wide range of requirements 65 In our tutorial there are only a few variables that are to be trend ed In this case the trend logger can easily run within the RTM without affecting performance of the system This is referred to as an internal trend logger Figure 36 The application Trend Log RTM Tutorial pctx developed in this tutorial is connected to an internal trend logger in Tutorial pctx fi DOSE u lal 9 2 Trending Variables Let us say we want to see how the level of the tank is changing over a period of time The way this is done in ProcSee is by set ting up a trend logging system This system consists of two parts Part one says which variables to trend the log medium disk or memory how often they should be logged etc Part two is con cerned with the physical presentation or display of the historic data e g colour of the curve Unfortunately GED cannot be used to specify how variables should be trended in this version of ProcSee So we have to use the combination of a text editor and pcc to do the job Edit Tutorial Tdoc D
28. e Institute for Energy Technology nu OECD Halden Reactor Project Pa ProcSee Graphical User Interface Management System TUTORIALE Microsoft Windows version e Institute for Energy Technology OECD Halden Reactor Project This document will be subjected to revisions in the future as the development of ProcSee continues New versions will be issued at new releases of the ProcSee system The information in this document is subject to change without notice and should not be construed as a commitment by Institute for Energy Technology Institute for Energy Technology OECD Halden Reactor Project assumes no responsibility for any errors that may appear in this document Published by Institute for Energy Technology OECD Halden Reactor Project Date June 2014 Revision 3 9 PROCSEE DOCUMENTATION Table of Contents Table of Contents i 1 Introduction 3 1 1 Whatis a Tutorial aio po deed weg T eX 3 12 What to Expect from this Tutorial rn 4 1 3 GONVEMIONS i Sons 2 dod uei A Se aaa lt RIE RUE dS 5 14 How to Use this Manual a 5 15 Definitions tus oa atop Ra oues s ts Ta a 6 16 Requirements a 6 2 Preparations 7 2 1 Configuration of a ProcSee Environment 7 3 StartingUp 9 Sd Wha tto Start 22 eee ma aere ie eaa E ue Eudes MO Ei a
29. e from PROCSEE_DIR tutorial winArch result The Simulator 53 8 3 Requirements The program Tutorial c contains some definitions and variable declarations Three functions that will be set up as callback func tions user supplied functions that will be called by the API and a main program In ProcSee s Application Programmer s In terface API a callback function is used to update the actual variable from both the application program and the RTM Constant definitions type definitions and function declarations required to use the API are found in the api h header file PROGRAM c include lt stdio h gt include lt time h gt include lt api api h gt In order to control the flow into and out of the tank we define some constants representing the flow through the valves and the maximum and minimum allowed level of the tank PROGRAM continued The max and min levels of the tank define MAX LEVEL 1000 0 define MIN LEVEL 0 0 The flowrates of the valves define V1 FLOWRATE 50 define V2 FLOWRATE 50 We declare a Boolean variable to keep track of the Proc See con nection PROGRAM continued bool isConnected 0 54 For more information about the connection of the application code to the RIM see section 19 1 A Small Example in the Proc See User s Guide ProcSee Tutorial The three essential variables of the application have an internal representation in the
30. e two Environment variables ARCH and PATH must be defined The first one is used by ProcSee to detect which ma chine architecture it is running on and the second is to avoid typ ing the complete path name to the executable files The procedures for starting the complete ProcSee system re quires only two command line inputs in a terminal window The start up order of the ProcSee processes is not fixed Usually the Run Time Manager RTM is started first A name server called Controlis already running When the RTM is running the Graph ics Editor GED can be started This chapter gives an overview of the default resources colours fonts etc in the ProcSee system and also the necessary tasks to be done for initial preparation Explanation of initial settings like background colour world co ordinates snap etc The drawing editor is used to draw a few ob jects and then add different attributes to these objects By using the G ED two different ProcSee classes are constructed and placed in a library for later use The class library can be thought of as a set of building blocks to be used to build pictures in GED ProcSee Tutorial design of picture the simulator After finished creating the different building blocks like configu ration of the user s environment classes and programming the simulator the process picture will be generated The process pic ture consists of class instances graphic primitives and applica t
31. eated see Figure 6 id ioi xi File Edit view Graphics Windows Options Help GED s Drawing Editor ii 165 145 Test mode te Select Mode Circle m Circle Cod 9 Q Ellipse Ellipse Cord 9 ae Ellipse Pie 7 Line Polyline 9 N Circle Pie Polygon Rectangle Options PullDown Menu DUD i ee E N N al Graphic Attributes Picture Properties Selected Properties EID a it El 7 Before you start drawing some editing options should be set in order to make the drawing easier Chose the Options Pull Down menu and select Editing see Figure 7 Figure 7 Options menu raphics Windows Options Picture Settings Background of uta Indate ProcSee Tutorial Figure 8 Editing Options snap interval Background Colour Figure 9 Background Colours The Editing Options window will appear on the screen as shown in Figure 8 r Snap Settings Grid Settings Mx World Coords fi 0 Origin cross and grid MY Word Coords 10 Cross only C None Angle Degrees gt CI A Radius world Coords D O O O Snap units per dot f1 m Dots per grid line fi 0 H Crosshair Settings Iv Visible Iv Follow snap m Scale Rotate Settings rm Crosshair Settings Infinite Scale factor fi 1 O Size o Rotate degrees 45 OK Cancel Help The snap settings are done in orde
32. ectively The default colour of the trend curve is white To change the fore ground colour select the attribute foregroundColour in the list and set it to the value yellow The LineWidth attribute should be set to 2 Select a suitable font by choosing the Time Labels in the Selected Trend window and the attribute theFont from Selected Proper ties window Look in the Graphic Attributes window to see which fonts to select from You can let it be 0 The definition of the trend shape is now finished Remember to save and document the picture Historic Trend 71 72 ProcSee Tutorial Make a Frame Work In this chapter we will make a start picture using a button from the example libraries Buttons plib start and quit the process from a button and add a quit when removing the window 10 1 Make a start picture Copy the Buttons library found in examples libraries Buttons winArch to the libraries directory Select the Libraries node in the tree and right click on it to get the popup menu Select Open on the popup menu Select then Buttons plib in the Open popup window and click on the Open button Save the application Select the Pictures node in the tree and select New Set the size and background colour as in the TutorPic picture In the File menu do Save As and name the picture StartPic 10 2 Use the librarie Buttons Select the Instance tool in the drawing editors tools menu Choose Buttons Select the PushButto
33. ed from the PROCSEE_DIR tutorial ARCH directory To do this from GED select Processes under the Tutorial appli cation in the tree view Expand this node if possible and select the Tutorial Process Start the Process editor by choosing Edit from the File menu or the menu on the right mouse button If the Tutorial process is not there create it by selecting the Proc esses node and choose New on the File menu or the menu on the right mouse button Type the name Tutorial for the name of the new process and click on the OK button The Process editor will then start If you have created the Tutorial pdat file already select open from the File menu in the Process editor See Figure 14 and select the Tutorial pdat file in the file selection window that is dis played Figure 14 IBix The Process Editor File Edit Analyse Options Windows Help File databases Tutorial pdat float t1 level 0 0 int32 v1 state 0 int32 v2 state 0 pi CALPC M testT utorial If you are going to create this file now select New Enter text as shown in Figure 14 on page 26 Save the data base with Save As and name it Tutor pdat Remember to save it in the data bases directory Close the Process editor and answer Yes to the questions about saving and installing the database files Now you should save the Tutorial Application so the database declaration you have added is stored on disk ProcSee Tutorial
34. egroundFillColour 37 function ChangeValveState 38 changeValveState 59 62 down 55 60 IsOpen 36 main 55 myProcessQuit 76 77 OnConnect 75 OnDisConnect 75 processNotify 75 repeater 60 68 up 55 ValveColour 36 Function Editor window 40 G ged drawing editor 32 ged graphics editor 4 9 11 83 Graphic Attribute 20 button 34 Line Pattern 34 LineWidth 34 Graphic Attributes Index IIl Fill Foreground 41 Line 34 Line Foreground 48 Line Pattern 41 window 234 41 46 48 graphics editor ged 4 9 11 25 43 H header file api h 54 Help menu 11 I beam icon 5 Insert As 32 instance class 44 tool 44 Instantiate Class 44 internal trend loggger Tutorial pctx 66 interval snap 33 IsOpen function 36 K Keep tool 18 L library 6 Buttons 73 new 31 line attribute 20 foreground 48 pattern 41 shape 34 37 tool 45 Line tool 19 34 Line Pattern attribute 34 LineWidth attribute 34 71 graphic attribute 46 logFrequency attribute 71 IV trend attribute 70 lowerLimit trend attribute 70 main function 55 main program ged 83 rtm 83 make 68 master 56 menu File 11 Help 11 Options 11 16 start 7 tree 15 Windows 11 mode select 18 myProcessQuit 76 77 myVars Tdoc edit 69 pec 69 N name colour 27 fonr 28 picture 23 program 62 new button 35 library 31 O ok button 35 38 39 OnConnect 75 OnDisConnect 75 opening angle 81 openingAngle 19 20 Options menu 11 16
35. elected Properties 36 45 Attribute Editor 37 Attributes foregroundFillColour 37 shape attributes 41 tool 21 window 21 36 41 47 70 71 Rename 45 Selected Trend window 70 71 shape attribute 41 draw 41 ellipse 37 line 34 37 simulator 5 size font 29 snap 44 interval 33 settings 17 Solid pattern 34 start menu 7 startAngle 19 20 style attribute 20 system properties 7 window 8 T test tool 47 test mode editor 47 text attribute 20 Text tool 19 textfield 81 theFont attribute 71 Time Label trend 71 timeMaster trend 67 TimeTags 70 VI toggle 6 tool Circle 18 Ellipse 18 34 instance 44 Keep 18 Line 19 34 45 Polygon 19 33 Rectangle 18 Selected Properties 21 test 47 Text 19 Tools menu Select Trend 70 tree menu 15 trend foregroundColour 70 71 foregroundFillColour 70 hist 69 ICycle 69 logFrequency 70 logger 65 84 logging system 66 lowerLimit 70 myGlobalTime 67 68 Time Label 71 timeMaster 67 timespan 70 timeTickIntvl 66 timeVariable 66 type 69 upperLimit 70 variable 70 trend attribute variable 71 Trend Display 65 TrendGrid 70 trendLog 70 71 TrendPres 70 TrendRuler 70 trendVariableFile 66 trLog attribute 70 Tutor pdat 26 tutorial application 12 Tutorial c ProcSee Tutorial program source 54 67 76 Tutorial pctx application 69 file 67 internal trend logger 66 Tutorial pdat 26 database definition 25 43 edit 69 file 69 Tutorial Tdoc edit 66 pec 67 save 67
36. ere you have copy the Tutorial pctx file select it and click on Open button Starting Up 11 To get more detailed information on how to use G ED refer to the ProcSee User s Guide 3 3 Description of the Tutorial Application Figure 4 This figure illustrates the mimic picture for the tutorial application A part of a flow process he uude ud in to the upper left valve flowing into a tank and out through the lower right valve The value at the top of the tank is indicating the fluid level in the tank The two characters T1 is the name of the tank 12 The goal of this tutorial is to give the user the opportunity to work through and get an overview of the main features of the ProcSee system To start with the end product of this tutorial a mimic picture will be produced presenting a part of a flow process with two valves and a tank connected to each other with pipes See Figure 4 BEES 03 16 58 03 17 58 03 18 58 03 19 58 03 20 58 0 TutorPic 1 Fluid from the process is coming in through the valve V1 flow ing into the tank T1 and out through the valve V2 The pipelines are changing colours between light blue and white depending on whether there is fluid in the pipe or not By clicking on the valves with the left mouse button they will toggle between an open or closed state If the valve V1 is open and V2 is closed the level in the tank will increase and the value light blue rectangle displayed i
37. es ge 9 3 2 Howto Start the ProcSee System 10 3 3 Description of the Tutorial Application 12 O AS 15 41 Creating a New Drawing rr 15 4 2 X Rectangle circle polygon line polyline and Text 18 43 Attributes m se UE Ob ee do aide ud dub e 20 5 Application Resources 25 5 1 Database Definition au aire AAA 25 5 2 How to do this by meansofGED 25 b QODIOLES ator e g iln dicont e is E oe ae ea ty ek 27 E 28 WEM AI 29 6 Design of Classes 31 6 1 Making a New Library 31 6 2 The Valve Class aue IR AS e a 32 6 3 The Tank Class o RE b P Cyan ree en 39 7 ThePicture 43 7 1 Database Definition x aou gee x ed can Rn Rene BE we 43 ties Jnstanlalliij s ao wires S 09 Que ER arit SERERE eS 44 7 3 Setting Graphics Attributes do x a2 LE aa ee S IRE od 46 7 4 Setting Dynamic Graphics Attributes 47 7 5 Creating a Window lt a 3 x Sur due etg oe ec Pte aoe 48 7 6 Using Tdoc as Source lll len 50 8 TheSimulator 51 EET Orr 51 8 2 BOUNCE ahh nos e AR A Can a oe APR Ue OR TRI AE dh 52 8 9 Requirements 5 s nues e 9e ge aee de Seb dr a da 54 8 4 Initializing the Application lll 55 8 5 Program EIoW s ias x busy bus d RE EE EB al 57 8 6 COMPING 22 EE TIT TITULI TT ao i STE 62
38. g one will be used 5 5 Patterns default patterns In addition to NoPattern and SolidPattern there is three default patterns see Figure 17 The patterns could be found in the Graphic Attributes window S O NoPattem Default Patterns as seen in VE de AO NENNEN 79 SolidPattern selected NNSSSSN DefaultPatternt A DefaultPattern2 2959 9 9 9 99 9 9 9 bo S052 SERRA q BSS DefaultPattern3 More patterns are available The User s Guide describes how to do this see User s Guide page 79 Application Resources 29 30 ProcSee Tutorial Design of Classes This chapter will deal with the design of classes as in the ProcSee system The classes are saved into libraries for later use when building the tutorial process picture 6 1 Making a New Library To create a new library in the Tutorial Application select the Li braries node in the tree and right click on it to get the popup menu see Figure 18 Figure 18 iBi xi F File Windows Options Help The figure illustrates how a new library can be created in an application already Current Scope Tutorial running in the rtm El rtm Select Libraries in the chosen ES Applications application and press the right mouse E re as button to get the popup menu and oo select New in the menu The same Colours menu is also available on the File menu Cursors in the menu bar when Libraries are Dialogues selected E Fonts H Functions Proces
39. ge 20 pops up when you select the Graphic Attributes button from the property buttons Select LineWidth among the displayed attrib utes and pick a line width in the list on the right side of the box e g number 9 Select a colour for the line in the same way Select the second line in the picture and repeat the procedure Now you should have a picture looking approximately like the one in Figure 29 on page 46 ProcSee Tutorial 7 4 Setting Dynamic Graphics Attributes Now connect the valve V1 to the process variable v1 state Grab the select tool once more and select the valve you named V1 To edit the state attribute of the valve you must open the Selected Properties window In this window you will find a list of attrib utes Select the attribute int State and press the Edit button The attribute editor window appears Enter the window and set the value of the state attribute to the dynamic expression v1 state int State vl state Repeat this procedure for the valve V2 or if you prefer a faster approach use the command line of the picture editor and write V2 State v2 state followed by a carriage return If there is already something writ ten in the command line just select the old text and type the new one Connect the level of the tank to the process variable t1 level by writing in the command line Tl Level tl level Be careful to include the right kind of quotes in these statements The ba
40. ger infor mation In these cases you have to use a text editor to add these things to the system The sequence here are that you produce the Tdoc file use the text editor to change the Tdoc file then you run PCC on the file to create the binary file that you read into the system with the Open menu options in G ED or by restarting the RTM One situation where you need to convert all the files to Tdoc files except for documentation is if you want to store the files in a source code control system which only handles text files In this situation you will also want to create a makefile for your sys tem that compiles all your files Both c and Tdoc an example of such a makefile is shown on page 48 To compile the files select the Tutorial Tdoc in Windows Ex plore right click on it and choose Compile from the popup menu Use the same procedure to compile the TutorLib Tdoc and TutorPic Tdoc files ProcSee Tutorial The Simulator In this chapter we introduce a small program coded in C that interacts with our user interface The program is using the ProcSee Application Programmer s Interface API to update values of database variables 8 1 Task Imagine a process consisting of two valves with a tank in be tween connected by pipes Water flows through the first valve into the tank and out through the second valve We will make a small program that changes the level of the tank according to the state of the valve
41. ght mouse button t7 al 4 2 6 Line Polyline linelpolyline Chose the Line tool in the drawing editor s Toolbar Select posi c tion of the first corner and press the left mouse button Move the cursor and press the left button for each corner Terminate the hy drawing by pressing the right mouse button t 4 2 7 Text text Chose the Text tool in the drawing editor s Toolbar Select posi tion and press the left mouse button Write the text and press re turn mer 4 2 8 Circle Arc Circle Cord Pie A Circle Cord or Pie is drawn in the same way as the drawing of a Circle The Circle Arc Generators are used to draw both type of objects The consequence of this is that both a Circle Cord and Circle Pie object will be of the type Circle Arc start amp openingAngle Default setting is startAngle 0 and openingAngle 100 The startAngle and openingAngle may also be adjusted with the mouse by focusing the shape pick up the adjusting point and drag to desired value GED 19 4 2 9 Ellipse Arc Ellipse Cord Pie start amp openingAngle 4 3 Attributes An Ellipse Cord or Pie is drawn in the same way as the drawing of an Ellipse The Ellipse Arc Generator is used to draw both type of objects The consequence of this is that both Ellipse Cord and Ellipse Pie object will be of the type Ellipse Arc Default setting is startAngle 0 and openingAngle 100 The startAngle and openingAngle may also be adj
42. ion A general introduction to this document and the layout Chapter 2 Preparations Configuration required before starting the ProcSee system Required environment variables PROCSEE DIR ARCH PATH Chapter 3 Starting Up The two main programs in the ProcSee system used when building an application RTM the Run Time Manager GED the Graphics Editor The related commands used are rtm and ged Chapter 4 GED Description of the most important functions in the Drawing Editor Drawing of simple objects and adding different types of attributes to these objects Chapter 5 Application Resources An overview of initial resources like colours fonts patterns etc was given Initial preparations like declaration of variables needed for operations without an application program running was done The data base definition script is called Tutorial pdat Chapter 6 Design of Classes Design of a new class library with a valve class and a tank class The classes were designed with shapes attributes and functions Chapter 7 The Picture The tutorial picture was built using the classes defined in Chapter 6 Design of Classes The three database variables were assigned to the class attributes to get the dynamic behaviour The pipelines connecting the tank and the valves were coded using pTALK syntax to reflect the state of the tank and valve instances Summary 83 Chapter 8 The Simulator Coding of
43. ion variables put together via the editor After having completed the process picture the functionality is tested by the editor test facilities A small simulator program coded in standard C is running as a stand alone process and is communicating with the RTM by use of standard ProcSee Application Programmer s Interface API functions The task of this simulator is to periodically update the RTM with the variables that are used in the end picture running the application The application is expanded with a window and two pictures two libraries and a database It is now a complete ProcSee ap plication 1 3 Conventions 1 1 The following conventions are used in this manual courier bold is used for constants such as pctx e PROCSEE_DIR refers to the directory where Proc See resides e lt appName gt means that appName is a user specified name the information icon is used to highlight where more information about a specific topic can be found the explanation mark icon highlights important points in the text 1 4 How to Use this Manual This is a document supporting the ProcSee features and capabil ities by working through a complete application example based on a few system files delivered with the system e Start with page number one and follow the descriptions e Avoid implementing new features to the tutorial example until having finished the last page Introduction 5 1 5 Definitions a
44. isplayed in the Attribute Editor window as shown in Figure 25 Attribute Editor Tutorial TutorLib ged classPic 1 0xe000002 foregroundFillCol E3 Attribute int foregroundFillColour V alveColour J predefined Compile Messages Compiled OK x Cancel Click on the Compile button and if the Compile Messages field shows Compiled OK then click on the OK button to remove the window Do the same operation for the line and ellipse shapes but for the line shape select the foregroundColour Click on the Selected Properties button or the X button in the property win dow to remove the Selected Properties window Insert the class in the File menu and close the drawing editor Be fore going on with the Tank class remember to save the Tutor Lib library first Also do a Document of the file Design of Classes 37 Dialogue Figure 26 The Dialogue Editor window Application function 38 A dialogue in a graphics user interface defines how the user in teracts with the system To create a dialogue for the Valve class select Dialogues in the Class Properties window and click on the New button or do it directly from the menu tree as described for the Attributes The window appearing is separated into two input areas one for the Trigger and one for the Action Type the statement as listed below in the Trigger area or click on the Menu Button at the right side of the window and chose from the
45. n in the class browser and place it in the picture e g coordinate 260 220 Select the Select ed Properties from the property window buttons Click on the Rename button and write B1 In the command line to the Editor type B1 MakeDynamic to set some of the attributes to the but ton dynamic Select the attribute char Action 64 and press the Edit button Type in the following statement see Figure 37 Set the Attributes Height to 40 and Width to 120 Make a frame work 73 Figure 37 Attribute Editor Tutorial StartPic B1 Action E X Attribute The Attribute Editor window char Action B4 system X Tutorial 84 JU Compile Messages Compile Cancel Help Click on the Compile button to verify that it compiled success fully before clicking on the OK button Select the attribute char LabelText 32 and type Start Process Do the Compile and OK Then draw a Text shape in e g 130 170 In the attribute char theText type Simulator Not Running Select font helv_b_34 from the Graphic Attributes window In the Picture Properties window choose the Dialogue and click on the New button Type the following code as in Figure 38 Do the Compile and OK Save lt Dialogue Editor New Dialogue x Figure 38 EE Trigger E The Dialogue Editor onere Ey window XS H execute myProcessQuit shutdownf Compile Messages Compiled OK x Oee em o om and Do
46. n the tank is updated accordingly Closing V1 and opening V2 will make the tank level decrease Because of the same flow rate through the valves the tank level will be stable if both valves are open ProcSee Tutorial The next chapters describe the procedures for obtaining the graphics and functionality for the tutorial picture described in the paragraph above 13 14 ProcSee Tutorial GED 4 1 Figure 5 The figure illustrates how to create a new picture in an application already running in the rtm Select Pictures in the tree and press the right mouse button while the cursor is focused on the Pictures node Select New in the popup menu When Pictures is selected the same menu is also available in the File menu This chapter will describe the most important functions in the Drawing Editor and explain the design of some simple objects Creating a New Drawing To create a new picture in the Tutorial Application select the Pic tures node in the tree and right click on it to get the pop up menu see Figure 5 rtm H Applications E Tutorial fl Others Attributes Classes Colours Cursors Dialogues Fonts Functions Libraries LineStyles Dthers Patterns Proce Strucl Wind Open Expand Collapse Select New on the popup menu GED 15 configurations 16 The drawing editor will appear on the screen and a picture named NoNamel will be cr
47. nder the Application level Type the function text as displayed in Figure 32 Then Function Editor Tutorial constructor x Function aia constructor load pictures T utorPic ppic displayPicture win TutorPic J Compile Messages eumdem E Click on the Compile and OK buttons and save the application to file To test the new window leave the graphics editor make sure you saved your picture library and application and shut down the RTM The Picture 49 Stop the RTM by closing the Output Window of the RTM An swer Yes to the question Do you really want to quit Restart the RTM by double clicking on the Tutorial pctx file in the Windows Explorer When the RIM starts up it will automatically load the applica tion open the window and display your picture 7 6 Using Tdoc as Source 50 The application and library and picture that we have created us ing GED could also have been created without GED by using a text editor and the Proc See Code Compiler PCC PCC converts ProcSee Tdoc files to binary files for applications libraries pictures etc The RTM produces Tdoc files when Doc ument is chosen from the menus in G ED In order to document a picture select the File menu and click on Document to create an ascii file TutorPic Tdoc of the TutorPic At the moment not everything possible to do in the ProcSee sys tem is possible to do from GED like adding trend log
48. ng the connection callback a flag is set to remember that the ProcSee connection is working PROGRAM continued PfFlushCreateVar isConnected 1 End up If the ProcSee connection is broken the callback function down will be called In this function you don t have to do much Just print a message and reset the flag PROGRAM continued void down int32 status char msg printf Lost contact with ProcSee s WMn msg isConnected 0 End down Every second the repeater function will be called PROGRAM continued int32 repeater int32 i This function is called repeatedly Here we check the state of valve number 1 If the valve is open PROGRAM continued if vl state 0 Valve V1 is open tl level V1 FLOWRATE the level in the tank should increase according to the flowrate of the valve 60 ProcSee Tutorial If valve number 2 is open the level of the tank should decrease ac cording to the flowrate of this valve PROGRAM continued if v2 state 0 Valve V2 is open tl level V2 FLOWRATE Before updating the ProcSee variable we check the tank level against the limits At this point it could be appropriate to execute some kind of alarm action but we are satisfied with just stopping the tank level from increasing decreasing PROGRAM continued if tl level lt MIN LEVEL Tank is empty tl level MIN LEVEL if
49. nt chapters dealing with each of the modules and building blocks that the system consists of The tutorial can therefore be used as a reference to get informa tion about different Proc See modules This tutorial is written on the assumption that the users are famil iar with using applications on Microsoft Windows 1 2 What to Expect from this Tutorial creating directory environment variables starting the system default resources introduction to GED design of classes This tutorial is dealing with most of the modules and utilities in the ProcSee delivery The tutorial application that will be the end product of working through this document uses all the main building blocks for creating the required application files The following list gives a short overview of what will be worked through in the tutorial The second chapter starts with creating a tutorial directory where all the files concerning this tutorial application will be lo cated Also the starting of the Proc See system with the different modules will be described in this chapter You will also find the procedures for copying the predefined files delivered with the system to this specific directory These files will be used for start up of the example application A reference to where the binary files for ProcSee is located and a help for the ProcSee system manoeuvring to the right resource files from a user defined place is called PROCSEE DIR In ad dition th
50. oat angleSnap int backgroundColour int crosshairFollowSnap int crosshairLength int crosshairStyle int crosshairVisibility int gridM ajor int gridMinor float oneT oO ne float radiusSnap int resizeMode float rotation amp ngle int undateMode zi This Due is illustrating the Class Properties window The window is used to create new edit and delete different properties of the current class The first operation to do in this window is to create a new at tribute for the valve class Click on the New button and type in this pTALK statement as shown in Figure 22 in the Attribute Editor window and click on the Compile button to verify that it compiled successfully Compiled OK before clicking on the OK button Figure 22 x Attribute The Attribute Editor window Compile Messages Compiled DK x m em o The statement is a declaration and initialization of the integer at tribute Later on we will set the State attribute to a process varia ble 1 pTALK is the ProcSee programming language that has most of its syntax inspired from ANSI C and can be compiled and evaluated at run time by the RTM For more information about pTALK refer to chapter 8 in the ProcSee User s Manual Design of Classes 35 Select Functions in the Class Properties window and click on the New button Type in the IsOpen function as shown in Figure 23 click on the Compile button If the output field shows Com
51. ocument option GED 23 24 ProcSee Tutorial Application Resources This chapter gives an overview of the default resources colours and fonts in the ProcSee system and necessary tasks for initial preparation 5 1 Database Definition In order to make it possible for the Graphics Editor G ED and the Run Time Manager RTM to operate without a program running we declare the variables needed in a database defini tion called Tutorial pdat This text file will be read by ProcSee at start up and contains the following definitions DATABASE DEFINITION pdat float tl level int32 v1 state int32 v2 state uon ou ooo 5 2 How to do this by means of GED We want the process database script from Chapter 8 The Simu lator on page 51 to be included in our application This is not strictly necessary since the tutorial program creates the variables anyway but we want to be able to edit our picture without start ing this program For the application to read the database defi 1 The use of the terms application process and program might be a bit confusing With application and process we mean entities administered by the run time manager The task or the program is an external piece of code running independently communicating with Proc See through the API Application Resources 25 26 nition it has to be declared in the application resource file the pctx file that was originally copi
52. ocument the application by using the menus in GED to get a Tutorial Tdoc file Open the file Tutorial Tdoc in your text edi tor Try adding the following lines within the scope of applica tion Declaration of a trend logger which is internal to the display RTM trendLog myLog name of the logger timeTickIntvl 1 ticked every second timeMaster 22 ticks sent by application timeVariable myGlobalTime variable for time stamping trendVariableFile myVars ptrv where to find trend variables 66 ProcSee Tutorial Save Tutorial Tdoc pcc Tutorial Tdoc Edit Tutorial c This declaration says that we will have a trend logger that is named myLog and it will be ticked every second The timeMas ter variable has a value of 2 this indicates that an external appli cation is responsible for ticking the trend logger at the specified interval In our case this application is the simulator we have written The trend logger must have a notion of time Here this is done by letting the application set and advance time by changing the val ue of a process variable named myGlobalTime Further on we want to declare the trend variables in a separate file The reason for keeping them separate is that the number of trend variables tend to be very large in most trend logging sys tems After adding the lines in the application save the file and run it through pcc to get a new Tutorial pctx file This is
53. ons PfClose 57 PfCreateVar 59 69 PfData 62 PfEndLoop 77 PfExecute 76 PfFlush 61 68 PfFlushCreateVar 59 PfGetFuncArg 62 PfId 62 PfInitialize 56 57 PfMainLoop 57 PfPrintSystemError 56 PfRegisterFunction 58 76 PfSend 61 PfSetProcessHandler 57 api h header file 54 apiError 56 application 6 extension 79 running 5 tutorial 12 Tutorial pctx 69 Application Programmer s Interface API5 54 applName 56 appName 5 arc circle 19 ellipse 20 ARCH 4 26 83 ascii files editor 6 assignment dynamic 47 attribute 6 dynamic graphic 47 Edit 47 fill 20 float 41 Foreground 34 graphic 20 46 line 20 Line Pattern 34 LineWidth 34 71 logFrequency 71 style 20 text 20 theFont 71 trLog 70 visibility 21 79 80 width 20 Attribute Editor window 39 B background colour 17 33 44 Background Colour 17 button 33 class 39 Background window 17 button Background Colour 33 Class Properties 38 Compile 35 36 38 39 Create 36 38 40 edit 37 Editing 33 Graphic Attributes 34 New 35 OK 35 38 39 Presentation 70 Buttons 73 C cacheSize 56 callback function 6 ChangeValveState function 38 changeValveState PfRegisterFunction 55 circle arc 19 cord 19 pie 19 Circle tool 18 class 6 Background Colour 39 design 4 instance 44 save 32 settings 33 Class Browser 44 Class Properties 34 40 Attributes Create 39 button 38 Functions Create 36 38 40 window 34 34 39 Class Settings background colour 33 Il Class Se
54. ould not init API n PfPrintSystemError apiError 56 ProcSee Tutorial Note that PfInitialize doesn t actually initialize the ProcSee run time manager It initializes a routine that tries to get in touch with the RIM When it succeeds the callback function registered in the up parameter of PfInitialize is called Your program s ini tialization should be placed in this function not after the return from PfInitialize We want the program to update the process variables at a steady interval We can accomplish this by using a Process handler a function called at regular intervals We call our process handler repeater and register it with PfSetProcessHandler PROGRAM continued PfSetProcessHandler repeater 1000 repeater called every 1000 ms The function repeater should be called every second 8 5 Program Flow All preparations are finished and the program can enter its main loop All connection callbacks and process handlers will be exe cuted in the PfMainloop PROGRAM continued printf Enter Pf loop n if PfMainLoop OK printf Could not start Pf loop n PfPrintSystemError apiError The main loop is normally not terminated If it terminates any way we close our ProcSee connection and exits the program PROGRAM continued if PfClose OK printf Could not close Pf n PfPrintSystemError apiError printf Exit n return 0 End of
55. ouse button or in the file menu in the menu bar The drawing editor will appear on the screen as shown in Figure 19 The same drawing editor is used for designing both pictures and classes see Figure 6 on page 16 File Edi View Graphics Windows Options Help 6 2 The Valve Class save the class 32 Start the design of the valve class by renaming the default NoName drawing Click on the drawing editor s File menu and select the Insert As option Type the name Valve for the actual class in the Insert as class input field and click on the OK button ProcSee Tutorial configure the drawing Note that this will only insert the class into the library the class is not yet saved to file In order to save the class the library have to be saved It is mandatory to configure the drawing options before starting to work with it This include setting the background colour the snap interval and the geometry for the drawing Choose the Op tions menu and select the Class Settings from the pull down menu This will bring up a new window for setting the coordi nates of the drawing Type in the settings illustrated in Figure 20 Figure 20 Window for setting the geometry to the current Class Settings E drawing World X and Y World X 100 are the coordinates of the z upper left corner of the wody 100 drawing area The origin World width 300 in the coordinate system will represent the World Height
56. position x 30 y 30 Select the Graphic Attributes button as described in Figure 10 on page 20 Select the ellipse shape in the drawing area Click on the Foreground attribute in the Line column and select the black colour in the palette list at the right side of the window Then click on the LineWidth attribute and select the width number two in the presented list Click on the Line Pattern at tribute and set it to Solid pattern number two from the top of the list Move the cursor to the drawing area and select the polygon shape Do the same operation for this shape in the Graphic At tributes window Select the last line shape Set the LineWidth attribute to width number five and the Line Pattern to Solid pattern number two To remove the graphic attribute window click on the same button that brought it up or click on the X button on the graphic Attributes window The graphics representation of the class is now defined and the next step is to define some attributes and functions for the valve class This is done in the Class Properties window Select the Class Picture Properties button or click on the View menu and select the Class Properties option from the pull down menu The Class Properties window illustrated in Figure 21 is used to create new edit and delete an attribute a function or a dialogue ProcSee Tutorial Figure 21 Class Properties BS xj Attributes Functions Dialogues fl
57. pplication attribute callback functions class colour compile font library pattern ProcSee connection picture resource toggle update See library functions windows An attribute is a variable local to the user interface and does not have a corresponding variable in a user program See section 9 9 in ProcSee User s Guide User supplied functions that will be called by the API to inform the application code about changes in the connection with Proc See A class is a reusable interface component It is a picture which may include attributes functions dialogues and graphic shapes saved collectively as a class A resource see section 5 3 on page 27 Using the pcc program to generate a binary file from an ascii file A resource see section 5 4 on page 28 A container that can hold a number of graphic class definitions and resources A resource see section 5 5 on page 29 Mechanisms used to connect application code to the ProcSee RIM The visible part of the user interface displayed in windows Colours fonts and patterns defined in a library or application Alternate between two states e g on off or open closed Global update of picture in an application 1 6 Requirements Some prerequisites are required to be able to work through this tutorial Check the list below and find out if there is something that your system is missing Possible problems can be solved by your system administ
58. printf Failed to register myProcessQuit n PfFlushCreateVar PfExecute TutorPic Trendl panAbs myGlobalTime set the trend to current time 76 ProcSee User s Manual Type then the function itself Add the register function myProcessQuit to the simulator program PROGRAM int myProcessQuit int32 numArgs void data PfEndLoop return OK Compile and build the program When you are sure that all the files are saved and documented Shut down Ged rtm and Visual Studio Double click on the Tutorial pctx in the Windows Explor er and the start picture should appear Pressing the Start Process button the program should start The tutorial picture should switch place with the start picture You can now open and close the valves Shut down the program with the Quit Process button The start picture will return Make a Frame Work 77 78 ProcSee User s Manual Further Enhancements In this chapter we present some ideas to how you can further extend your application 11 1 Picture update mode Make sure that the picture updates without any flickering Clue Use the update Mode attribute in the trend and the picture 11 2 Window title Change to a better text in the window frame Clue Use Window title 11 3 Trend extensions Add grid in trend Show upper and lower limit for the curve in the diagram Add a ruler and text showing the ruler value and the ruler time Clue U
59. process variables will be created by the program creat ed in chapter 8 The Simulator on page 51 and made known to ProcSee when the program is connected to the Run Time Man ager RTM In order to make it possible for the Graphics Editor GED and RTM to operate without this program running de clare the variables in a database definition script called Tutori al pdat See Figure 14 on page 26 This script will be read by ProcSee at start up and contains the following definitions DATABASE DEFINITION pdat float tl level int32 vl_state int32 v2 state m ooo 43 7 2 Instantiating Figure 28 The Use ClassBrowseroption in the Options pull down menu and the Instantiate Class window instances ply ml Class Browser s Instantiate Class Select Library to browse Tutortib 44 Tank Now all the building blocks are ready and you can start building your applications picture Select the Pictures node in the tree and proceed as described in chapter 4 GED on page 15 In the drawing editor resize this window to a size that suits you before you start drawing and set the background colour to a pleasant value e g grey50 The background colour can be set from the Background option in the Options menu of the pic ture editor You should also set the X and Y snap to 10 from the Snap option in the Editing Options window opened from the Options menu all as described in Chapter 4 G
60. program PROGRAM continued The application variables float t1 level MAX LEVEL int vl state 0 int v2 state 0 In addition the variables have three identifiers used by the API when updating the ProcSee representation PROGRAM continued Id s for the variables int t1 id int v1 id int v2 id Three functions are called in different situations A repetitive function is called to change the water level continuously Anoth er function is called when the program connects the up func tion and a third is called if the connection is broken the down function In addition one register functions changeValveState must be declared PROGRAM continued int32 repeater int32 This function is called repeatedly void up int32 char Functions called at connection events void down int32 char Functions called at connection events int changeValveState int32 void Register function 8 4 Initializing the Application The main routine of your program should initialize the applica tion set up a process handler and start a main loop PROGRAM continued int main The Simulator 55 To get contact with ProcSee the API needs to know on which host to find the communication server and the name of the Proc See run time manager In addition we have to identify our pro gram with an application name and a process name The actual initialization of the APl is done
61. project for creating a Win32 console application CLR General MFC Test Win32 Visual F Other Project Types Database Test Projects Online Templates Name Tutorial Location c develop procsee tutorial y Browse Solution name Tutorial Y Create directory for solution _ Add to source control EC ES Give the project a name e g Tutorial Location is where you want your program file to be Then click on the OK button Select the An Empty Project radio button in the Application wizard and press Finish Now you can either create an empty file called Tutorial c or copy the file from PROCSEE_DIR tutorial winArch re sult To create a new file select Add New Item from the Project menu and select the C File cpp template from the list Enter the name Tutorial c in the Name text box and press OK ProcSee Tutorial Figure 35 New file No Visual Studio Add New Item Tutorial Em Installed Templates Sort by Default x ES Search Installed Templates p 4 Visual C E Type Visual C u Windows Form Visual C ques m Creates a file containing C source cod Code Data C File cpp Visual C Resource Web 9 HTML Page htm Visual C Utility Property Sheets 3 Static Discovery File disco Visi Cis h Header File h Visual C ag Mid File idl Visual C j Resource File rc Visual C Name tutorial c Location C develop procsee tu
62. r to make alignment of shapes more easy In Snap Settings World Coords set both the X and Y snap to 10 Remember to activate the Toggle Buttons for X and Y Click on the OK button to confirm the settings Default value for background colour is black If you want to change the colour do the following Chose the Options Pull Down menu and select Background The Background window will appear on the screen see Figure 9 Tutorial hd E U L JL Eg NN Es Mim m EH uS om EH ESSI M Bk 0 gue e Chose a Colour e g grey50 from the Background colour menu or write the colour name in the text field below Confirm the text input by pressing the Apply button The Close button will re move the Background Colour window GED 17 4 2 Rectangle circle polygon line polyline and Text 4 2 1 General Select Mode M Ol Keep fe 4 2 2 Rectangle rectangle y L1 zi 4 2 3 Circle circle O ral 4 2 4 Ellipse ellipse UN e e 18 This chapter will describe how to draw some simple shapes and how to equip the shapes with graphic attributes It will also describe how to draw a line or polyline how to write a text string and how to connect graphic attributes After terminating the drawing of a shape the editor will set itself into select mode indicated by the Select Mode tool In select mode other shapes can be selected by clicking on the shape with the left mouse button If
63. raphic attributes to represent the different states Give the classes at tributes to set the states Clue Use the visibility attribute to swap between different representa tions 11 9 Extend the Picture Save your class library and reopen the picture Place instances of the new classes in the picture i e a safety valve on the T1 tank 11 10More Process Variables Extend the database definition script with some more variables The flowrate of valves pump speed etc Create and change the contents of the variables from the Tutorial program When the tank level exceed some limit open the safety valve 80 ProcSee User s Manual 11 11Scales Create new classes to visualize the process variables Scales measuring the flowrate through valves and in out of tanks Show pump speed as speedometer Clue Draw a filled circular arc slice set the opening angle equal to some attribute 11 12Functions Create a function that evaluates an opening angle from a flow rate Take into consideration the maximum and minimum flow rate Clue Re edit the water level function 11 13Text Fields Add an editable text field to enter the opening value of valves Clue Let the text field work directly on some process variable read by the Tutorial program Further Enhancements 81 82 ProcSee User s Manual Summary Summary of what is done throughout this document 12 1 What is Covered of the ProcSee System Chapter 1 Introduct
64. rator The ProcSee obe is properly installed according to the enclosed installation specifications e Your system is running a version of Windows NT which is supported by ProcSee e An editor for editing ascii files must be available e Sufficient access privileges to the actual files and directories referenced in the tutorial ProcSee Tutorial Preparations This chapter is dealing with a complete description of what is required before starting the ProcSee system setting the ProcSee variables required starting up options and copying the necessary files to a specified directory 2 1 Configuration of a ProcSee Environment In a User Interface Management System UIMS like ProcSee the user need flexible possibilities to configure the system and inter act with other systems according to his requirements The following subjects describe the preparation for starting a new and empty application based on predefined colours fonts and other standard graphics resources Environment Variables On Windows NT the Environment variables should already have been set to their correct values if the system has been in stalled properly To make copying and system commands easier it is important to define a unique ProcSee Environment variable in the operating system This variable is called PROCSEE DIR and is referred to by putting a before and after the variable To set Environment variables on Windows NT use the Start menu
65. rendPres1 Change its name by selecting the rename but ton in the Selected Properties window Rename it to myCurve It is very important to set some of the attributes in the Presentation shape to another value than system default otherwise no trend curve will appear on the display The essential attributes are variable logFrequency lowerLimit e upperLimit ProcSee Tutorial The attribute variable must be set to t1 level which was added to the trend variable file myVars Tdoc The name of the trend variable file where set up in the trendLog part within the appli cation scope Change the attribute to t1 level This variable is used as an indication of the amount of liquid in the tank By changing the state of the valves the trend curve myCurve will re flect the amount of liquid in the tank for the last 300 seconds A trend variable can be logged at different time intervals As an example t1 level can be logged at intervals of 1 5 and 10 seconds The logFrequency attribute can be used to specify the desired log interval for the current Presentation shape A value of 1 de fault indicates that the best possible resolution for this trend var iable will be supplied by the trend logger lowerLimit and upperLimit is set to the minimum and maxi mum value the variable t1 level may get In our tutorial the liquid in the tank will never exceed 1000 0 nor will it be lower than 0 Set upperLimit and lowerLimit to 1000 0 and 0 resp
66. s If valve no 1 is open thelevel of the tank should increase by a steady rate If valve no 2 is open the level should decrease accordingly Penred Application RTM The level of the tank is V1 pressed calculated by the external application according to the Valve 1 state of the two valves The valves are controlled by an operator 9 API t1 level Valve 2 V2 pressed 51 8 2 Source Visual Studio Figure 34 New project 52 The application program will communicate with ProcSee through three process variables and a register function express ing the state of the two valves and the level of the tank To create this program a source file Tutorial c has to be created If you don t want to do this now all files for the tutorial can be found at PROCSEE_DIR tutorial winArch result and you can copy some of the files you need from this directory This section shows how you can use Microsoft Visual Studio to follow the Tutorial We start with a new solution and project Choose New from the file menu and select Win32 Console Application from the Projects tab see Figure 34 New Project Recent Templates NET Framework4 Installed Templates Sort by Default 33 E search Installed Templates p Type Visual C a in32 Consol Vi Visual Basic a Win32 Console Application fisual C Visual C 4 Visual C Win32 Project Visual C ATL A
67. se TrendRuler dialogue trigger cursorMoved getRulerValue getRulerTime Make it possible to pan back and forward in time outside what is the time span in the trend shape Clue Use panAbs and panRel Let the trend curve change colour when crossing a limit Clue Use the tr function 11 4 Plot the picture Plot the picture using a button Clue Use the pTALK function exportPostScript Further Enhancements 79 11 5 Run two RTM s on the same Tutorial Two RTM s running the same Tutorial and using the same simu lator Clue Use n option to the RTM more call on PfInitialize or perhaps use PfInit and PTALK function connectToProcess 11 6 Use a data configuration file Let the simulator read data from a configuration file instead of coding the variables in the simulator Clue Use the PfReadScript 11 7 Performance Measure the time RTM use to update the process picture Clue Use the standard library for the performance test or use the PTALK function msecsToday and the dialogue triggers before PictureUpdate and afterPictureUpdate 11 8 More Process Units Add some more classes to your library Choose some representa tion for a pump a safety valve a regulation valve etc How many different states should they have Open Closed Running Not Running Starting Closing Half Way open etc How should the components look like in their different states Draw the classes in the drawing editor Try out different g
68. sed to set up the connection between the dif ferent programs by holding the connection information like which host a process is running on and which port on that host to use Figure 2 Graphics Editor The figure illustrates that the Graphics Editor actually is a ProcSee application The communication between the applications and the Run Time Manager is taken care of by the Software Bus The UI Configuration Database is where the applications user interface information reside Control is started automatically by Windows UI Configuration Database Control Run Time Manager 3 2 How to Start the ProcSee System In the previous chapter it was stated that it is required to start the two main ProcSee programs Before trying to start these pro 1 grams remember to define the three Environment variables as 3 described in section 2 1 Start RIM and GED from the ProcSee group in the Start menu Right click Applications node and choose Open 10 ProcSee Tutorial Figure 3 This is how the Graphics Editor will look like the first time it appears on the screen This main editor offers editing possibilities on pictures and libraries by starting a drawing editor in another window By using the input field second from bottom the user has direct access to the ProcSee language pTALK in the Run Time Manager The bottom field is for output
69. ses Structs windows Select New on the popup menu and a library named NoNameLib1 will be created When the library has been created it is important to set a suitable name on it This is done by selecting the NoNameLib1 library and selecting the Save As menu choice on the popup menu that is displayed when right clicking on the library node Go to the li brary folder Design of Classes 31 Drawing Editor This is an illustration of E GED s Drawing Editor ala The drawing editor is currently presenting a NoName drawing until saved as something else At the top there are pull down menus and at the left side there is a toolbar for drawing facilities At the bottom there is an input and an output field Figure 19 In the save window that is displayed see Figure 13 on page 23 type the name TutorLib and click on the Save button You should also save the application now so that the library in serted into the application is available next time the application is loaded This is done by selecting the Tutorial application and clicking on Save in the menu that pops up when the right mouse button is clicked or in the File menu in the menu bar If failed check the properties on the Tutorial pctx file To create a new class in the library bring up GED s Drawing Ed itor by selecting the Classes node under the TutorLib library node in the tree and clicking on New in the menu that pops up when clicking the right m
70. t used The colour of a Pattern is equal to the Back ground colour selected Iry to change the graphics attributes for some of the shapes drawn in section 4 2 on page 18 Select the shape by choosing Se lect Mode and click on the shape Chose from the different types of attributes Shapes with visibility Invisible will be visible only when Test mode is selected 4 3 2 Selected Properties Selected Properties al Al Figure 11 This figure is illustrating the Selected Properties window for the selected shape In addition to the attributes found in the Graphic Attributes window the Selected Properties window includes dynamic at tributes for adjustment of height width positioning rotation etc of the shapes Select the shape you want to modify and then click on the Select ed Properties tool in the drawing editors Toolbar The Selected Properties window will pop up on the screen as shown in Figure 11 The window includes editing facilities for Attributes Functions and Dialogues Rectangle Oxe000001 Rename Attributes Functions Dialogues int backgroundColour int backgroundFillColour int fillPattem Edit int foregroundColour int foregroundF illColour int linePattern float linewidth float rotation amp ngle int visibility float width x 21 Figure 12 This window shows the Attribute Editor which is used for changing the selected attribute value Select the earlier dr
71. tate 0 tl level V2 FLOWRATE if tl level lt MIN LEVEL tl level MIN LEVEL if tl level gt MAX LEVEL tl level MAX LEVEL if isConnected myGlobalTime increment time by one second PfSend tl id new value for tank level in RTM PfSend v1 id the state of V1 PfSend v2 id the state o V2 PfSend time id new value for time variable in RTM PfFlush update variables tick trend log and update screen return OK make Next step is to compile and link your simulator program This is done by issuing the make command at your working directory 68 ProcSee Tutorial Edit Tutorial pdat The variables will also have to be declared in the Tutorial pdat file pdat float t1 level int32 v1 state int32 v2 state int myGlobalTime Showing the Tutorial pdat file DATABASE DEFINITION uou yg d nooo time variable must be defined here Edit myVars Tdoc The last thing that remains to be done in order to configure the trend logger is to create the file containing trend variables i e to specify which of the variables declared by PfCreateVar that is to be trended Using a texteditor create and open a new file called my Vars Tdoc Place the file in the same directory as the Tutori al pctx file The content of this file should look like 1Cycle 1 type 5 Trend variable configuration file trendVarConfig myVars trendVar tl level
72. tf variable vl state added In We create our variables with a name a type a Record type name a cache fix parameter unused and a value pointer The variable name is identical to the one we use in the definition of our picture and in the database definition script We have chosen integer as a representation for the state of the valves in our picture In this context the integer is defined PfCInt Since the type is not a re cord you should enter NULL for the record type name In the last parameter we enter the address to the internal repre sentation of the variable If the variable is changed in one of the pictures it will be reflected in this variable PROGRAM continued v2 id PfCreateVar v2 state PfCInt NULL 1 amp v2 state if apiError OK printf variable v2 state added n tl id PfCreateVar tl level PfCFloat NULL 1 amp tl level if apiError OK printf variable tl level added n We add two more variables representing the state of a second valve and the level of a tank The tank level is represented as a float PfCFloat In order to increase speed when creating variables the function PfCreateVar is storing the variable information in a local buffer and relies on the user to call the API function PfFlushCreateVar when variable creation is finished When PfFlushCreateVar is The Simulator 59 called all the buffered variables are created in the RTM at once Before leavi
73. th and the height attributes and set the geometry to 300 and 200 respectively Set the foregroundColour and foreground FillColour to medBlue and steelBlue To get the connection to the trend logger we just have defined the default attribute trLog in the Trend shape is set to myLog Re call that this trend logger name is the one specified in the Tdoc file in the application scope with the keyword trendLog Another important attribute in the trend shape is timespan This attribute is used for specifying the number of seconds of the curve which is visible in the trend diagram As default this attribute is set to 240 change it to 5 minutes by setting timespan to 300 To define a trend curve select the Selected Trend window in the Tools menu Keep the Selected Properties window open A window will appear which is used for defining all shapes a trend may consist of From this Selected Trend window it is possible to create a Presentation trend presentation Time Labels Ruler and Grid The first we will do is to create a Presentation shape Select the Presentation button from the options menu which will enable the New button Press this New button and select the TrendPres1 shape in the list The attributes that are available for the Presen tation will appear in the Selected Properties window If this window isn t open then open it by choosing it from the Tools menu The trend curve just created is by default called TrendPres1 Se lect the T
74. the Shift key keyboard is pressed the left mouse button will have a toggle function and more shapes may be selected or un selected Shapes may also be selected by dragging a rectangle around them The currently se lected shape s will be marked with small rectangular handles If the Keep tool is selected the chosen drawing tool will remain and more than one shape of the same type can be drawn in se quence Chose the Rectangle tool in the drawing editor s Toolbar Select position of the first rectangle corner and press the left mouse but ton Keep the button pressed and drag the cursor Release mouse button when rectangle size is sufficient Chose the Circle tool in the drawing editor s Toolbar Select po sition of the circle centre and press the left mouse button Keep the button pressed and drag the cursor Release mouse button when circle size is sufficient Chose the Ellipse tool in the drawing editor s Toolbar Select po sition of the ellipse centre and press the left mouse button Keep the button pressed and drag the cursor up down to change the height and left right to change the width Release mouse button when ellipse height and width is sufficient ProcSee Tutorial 4 2 5 Polygon polygon Chose the Polygon tool in the drawing editor s Toolbar Select position of the first corner and press the left mouse button Move t7 the cursor and press the left button for each corner Terminate the drawing by pressing the ri
75. tiating procedure for the valve class creating a valve instance Place this valve somewhere over and to the left of the tank e g coordinate 60 70 Enter the shape property win dow once more and rename the instance V1 Repeat this procedure creating another valve in the lower right of the picture e g coordinate 400 340 Call it V2 Now connect the instances with a line Select the Line tool in the Tools menu Draw a line from the V1 valve to the T1 tank by pressing the left mouse button at the beginning the corners and the end points of the line you need to create the pipe between the valve and the tank Finish the line by pressing the right mouse button You can adjust the line afterwards with the handles if you are not satisfied with the coordinates See Figure 29 on page 46 Draw a similar line from the tank T1 to the valve V2 The Picture 45 Figure 29 The picture Two valves and a tank interconnected with pipes Picture Tutorial TutorPic File Edit View Graphics Windows Options 0 selected 7 3 Setting Graphics Attributes Select Graphic Attributes 46 Set the line width and colour from the Graphic Attributes win dow Select the Select tool in the Tools menu Then move the cur sor to one of the lines and select it The line is now the currently selected object on the screen and you can manipulate it through the graphic attributes window The Graphic Attribute window see Figure 10 on pa
76. torial Browse J Now you have a text file where you can enter your program code for the tutorial If you do not want to enter all the text in Tutorial c you can insert the file into your Visual Studio project by right clicking on the Source files folder in your project and chose Add Existing Item from the popup menu Go to the PROCSEE_DIR tutorial winArch result select the Tutorial c file and click on the OK button The file will now be inserted into your project The project need to use the Proc See and ws2 32 libraries the ProcSee header file include path and set the winArch define Detailed instructions on how this is done can be found in the Ref erence Manual under Part 3 Manual Pages Application Program mers Interface Manual pages Compiling and Linking Since this tutorial will configure a Visual Studio 2010 project with the debug target we will use the following settings Additional Library Directories is set to PROCSEE_DIR lib winArch vc10 Additional Dependencies adds ws2_32 lib and ProcSeeApiC MDd lib Under C C settings we define winArch and set Additional include directories to be PROCSEE DIR include If you are not using the Visual Studio you need to create a work ing directory where you create the files Tutorial c and makefile The content of these files are described in section 8 3 8 6 The tutorial exe file is also needed if no compiler is available Copy the tutorial ex
77. ttings window 33 colour 6 background 17 33 44 name 27 predefined 27 command line 47 compile 6 40 button 35 36 38 39 configure drawing 33 connection 6 control panel 7 controlHostName 56 copy file 8 cord circle 19 ellipse 20 create attribute 39 button 36 38 40 directory 4 window 48 D database definition 25 43 default patterns 29 definition database 25 43 description font 28 design class 4 picture 5 dialogue 38 editor 38 39 event 38 directory create 4 document picture 23 down 56 function 55 draw shape 41 ProcSee Tutorial drawing configure 33 editor 16 drawing editor 32 dynamic assignment 47 graphic attribute 47 E edit attribute 47 button 37 myVars Tdoc 69 Tutorial pdat 69 Tutorial Tdoc 66 Editing Options 17 Editing button 33 editor ascii files 6 dialogue 38 39 drawing 16 32 ged 11 process 26 test mode 47 ellipse arc 20 cord 20 pie 20 shape 37 Ellipse tool 18 34 environment 7 ARCH 4 PATH 4 PROCSEE DIR 4 7 variable 4 event dialogue 38 execute 38 explanation mark 5 extension application 79 F file copy 8 Tutorial pctx 67 Tutorial pdat 69 File menu 11 Insert As 32 Save needed 37 42 Save As 48 fill attribute 20 foreground 41 float 41 font 6 angle 28 description 28 name 28 predefined 28 size 29 weight 28 foreground attribute 34 colour 70 fill 41 fill colour 70 line 48 foregroundColour 37 for
78. ture Select Save in the drawing editors File menu 7 5 Creating a Window 48 Your picture is now finished but still you cannot access it from outside of the graphics editor To use the picture directly in your application the application needs a window of its own You use the Window editor in GED to create a window for your application Open the Window editor by selecting Windows under the Tuto rial application in the tree view and then select New on the File menu or the menu that pops up when the right mouse button is pressed ProcSee Tutorial Figure 31 The window editor Figure 32 The Function Editor window showing the constructor function Name win Restore Accept Type Normal Window x EN Parent root Y 59 Group Width 600 Title Height 380 Decorations ALL Functions ALL Input mode MODELESS Cursor Default cursor Advanced Map Unmap Iconify Raise Lower Bes m In the Window editor that is displayed see Figure 31 change the name of the window to win1 and change the width to 600 and the height to 380 Click on the Accept button to set the values into the window You can click on the Map button to have a look at the window Click on the OK button when finished This will supply your application with a window To display the picture in the window add the following constructor function to your application by selecting Functions u
79. usted with the mouse by focusing the shape pick up the adjusting point and drag to desired value This section will describe how to connect attributes to the shapes lines and text strings 4 3 1 Graphic attributes Graphic Attributes Figure 10 This figure presents the Graphic Attributes dialogue window To set a new attribute value select the actual attribute and change it in the presentation list at the right side of the window 20 When you draw a shape you can decide position form and size If you want to add attributes like colour border patterns etc the Graphic Attributes is a tool for this purpose Select the shape you want to modify and then click on the Graphic Attributes tool in the drawing editors Toolbar or click on the View menu and select the Graphic Attributes from the pulldown menu The Graphic Attributes window will pop up on the screen see Figure 10 The window includes attribute values for line and fill colours patterns line style line width and fonts Graphic Attributes x foregroundFillColour red 2 Line Fill The attributes for shape colours are grouped in Line and Fill Line Polyline and Text shapes have no Fill attributes Line Polyline and Shape Boarders do have an extra attribute for Width and for Line Polyline there is also an attribute for Style ProcSee Tutorial If the selected Pattern None the Foreground and Background colours are no

Download Pdf Manuals

image

Related Search

Related Contents

  PDF - Egg incubators  BT PARAGON450 User's Manual  Tiger Jurassic Park III 71-612 User's Manual  BoConcept Zarra Low 1535 Assembly Instruction  B7 series lighting board assembly guide  gamme - Triams  Toshiba PA5022U-1LC3 Flat Panel Television User Manual  Parkside PLBS 30 User's Manual  KF-R196 取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file