Home

User HMI for PA Control

image

Contents

1. http java sun com products plugin index html download gt lt NOEMBED gt lt NOEMBED gt lt EMBED gt lt COMMENT gt lt OBJECT gt lt lt APPLET CODE HelloWorld class WIDTH 200 HEIGHT 40 gt lt APPLET gt gt lt END_CONVERTED_APPLET gt lt body gt lt html gt Fortunately Sun provides a special SDK utility HtmlConverter exe to make above conversion automatically See Java SDK documentation for details You can find HtmIConverter exe utility in bin directory of installed Java SDK Java Sources Sources are represented by following files e DataObject java implements parsing of xml strings Such strings are used for communication with CNC server e DataThread java implements communication with CNC server by socket e CPApplet java reads writes cycle parameter P10 from to CNC Communication objects lt enter gt lt select gt lt record gt are used for that Be careful to use lt record gt UDOO7EN User HMI for PA Control Rev 07 Page 16 Subject for technical modifications and errors because of synchronization problems when several clients try to get data in same time For example to get cycle parameter P10 each client has to issue three requests lt select gt lt sub gt par lt sub gt lt name gt 1 lt name gt lt level gt file lt level gt lt select gt lt record gt lt sub gt par lt sub gt lt bof gt yes lt bof gt lt record gt lt record gt lt sub gt par lt sub gt lt pos
2. Batch file copies all required files to hmi working directory and registers ActiveX components Note standard HMI should be installed before User HMI application can be started by command line see start bat hmiframe exe i user fi userframe or by script start bat Configuration Level General User doesn t need additional tool and experience in programming to customize standard HMI on this level All can be done by simple text editor and graphic editor which are included into operating system See SDOO2EN HMI Setup and Configuration Guide for details User can Change shape of buttons icons manually by graphic editor Change fonts number of hard keys and soft keys location of tool bars directly in HMI Setup dialog or via ini files Assign reassign function for each hard or soft key most of soft keys can be assigned in HMI Setup dialog complete assignment is carried out via cfg files Assign layout from existing list for each SK level via cfg files Create own layout or change existing ones as required via XML files Margins background color size and position fonts whether border and title is present or not and other information are specified in XML files UDOO7EN User HMI for PA Control Rev 07 Page 5 Subject for technical modifications and errors All configuration files and XML files are compatible for both Windows and Linux versions How To Create Standalone Application It is
3. value 1 gt lt PARAM namez clsid value C5847FCD 8B38 4642 8479 D15174731656 gt UDOO7EN User HMI for PA Control Rev 07 Page 20 Subject for technical modifications and errors Specific parameter of applet is clsid Class identifier of ActiveX control CLSID is reported here Each control gets unique CLSID on designing stage Control gets values of xml parameters as properties see ParamX project for details of realization e foreground as standard property ForeColor e background as standard property BackColor e font as standard property Font e lines as property lines e port as property port e id as property id e stretchable as property stretchable e time as property time e host as property host e station as property station Note It is necessary to register ActiveX controls on machine before using them in HMI application Registration is carried out by special utility regsvr32 exe regsvr32 exe s c activex ParamX ParamX ocx See userhmi bat file where registration done for all examples of controls ActiveX Examples User HMI are provided by ActiveX examples ActiveX controls are shown among other standard HMI applets when user selects soft key 5 Note running of User HMI needs CNC kernel and CNC server user can start standard HMI because examples use communication with kernel Each example is represented as C Microsoft Visual Studio project There are following projects e CPAppletX demonstrates d
4. gt lt id gt 1 1 lt id gt lt cancel gt then communication object axes is deleted inside server Server doesn t request more axes position from CNC kernel because corresponding client s communication object deleted Next diagram shows that communication objects client owned are deleted when socket connection broken So client doesn t need to care about corresponding objects in server All objects will be deleted automatically when client disconnected from server Above information is important only for requests with automatic updating mode UDOO7EN User HMI for PA Control Rev 07 Page 11 Subject for technical modifications and errors host 127 0 0 1 port 62937 client connection task bon ox 10 Client 2 disconnected CNC kernel CNC kernel communication task 11 Object 11 client 2 owned removed from queue and destroyed Communication Between HMI and User Applets When user applet is Java then HMI can t exchange data with applet directly To provide compatible interface between user applets and HMI for all kind of applets ActiveX and Java a communication object lt pool gt is implemented Because each applet as well as HMI has communication with CNC server they can contact each to other through server One applet or HMI can send some information to server by lt pool gt then other clients can get same information from server Server doesn t transfer such
5. necessary to prepare two files ini and cfg by any text editor More details are described in SDOO2EN HMI Setup and Configuration Guide Let to see some files to run Path Graphic Display as standalone aplpication pg ini ini swvisible 0 titte Path Graphic nextinstance 0 cfg pg user icon pa pg on 1 pg cfg main 00000000 pg htm plain 00000001 pgplanexy hmi 00000002 pgplanexz hmi 00000003 pgplanezy hmi 00000004 pgplanexyz hmi 00000005 go zoom hmi 00000006 go screen hmi 00000007 pgsettings hmi 00000008 exit sk5 Zoom 50000001 pgzoomin hmi 50000002 pgzoomout hmi 50000003 pgup hmi 50000004 pgdown hmi 50000005 pgleft hmi 50000006 pgright hmi 50000008 back Sk6 screen 60000002 pgfitin hmi 60000004 pgclear hmi 60000008 back Now we can start new HMI application by command line string hmiframe exe i pg UDOO7EN User HMI for PA Control Rev 07 Page 6 Subject for technical modifications and errors and see Path Graphic display lox Program 1020 executed in seq block made CYCLE ON DURATION 00 00 49 Plane XY POSITION X 00048 928 Plane XZ Y 00245 868 Z 00111 000 Plane ZY A 00000 000 Plane XYZ Zoom R q x ite a bd a by Q cD lt gt N140 GO2 J P32 l os Screen N145 G02 J P32Z N146 G1 Z 5 MSG 40 Settings 7 105 lt 8 F o a Exit o 20 mm How To Add Ne
6. will get all messages from pool including messages of applet A1 to select or deselect SK6 Something like this lt pool gt lt sub gt get lt sub gt lt auto gt yes lt auto gt lt cmd gt userkey activexkey2 selected lt cmd gt lt val gt off lt val gt lt pool gt By this message applet A2 can check state of SK6 If applet A3 is located on other level then unfortunately A3 can t get state of SK6 by getting of instant pool because A3 doesn t exist when A1 is active In this case we must use constant pool To send message to constant pool A1 has to prepare XML string like following lt pool gt lt sub gt set lt sub gt lt cmd gt userkey activexkey2 selected lt cmd gt lt val gt on lt val gt lt c onst gt yes lt const gt lt pool gt Now when A3 will start then it get messages about selection of SK6 by A1 because message is in constant pool A3 can avoid useless messages from pool by filter For example A3 can query pool messages by lt pool gt lt sub gt get lt sub gt lt auto gt yes lt auto gt lt cmd gt userkey activexkey2 selected lt cmd gt lt pool gt Now A3 will get only messages for userkey activexkey2 SK6 concerning selection or deselection of soft key Of course you can use another filters i e by lt id gt of messages Java applet is shown by Microsoft Internet Explorer but not displayed inside HMI User report installed the Sun JDK 1 4 2_02 and Java runtime environment have made a small test Java Apple
7. User HMI for PA Control UDOO7EN User HMI for PA Control Rev 07 Page 1 Subject for technical modifications and errors HISTORY 4 INTRODUCTION 4 REFERENCES 4 User HMI Example 5 CONFIGURATION LEVEL 5 General 5 How To Create Standalone Application 6 How To Add New Soft Key Level in HMI 7 Viewer Types 7 How To Define More Less Then 8 Soft Keys 8 How To Define User Hard Keys 8 Visualization Of PLC Program 8 EXPERT LEVEL 8 General Communication With CNC Server 8 Communication Between HMI and User Applets 12 Java Applets 15 Sun Java vs Microsoft Java Windows version only 15 Java Sources 16 Realization of Command Interface to CNC Server 17 Getting of Data From CNC Server on Request With Automatic Updating Mode 19 How to Build Java Archive 19 Development of ActiveX Controls 20 HMI Standard Applet activex as Container of Control 20 ActiveX Examples 21 DEVELOPMENT USER SPECIFIC OBJECTS APPLETS FUNCTIONS BY QT TOOLKIT 22 OTHERS 22 COMPARISON OF TECHNOLOGIES 24 FAQ 24 How Many Soft Key Levels Are Possible 24 UDOO7EN User HMI for PA Control Rev 07 Page 2 Subject for technical modifications and errors What s Happened With The Focus Control In Windows When Will It Change From HMI To Applets 24 Can Java Applets or ActiveX Access The Soft Keys 25 How Can An OEM Applet Java ActiveX Work With Selected HMI Fonts Colors 25 I search for a possibility to get soft key information in an additional applet 25 Jav
8. a applet is shown by Microsoft Internet Explorer but not displayed inside HMI 26 UDOO7EN User HMI for PA Control Rev 07 Page 3 Subject for technical modifications and errors History Revision Date Comments 01 07 04 2003 Document created 02 12 01 2004 Completely redesigned Supplied by examples for ActiveX and Java technologies 03 17 05 2004 New FAQ I search added 04 02 08 2004 New FAQ Java applet is shown by Microsoft Internet Explorer but not displayed inside HMI added 05 06 10 2004 User hard keys Visualization added 06 17 11 2004 e HMI can overwrite title tool tip and icon of user soft keys when corresponding lt pool gt comes e HMI handle macro command when corresponding lt pool gt comes 07 08 02 2007 New checkForClose method for ActiveX since HMI kernel version 1 24 10 Introduction This is user manual for customizing of Human Machine Interface HMI of CNC HMI is flexible and open application There are two levels of HMI customizing Configuration level Expert level Selection of level depends on user s requirements and experience Configuration level is simplest way of customizing It demonstrates flexibility of HMI By this way user can reconfigure HMI layouts and make own assignments for hard and soft key functions Configuration level is shortly described in current manual Expert level reflects openness of HMI Experienced users are familiar with p
9. aObject data fromXML str Check error by String err data getProperty err if err null amp amp err equals ok data null If error found then return null Other methods public boolean sendCommand String command UDOO7EN User HMI for PA Control Rev 07 Page 18 Subject for technical modifications and errors public String getStringData String command String dataName public int getIntData String command String dataName was implemented to simplify frequently used operations Getting of Data From CNC Server on Request With Automatic Updating Mode TestApplet java example uses lt blocks gt communication object with automatic updating mode to get actual NC blocks Normally client sends similar requests to server but can t wait replay from server in same thread because server will informs client asynchronously when new data will be available from CNC kernel Java socket allows synchronous communication only So socket should be opened in independent thread to provide asynchronous data exchange Implementation of asynchronous socket communication is located in special class DataThread see DataThread java derived from Thread Applet creates asynchronous communication channel in method start see TestApplet java parserThread new DataThread this and calls parserThread resumeConversation to create communication thread Thread creates a socket by socket new Socket component host component po
10. ation object in queue of requests Special communication task handles object in queue Each object waits when CNC information will be available and sends reply to client owner of object If object can t get CNC information now it waits next pass of communication task UDOO7EN User HMI for PA Control Rev 07 Page 10 Subject for technical modifications and errors 5 Server creates object with ID 11 on request of client 2 and puts it in queue host 127 0 0 1 port 62937 client connection task o ox lt axes gt lt sub gt pos lt sub gt lt auto gt yes lt auto gt lt req gt yes lt req gt lt uid gt 1 1 lt uid gt lt axes gt n opvyes lt auto gt lt axes gt lt sub gt pos lt sub gt lt ae Suid gt 11 lt uid gt lt axes n 8 Client 2 gets CNC data axes position CNC kernel 6 Object 11 client 2 owned gets CNC information status OK 7 Object other client owned waits access to CNC 9 Client 1 is still connected to server Client can cancel any own request in any time by command lt cancel gt Normally client doesn t need to add lt uid gt tag in reguest But client can In current example the client 2 uses lt uid gt 11 lt uid gt in request Server marks object axes created on this request by that identifier If client sends new request in same socket lt cancel gt lt req gt yes lt req
11. by easy and powerful way to display state of PLC variables and exchange data between HMI applets and PLC See UDO17EN User Visualization By HMI documentation for details Visualization applets are running in userhmi when second hard key selected Note PLC runtime should be activated and special PLC program from userhmi plc directory loaded Expert Level General Communication With CNC Server One of important thing for understanding of expert level is communication with CNC server When HMI or other clients run they don t operate directly with CNC kernel but through special intermediate server TCP IP Server provides clients by full information about actual CNC state Of course clients can change a state of CNC if required Server has access to CNC data via shared memory UDOO7EN User HMI for PA Control Rev 07 Page 8 Subject for technical modifications and errors New user s applets ActiveX or Java can install independent communication channel to CNC server Open XML protocol is used for data exchange Detail description of protocol is documented in specification SDOO01EN CNC Server TCP Client has to know IP address of server and port to create connection CNC server handles several ports for different functionality main server file server path graphic server etc Main server provides client by general CNC functions Default number of main server port is 62937 Server listens port by internal client connection task th
12. commended to process HMI built in Java applets by original Sun virtual Java machine but not Microsoft Let demonstrate a difference by Hello World example To display simple Hello World applet by MSIE we need helloworld htm file like following lt html gt lt body gt Hello World lt applet code HelloWorld class width 200 height 40 gt lt applet gt lt body gt lt html gt Using of above HTML file as parameter of HMI applet web lt PARAM name file value helloworld htm gt may cause a fault because MSIE ActiveX may process HelloWorld class by Microsoft Java machine UDOO7EN User HMI for PA Control Rev 07 Page 15 Subject for technical modifications and errors To be sure that original Sun Java machine is applied we have to transfer helloworld htm to following lt html gt lt body gt Hello World lt CONVERTED_APPLET gt lt HTML CONVERTER gt lt OBJECT classid clsid 8AD9C840 044E 11D1 B3E9 00805F499D93 codebase http java sun com products plugin autodl jinstall 1_4 windows i586 cab Version 1 4 0 0 WIDTH 200 HEIGHT 40 gt lt PARAM NAME CODE VALUE HelloWorld class gt lt PARAM NAME type VALUE application x java applet version 1 4 gt lt PARAM NAME scriptable VALUE false gt lt COMMENT gt lt EMBED type application x java applet version 1 4 CODE HelloWorld class WIDTH 200 HEIGHT 40 scriptable false pluginspage
13. de at startup lt pool gt lt req gt yes lt req gt lt sub gt get lt sub gt lt pool gt n then applet will get complete information about actual font language station Additionally applet will get messages when user soft and hard keys will be pressed if corresponding HMI mode is specified through ini file Messages lt pool gt from server contains same commands and values which HMI sent HMI interprets following predefined commands from pool if corresponding mode is activated via hmi ini file section Slave e f userkey 1 then HMI will change status of soft key specified in configuration i e hmi cfg file as userkey key_name Here key_name is any name defined by user UDOO7EN User HMI for PA Control Rev 07 Page 13 Subject for technical modifications and errors Any user applet can ask HMI to change status of user soft key To do that an applet has to send corresponding command and value to pool If applet would like to set title of user key it can send userkey key_name title as command tag cmd and title text as value tag val If applet would like to set tool tip of user key it can send userkey key_name tooltip as command tag cmd and tool tip text as value tag val If applet would like to set icon of user key it can send userkey key_name icon as command tag cmd and icon as value tag val Default image file name extension and icon size can be missing in definition of icon If applet would like to di
14. ement name plugin the name of plugin that contains element if empty main plugin used and mainplugin if specified means that only applications with this main plugin will handle this macro command Filters can be applied to reduce communication traffic through CNC server There are two kinds of filters e Identifier e Command Any client can add lt id gt tag in lt pool gt when lt sub gt set lt sub gt is requested That identifier digital number will be associated with command lt cmd gt HMI application will add lt id gt for predefined command if parameter id gt 0 is specified in section master of ini file When client applet or HMI sends a request to get lt pool gt data it can specify identifier filter by same lt id gt tag For example lt sub gt get lt sub gt lt id gt 1 7 10 lt id gt In this case client will get only those saved commands from pool which identifiers was not defined 0 or 1 2 3 4 5 6 7 10 When client sends a request to get lt pool gt data without lt id gt or 0 then client will get all commands from pool Identifier filter for HMI is specified by id parameter in section slave of ini file UDOO7EN User HMI for PA Control Rev 07 Page 14 Subject for technical modifications and errors The similar way is for lt cmd gt filter When client applet or HMI sends a request to get lt pool gt data then client can specify several command templates divided by comma Ser
15. gt 9 lt pos gt lt record gt First request selects data for operation Second request sets pointer at the beginning of file Last request reads 9th record after first record in the file P10 The problem may occur if another client sends similar requests to server in same time but for getting of NC part program As result the first client can get NC block instead of P parameter There is no problem for HMI because HMI doesn t use lt record gt There will be no problem for OEM client if only one client will use lt record gt in time Instead of lt record gt it is recommended to use extended lt file gt communication object with additional parameter lt pos gt Here we can specify list of records which we would like to get from CNC For example server returns only records 1 first 3 4 5 and 100 on request lt file gt lt sub gt par lt sub gt lt pos gt 1 3 5 100 lt pos gt lt name gt 1 lt name gt lt file gt It is guaranteed that other commands lt file gt lt select gt lt record gt will be delayed until current lt file gt is processed TestApplet java displays actual NC blocks Applets gets NC blocks by communication object lt blocks gt with automatic updating mode There are two buttons are located inside applet Buttons are available when test mode is active Applet can start stop NC program processing in test mode by sending single communication object lt mode gt DdeApplet java implements DDE interface to PLC DDE c
16. ialog box to get and set cycle parameter P10 In contrast to Java applet CPApplet the ActiveX control uses extended communication object lt file gt to get only one record from file in safe mode Safe mode guarantees that processing of lt file gt request will lock CNC server for other similar requests Same communication object lt enter gt is used to set value of parameter P10 Control shows also as input focus transferred from HMI frame soft keys status window to ActiveX and back Use Tab key to move a input focus when mouse is not installed In some cases an user must press Tab several times to get input focus in required window e KeyAppletX demonstrates handling of user soft keys by ActiveX Two keys with userkey functions are specified on level of ActiveX examples Because of parameter userkey 1 see master and slave sections of user ini file a User HMI application informs applets via command lt pool gt when corresponding soft key pressed In same manner an applet can send new status title tool tip and icon for user soft key by communication object lt pool gt User HMI will overwrite status title tool tip and icon of key UDOO7EN User HMI for PA Control Rev 07 Page 21 Subject for technical modifications and errors e NCStateX demonstrates consistency of OEM ActiveX control among other HMI standard applets because it gets same parameters font colors etc from frame Note value of border width parameter of applet ha
17. information to CNC Server only saves lt pool gt data into internal buffers to share such information between clients of server There are two buffer in server e Constant buffer e Instant buffer Data is stored in constant buffer when request has lt const gt yes lt const gt tag Information is saved in instant buffer in all other cases Constant buffers data exists all time when server is running Each new client can get complete information from constant buffer when it sends lt pool gt request When new information comes to instant buffer then data UDOO7EN User HMI for PA Control Rev 07 Page 12 Subject for technical modifications and errors can be available for clients which are already active in same time with lt pool gt request Instant buffer is cleared each time after information is broadcasted between active clients Information is stored as identifier command and value Some commands and values are reserved for communication between HMI and user applets see description below Applets can use own commands non reserved and any values for communication HMI sends following information to constant buffer of pool if corresponding mode is activated in section master of ini file i e hmi ini e f level 1 then HMI sends lt cmd gt level lt cmd gt lt val gt XXX lt val gt when actual level changed Here XXX is actual level of HMI decimal format Highest four bits of double word 32 bits represent hard key leve
18. ing of certificate Procedure requires some users information by user Meaningless input is allowed because that is only test example Signing of archive by certificate Development of ActiveX Controls It looks like development of Java applets but it is based on Microsoft ActiveX technology which are available on Windows platform only ActiveX controls can be produced by Visual C Visual Basic etc Most of toolkits by Microsoft are commercial Implementation of ActiveX control on layout view is possible in two ways ActiveX control can be specified on HTML page and shown in active view via HMI applet web or web viewer in same manner as for Java applet Such method is not recommended due to focus problems see FAQ below It is recommended to use standard HMI applet activex to implement an Activex control directly in HMI layout See activex htm source in userhmi xml as example HMI Standard Applet activex as Container of Control Example of xml code for specification of ActiveX control in view by activex HMI applet is shown below lt APPLET code activex left 0 top 10 width 8 height 3 gt lt PARAM namez id value OEM gt lt PARAM namez foreground value FF0000 gt lt PARAM namez title value 1 gt lt PARAM namez titletext value ParamX gt lt PARAM name margin value 0 gt lt PARAM namez border width value 1 gt lt PARAM namez roundness value 0 gt lt PARAM namez stretchable
19. l 0 level of first hard key 1 level of second hard key Next four bits correspond first sublevel of soft keys 1 first soft key 2 second soft key etc e If language 1 then HMI sends lt cmd gt language lt cmd gt lt val gt XX lt val gt when actual language initialized or changed Here XX is actual language identifier en de ru etc e f station 1 then HMI sends lt cmd gt station lt cmd gt lt val gt ncX lt val gt when actual active station initialized or changed Here neX is actual active station nc1 nc2 nc3 etc e f appletfont 1 then HMI sends lt cmd gt font lt cmd gt lt val gt font_namec lt val gt during initialization Here font_name is actual active font as string HMI sends following information to instant buffer of pool if corresponding mode is activated in section master of ini file i e hmi ini e f userkey 1 then HMI sends message to pool lt cmd gt userkey key_name lt cmd gt when soft key with function userkey key_name is pressed Function of soft key is specified by configuration file i e hmi cfg Here key_name is any name defined by user e f softkey 1 then HMI sends message to pool lt cmd gt softkey X lt cmd gt when soft key is pressed Here X is soft key number 1 8 e f hardkey 1 then HMI sends message to pool lt cmd gt hardkey X lt cmd gt when hard key is pressed Here X is hard key number 1 8 So if user applet sends request with automatic updating mo
20. lkit is used for development of standard HMI kernel and plug ins User can order development from PA PA Soft or design new Qt modules himself In last case user needs Qt Toolkit by Trolltech non commercial version is free for Linux and C compiler for example VC for Windows Internal program interface for HMI Qt applets will be specified later by PA Soft Interface to CNC is open and already documented When new applet built it can be integrated into standard HMI without problem Integration is carried out via XML and configuration files Unfortunately such solution might be complicated for user because user needs special knowledge in HMI internal program interface But this way is very powerful Not only applets but other HMI specific object can be designed by this method New objects are united in Dynamic Link Library plug in Additional DLL doesn t influence on other standard HMI plug ins Objects are compatible for Windows and Linux versions on source code level Others UDOO7EN User HMI for PA Control Rev 07 Page 22 Subject for technical modifications and errors It means a development of specific HMI by any other technology which is well known for user It is only requested that programming tool supports socket There aren t other restrictions because communication to NC kernel is carried out by open XML based protocol Note As CNC server provides multiply client connection user specific HMI can run simultaneo
21. mandSocket new Socket HOST PORT Then objects BufferedReader and OutputStreamWriter are connected to in new BufferedReader new InputStreamReader commandSocket getInputStream ASCII out new OutputStreamWriter commandSocket getOutputStream ASCII If error occurs during initialization then socket closed and method returns false It is prohibited to call initCommandinterface into init or start methods of applet class because it may occur security exception in Microsoft Internet Explorer see PRB SecurityExceptionEx Exception Running a Java Applet Q175622 It is recommended in our examples to call initCommandinterface into getDataRequest When applet destroyed it must close command socket by method synchronized protected void closeCommandinterface Note method should be declared as synchronized Main method of command interface public DataObject getData String command returns getting data as DataObject Here command is XML request DataObject derived from Properties Inside of method we process following steps Clear input strem by while in ready in skip 1 Add station to XML request by int n command indexOf gt command command substring 0 n 1 lt st gt parameters getProperty station lt st gt command substring n 1 Send request to socket by out write command n out flush Wait answer by String str in readLine Parser reply by data new Dat
22. ommunication in Java is Microsoft specific technology To get DDE an applet needs special Dynamic Linked Library DDL See Java SDK documentation for details Building of library can be done by Microsoft Visual Studio project plctest dsw located in java dde folder Appropriate header file DDEApplet h is produced during compilation of Java sources see below Note be sure that Project Settings gt C C gt Preprocessor gt Additional include directories for plctest project havy correct path for Java SDK includes C j2sdk1 4 1_05 include C j2sdk1 4 1_05 include win32 MacroApplet java let to select element from list or type it by user and send macro command by lt pool gt communication object Realization of Command Interface to CNC Server Command interface means that communication objects with single updating mode are used to get or set some CNC data or change CNC mode Clients sends request to CNC server waits CNC server s reply in same thread then client can continue See realization of command interface in CPApplet java At first command socket is defined private Socket commandSocket null And two objects BufferedReader and OutputStreamWriter to read data line by line and write requests Initializing of command interface is provides by method UDOO7EN User HMI for PA Control Rev 07 Page 17 Subject for technical modifications and errors protected boolean initCommandinterface In this method a socket is opened by com
23. on page UDOO7EN User HMI for PA Control Rev 07 Page 7 Subject for technical modifications and errors Soft key 3 Textbrowser viewer opens new level where Qt text browser is viewer Viewer shows textbrowser html file Content of this file is specification of structuring tags accepted by text browser Specification was extracted from Qt documentation How To Define More Less Then 8 Soft Keys Example demonstrates 10 soft keys To define 10 keys Specify sknumber 10 in frame ini file Create icons for on and off key statuses sk9off gif sk9on gif sk10off gif sk10on gif Specify additional key codes for new keys in localkeys section of frame ini file softkey9 alt 9 softkey 1 0 alt 0 Use new levels for key definitions in cfg configuration file for example 0000000a exit How To Define User Hard Keys Example demonstrates two user defined hard keys To define user hard keys Define user hard keys in hardkeys section of cfg configuration file hardkeys 00000001 hardkey userkey 1 Applets HMI Java applets and ActiveX controls user 00000002 hardkey userkey2 Vis PLC visualizationguser Here name and tool tip of each user hard key are specified Both keys will use the same icons user user16 gif Define own section for each hard key level There are two sections in cfg configuration file userkey1 for first user hard key and userkey2 for second Visualization Of PLC Program User visualization system provides customer
24. read When new client detected then server creates personal socket Below diagram shows connection of first client connect 1 New client connects to server 2 Connection task opens personal socket for new client CNC kernel CNC kernel communication server task Client sends request to server as XML string terminated by n When server gets message from client then it creates internal communication object corresponding to request If request is specified by client in single updating mode then server doesn t put corresponding communication object in queue of requests Server just gets CNC data and sends reply to client Communication object destroyed immediately after that UDOO7EN User HMI for PA Control Rev 07 Page 9 Subject for technical modifications and errors connect host 127 0 0 1 port 62937 client connection task 3 Next client connects to server lt dir gt lt req gt yes lt req lt sub gt prg lt sub gt lt auto gt no lt auto gt gt lt dir gt n CNC kernel lt dir gt lt sub gt prg lt sub gt lt auto gt no lt aute lt dir gt n CNC kernel communication server task 4 Client sends request with single updating mode and gets reply Communication object destroyed immediately after reply If request is specified by client in automatic updating mode then server puts corresponding communic
25. rogramming can customize HMI on this level Level is recommended when there are no more possibility to solve user s requirements via reconfiguration of HMI Detailed description of HMI customizing on expert level is subject of current manual Only HMI 1 18 1 and later supports all features Java and ActiveX sections of documentation is applied for Windows version only References Manual refers to following documents SDOO1EN CNC Server TCP SD002EN HMI Setup and Configuration Guide UDO17EN User Visualization By HMI UDOO7EN User HMI for PA Control Rev 07 Page 4 Subject for technical modifications and errors User HMI Example Standard HMI distributive may include examples Please contact to manufacturer to get examples All examples included source code are located in userhmi folder Examples are applied to Windows HMI version 1 16 and higher Structure of folder e activex Microsoft Visual Studio C projects for ActiveX controls cfg additional specific configuration files to run User HMI application images additional images doc documentation j2sdk original Java SDK downloaded from java sun com java Java applets java dde Microsoft Visual Studio C project to build Java DDE library Library provides DDE interface for Java applets e plc PLC program project for Visualization e xml additional specific xml files to run User HMI application Run prepare bat to prepare User HMI application
26. rt See run method in DataThread java Then thread gets XML requests from applet String dataRequest component getDataRequest And transfers requests to server via socket for int i 0 i lt dataRequest length i writeLine dataRequest i Thread waits data from server in loop str in readLine Parsers getting XML strings DataObject data new DataObject data fromXML str Finally it sends results to applet component dataReady data How to Build Java Archive User HMI application uses Java applets from archive user jar Java sources to build archive are located in java folder User can rebuild archive by following steps e Download Java SDK _ j2sdk 1_4 1 _05 windows i586 exec or higher from java sun com UDOO7EN User HMI for PA Control Rev 07 Page 19 Subject for technical modifications and errors Install Java in folder C j2sdk1 4 1_05 If installation done into other folder or new version of SDK is used then JDIR environment variable should be changed on new path see java build bat Run java build bat Next actions are carried out by java build bat see SDK documentation for details Compiling of all java files Building of header file DDEApplet h to create additional library plctest dll Above library provides Java applet by DDE interface Windows only specific Copying of header file to java dde folder Building of user jar archive included all applets Creating of store and key Creat
27. sable user key it can send userkey key_name enabled as command tag cmd and off as value tag val If applet would like to enable user key it can send userkey key_name enabled as command tag cmd and on as value tag val If applet would like to select user key it can send userkey key_name selected as command tag cmd and on as value tag val If applet would like to switch user key in normal state it can send userkey key_name selected as command tag cmd and off as value tag val e Applet can set value of user data object Value of data object may be used in configuration file for specification of view on corresponding level see SDOO2ZEN HMI Setup and Configuration Guide Client can sends message to pool lt cmd gt userdata data_name lt cmd gt lt val gt XXX lt val gt Here data_name is any name defined by user and XXX is value to be set for data object by HMI e f refresh 1 then HMI will refresh actual view specified in configuration i e hmi cfg when client sends lt cmd gt refresh lt cmd gt So client can change value of user data object and sends refresh to HMI then layout of applets on current level may be reloaded if views depends on user data object NOTE THIS FUNCTION IS OBSOLET USE lt cmd gt macro lt cmd gt lt vals gt refresh lt val gt instead e f macro 1 then HMI will execute macro command that will be send with lt cmd gt macro lt cmd gt lt val gt element plugin mainplugin lt val here element is the el
28. sfers HMI system information to ActiveX control Font background and foreground colors see specification of applet parameters in SDOO2EN HMI Setup and Configuration Guide are transferred to ActiveX control via standard properties Font BackColor ForeColor To get other applet s parameters lines stretchable host port time station id an ActiveX control must implement properties with same name e Java applets and ActiveX controls in browser can get font language by lt pool gt communication object search for a possibility to get soft key information in an additional applet Applets can operate only with SKs assigned as userkey in configuration file see user cfg from userhmi example Let applet Atoperates with SK6 50000006 userkey activexkey2 When A1 wants to select softkey it sends usually messages to instant pool lt pool gt lt sub gt set lt sub gt lt cmd gt userkey activexkey2 selected lt cmd gt lt val gt on lt val gt lt pool gt When A1 wants to make softkey as normal it sends usually lt pool gt lt sub gt set lt sub gt lt cmd gt userkey activexkey2 selected lt cmd gt lt val gt off lt val gt lt pool gt For example applet A2 is located on same level Applet can issue lt pool gt lt sub gt get lt sub gt lt auto gt yes lt auto gt lt pool gt UDOO7EN User HMI for PA Control Rev 07 Page 25 Subject for technical modifications and errors on initialising phase Then applet A2
29. t It s made by JDK 1 4 2 02 can see it in Internet Explorer 6 0 but can t see it in HMI Solution Possible reason is that HMI applet web uses Microsoft virtual Java machine instead of original Sun JVM to process Java applet See Sun Java vs Microsoft Java for details UDOO7EN User HMI for PA Control Rev 07 Page 26 Subject for technical modifications and errors
30. us problems with Java applets It depended on versions of Microsoft IE and Java VM Java applet can get input focus when it becomes visible in layout but it can t transfer focus back to HMI by keyboard Tab Handling of hard and soft keys are locked in that case There is no problems with mouse operation UDOO7EN User HMI for PA Control Rev 07 Page 24 Subject for technical modifications and errors Using activex Qt applet solves focus problems for Windows based control New applet is container of ActiveX control Now if ActiveX control needs input focus then it can get focus in HMI in usual manner by Tab There is no more problem to switch input focus between HMI applets status window and so on and integrated ActiveX controls on current level Can Java Applets or ActiveX Access The Soft Keys Applet ActiveX or Java can get events when hard and soft key pressed possibility is specified by ini file One of ActivX example shows how to get event when soft key pressed and set soft key status and text Communication object lt pool gt is used to exchange information between HMI and applets If applet needs operator input not SK or Hk it has to get input focus by mouse or Tab How Can An OEM Applet Java ActiveX Work With Selected HMI Fonts Colors There are two possibility to transfer information to ActiveX controls and only one way for Java e When applet activex is created becomes visible on actual HMI level it tran
31. usly with standard HMI UDOO7EN User HMI for PA Control Rev 07 Page 23 Subject for technical modifications and errors Comparison of Technologies Method Functionality Project time Complexity Development OS toolkit compatibility Configuration of Inside Short Low No additional Windows standard HMI standard HMI toolkit Linux functionality Development new High Middle High Qt Toolkit C Windows j Support b compiler Linux el ce PA PA Soft commercial for needed Windows Using of Java Middle Middle Middle Free Java Windows applets inside HMI Using of Java Middle Long High for Free Java Windows applets on DHTML complicated Linux application pages for browsers without HMI frame Using of Activex Middle Middle Middle Commercial Windows controls inside HMI VC Using of ActiveX Middle Long High for Free Java Windows controls on DHTML complicated pages for browsers application without HMI frame Other user High Long High Depends on Windows programming user technology Linux technology based on open CNC server interface FAQ How Many Soft Key Levels Are Possible Maximum 7 levels can be configured directly Using of complicated functions i e Editor of machine parameters into HMI so called built in application allows to get unlimited number of levels indirectly What s Happened With The Focus Control In Windows When Will It Change From HMI To Applets User can see foc
32. ve been set to 2 see activex htm Control is shown in right upper corner of layout NCStateX uses communication object lt info gt to get state of NC kernel Standard HMI applet ncstate uses lt ncda gt lt var gt status lt var gt lt ncda gt request Using of lt info gt gives more possibilities to display right state of CNC kernel i e problem with Drive ON missing display e ParamX demonstrates how ActiveX control gets HMI settings via properties Additionally the control demonstrates communication procedure with HMI kernel when ActiveX is closed If views permanent property is off lt BODY permanent 0 then HMI kernel deletes all applets from actual view when view has to be changed i e HMI level changed Even view s permanent property is on lt BODY permanent 1 and applets stay in memory when view has to be changed nevertheless HMI kernel deletes all applets when HMI application closed During closing procedure a HMI kernel calls special method BOOL checkForClose for Qt applets and ActiveX controls When checkForClose method returns TRUE then HMI may close ActiveX When checkForClose method returns FALSE then HMI breaks closing procedure See activex ParamX ParamXCtl cpp for details Development User Specific Objects Applets Functions by Qt Toolkit When user requires applets and functions for specific technology new components can be developed by Qt Toolkit http www trolltech com The same too
33. ver will inform client by only those commands which contains one of templates from the beginning If command filter is empty then all commands will be sent to client For example if client specified lt sub gt get lt sub gt lt cmd gt userkey lt cmd gt as filter then server will sends following commands from pool e userkey mykey1 e userkey mykey2 But client will never get information about level language from pool If client would like to get all commands from pool it has to omit lt cmd gt s filter in request Both filters lt id gt and lt cmd gt are acceptable in one request Java Applets User can develop Java applet and put it in viewer on any level Java applets can be shown by web viewer or by web applet among other Qt applets in plain viewer User HMI example demonstrate Java applets when soft key 4 Java applets selected Layout of Java applets on corresponding level is specified by java htm file Java applets are shown inside HMI standard web applets Specification of Java applet is provided by two steps e Applet web gets name of HTML file to be shown in browser by parameter like lt PARAM name file value ddeapplet htm gt e File ddeapplet htm contains specification of Java class DDEApplet class from Java archive see HTML documentation for details Sun Java vs Microsoft Java Windows version only Due to known opposition between Sun and Microsoft in Java technology it is re
34. w Soft Key Level in HMI New soft key level can be added manually via configuration file Details are described in SD002EN HMI Setup and Configuration Guide User HMI example demonstrates how to add new levels Maximum 7 levels can be configured directly Using of complicated functions i e Editor of machine parameters into HMI allows to get unlimited number of levels indirectly Note e HMI reports current level to PLC Only seven upper levels can be recognized by PLC High four bits of double word 32 bits represent hard key level 0 level of first hard key 1 level of second hard key Next four bits correspond first sublevel of soft keys 1 first soft key 2 second soft key etc e HMI master reports current level to user applets Java ActiveX by communication object lt pool gt in similar manner Viewer Types Various types of viewers are demonstrated in User example see How To Add New Soft Key Level in HMI Soft key 1 Plain viewer opens new level where Qt applets are shown One of Qt applet top left is Microsoft Internet Explorer Windows The applet web shows web page because that is specified by lt PARAM name url value www trolltech com gt It is possible to specify file path for web applet if file is used instead of url Soft key 2 Web viewer opens new level where Microsoft Internet Explorer is viewer Viewer shows web html file Animated picture is shown

Download Pdf Manuals

image

Related Search

Related Contents

SRS-BTS50  XLED 3019 - PR Lighting  dfine manual.indd  User Manual EN  LCD Portable Metal Detector With In Built Speaker User Manual  SOFT-STARTER Arrancador Suave, Chave de Partida Soft  Philips Genie Stick energy saving bulb 872790082731601  LMI-6000 LED Illuminator  Banana PI user manual  Image Processing Activities for High School and  

Copyright © All rights reserved.
Failed to retrieve file