Advantech UbiQ Скачать руководство пользователя страница 14

UbiQ Scenario Manager User Manual

8

2.1

Quick Start to UbiQ-230 platform

As a quick introduction to using UbiQ-230 platform, complete the following procedure
to run UbiQ-230 and scenario utility that was copied to your computer°Øs hard disk
drive during the software installation.

1.

Power on the 

UbiQ-230

 , plug-in RJ45 ethernet connector to it and be sure that 

UbiQ-230 is on the local network.

2.

Make sure that your computer is on local network.

3.

Launch the UbiQ 

scenario utility

.

4.

Click on the menu item ”

Seek thru Intranet

” key and the UbiQ devices on your 

local network will be probed and linked automatically.

5.

Select the UbiQ device, the 

UbiQ information

 will be displayed. This window 

includes five pages: 

Information, Control, Explorer, Scenario, and Debug

.

6.

Select the 

Information

 page, modify your UbiQ-230 name, IP address or DHCP 

enabled. Then click the Set button. Now the UbiQ-230 will save your setting val-
ues.

7.

See the next sessions to learn how to control the UbiQ-230.

The build-in functions shipped with UbiQ-230 can help you to accomplish some basic
controlling scheme. You can also code your own functions in Controller menu to
enhance the control over such controllers, which will be described in Chapter 4, “

Bas-

cics of Smart-C Script Language

” and Chapter 5, “

Functions Reference

”. The control

program is a collection of functions to perform specific controlling strategy toward
each I/O. Before using the newly designed functions, the CGI Syntax check is pro-
vided for syntax verification. Those functions are linked and called within the most
popular programming language - C. For easier implementations, a C interpreter envi-
ronment is provided. In this way, users can change properties according to their
needs. From small applications interfacing only a few lines of codes, through full-
scale industrial control systems running many I/O Devices simultaneously, UbiQ-230
provide you with the quickest and most efficient HMI solutions.

The following sections overview the basic functions for developing your solutions with
UbiQ-230.

Содержание UbiQ

Страница 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...

Страница 2: ...trial environments Whether your new Advantech equipment is destined for the labo ratory or the factory floor you can be assured that your product will provide the reliability and ease of operation for...

Страница 3: ...mation applications in the Windows XP and Windows CE environment UbiQ Scenario Manager software provides an windows based mouse driven system for designing Web Enabled Graphic Interactive System Organ...

Страница 4: ...UbiQ Scenario Manager User Manual iv...

Страница 5: ...f Connected UbiQ 11 2 4 Control of Connected UbiQ 12 2 5 Explorer of Connected UbiQ 13 2 6 Scenarios of Connected UbiQ 16 2 7 Lighting of Connected UbiQ 23 2 8 Controller Manager 26 2 9 Function Manag...

Страница 6: ...ftoa 65 5 2 10 GetScenarioReg 65 5 2 11 GetFileFromHttp 66 5 2 12 getenv 66 5 2 13 HelpWindow 67 5 2 14 itoa 67 5 2 15 LoadBMP 68 5 2 16 LoadBMPByValue 69 5 2 17 OpenPort 69 5 2 18 open 70 5 2 19 Play...

Страница 7: ...Chapter 1 1 Introduction...

Страница 8: ...terpreter to strengthen the ability to design complex calculation or analysis The UbiQ 230 kernel is a multi threaded engine for optimal performance It provides you plug and play connectivity with you...

Страница 9: ...tall any thing in the UbiQ product UbiQ Remote Scenario utility is the client for configuring and controlling UbiQ devices remotely you must install it into a PC system 1 3 1 PC System Requirements OS...

Страница 10: ...default location is C Program Files Advantech UbiQ 230 Scenario manager Figure 1 2 Choose Destination Location Screen 4 The installation program will create program shortcuts on your Windows Start me...

Страница 11: ...UbiQ Scenario Manager 1 Select Settings Control Panel from the Windows Start menu and then double click the the Add Remove Programs icon 2 Select the item UbiQ Scenario Manager utility and then click...

Страница 12: ...e ports If data of the connected devices are periodic you could put the controlling pro grams on UbiQ device to collect these data You also could get these data or control these devices by Internet Br...

Страница 13: ...Chapter 2 2 Getting Started...

Страница 14: ...See the next sessions to learn how to control the UbiQ 230 The build in functions shipped with UbiQ 230 can help you to accomplish some basic controlling scheme You can also code your own functions i...

Страница 15: ...ort Search the UbiQ device on the host serial port The port setting is defined on Property Window Seek thru Internet Search the UbiQ device on the internet Users need to specify the IP address for the...

Страница 16: ...UbiQ Scenario Manager User Manual 10 For example there are 2 UbiQ devices on the local network and select Seek thru Intranet item Then the UbiQ devices will be added to the list...

Страница 17: ...e LAN If DHCP Enabled is set to off then the items of IP parameters can be edited by users Set button notify the modified messages to UbiQ device Get Time button get the current time of UbiQ device Se...

Страница 18: ...y mouse input Get Screen button Get the current screen from the UbiQ device Start Mouse Access button Control the UbiQ device remotely by this page All mouse move or clicks will pass to UbiQ device wh...

Страница 19: ...Access button Stop to control the UbiQ device remotely 2 5 Explorer of Connected UbiQ The Explorer Page enables you to access file system of the UbiQ device remotely When you move the cursor on the f...

Страница 20: ...ou want to save This function is just copy a file from UbiQ device to your PC side Add From menu item Select this item and a dialog will be prompt on screen Choose the folder and a file you want to ad...

Страница 21: ...ed New Folder menu item Select this item and a dialog will be prompt on the screen Input the new folder name you want to create and press OK button to confirm or Can cel button to disable this action...

Страница 22: ...ling codes for relative connected controllers We provide a sample for your reference Please move the mouse cursor to the Scenario area and press right button A popup menu will be prompt Load from UbiQ...

Страница 23: ...ion script Display interface is defined by UI script Scenario Layout is the root node for scenario configuration It has several scripts and seven sub button needed to be configured UI Script page is u...

Страница 24: ...Scenario Manager User Manual 18 IDLE Script page is used to execute some actions while idle mode timer is active INIT Script page is used to execute some actions while scenario configuration file is r...

Страница 25: ...o Menu Button radio checkbox Click this checkbox and button style will be changed to MENU button MENU button means that it has child buttons for menu scenario or action buttons For example we define b...

Страница 26: ...enario configuration behaviors Action Button radio checkbox Click this checkbox and button style will be changed to Action button Action button means that it is real button for some actions There are...

Страница 27: ...o parent button node The user interface UI script of parent button will be executed GOTO TOP Action Change the control flow to root button node The user interface UI script of root button will be exec...

Страница 28: ...r net Browser Button Memos edit list Input the memo text for this button Action Script page is used to access I O with scripts In Script area you could press the right button of mouse and a popup menu...

Страница 29: ...mers and DO control lers connected with UbiQ device The page is shown as follows There are 3 RS485 ID specified 1 Dimmer 1 ID Specified the value and is stored to the global variable g_nRS485ID 2 Dimm...

Страница 30: ...ows Input the scenario description and the table for dimmer 1 dimmer2 and DO control lers Press OK to confirm the modification or press Cancel button to cancel the input The added scenario item will b...

Страница 31: ...be a preceding item above the selected item on the tree view To modify the item you could double click the mouse left button Save to UbiQ button Click the button then the Scenario Lighting file will b...

Страница 32: ...8 Controller Manager The controller manager enables the user adding and modifying connected controller I O access functions Move mouse cursor to the Controller Manager area and press right button of...

Страница 33: ...hen a dialog window will be shown on the screen Input the new controller name vendor name and description on the edit fields and then press OK button to confirm or press Cancel button to cancel Edit m...

Страница 34: ...ease select one UbiQ device and press right button of mouse then a popup menu is prompt Save Controllers Data to this Ubiq menu item Select this item then the con trollers data will be transferred to...

Страница 35: ...me Return Type combo box Choose one return type of function The list of func tion type are the following void The function returns none char The function returns a character int The function returns a...

Страница 36: ...current function will be deleted from the function list Move the mouse cursor to function editor and press right button of mouse then a popup menu will be prompt Syntax Check menu item Select this men...

Страница 37: ...Chapter 3 3 Tutorials...

Страница 38: ...at ing controllers data with your CGI scripts 3 2 Define your user interface on UbiQ 230 The product UbiQ 230 is defined as a scenario controller So the user interface on the first level should be sce...

Страница 39: ...33 UbiQ Scenario Manager User Manual Chapter 3 Tutorials For each scenario mode we could define 2 pictures to show One is normal and the other is selected...

Страница 40: ...eed the more item to indicate more pages on the following In the UI Script of Scenario Layout node we define UI as follows LoadBMP 0 0 0 240 64 main goodmorning jpg LoadBMP 1 0 64 240 64 main video jp...

Страница 41: ...g jpg LoadBMP 3 0 192 240 64 main studying jpg LoadBMP 4 0 256 240 64 main more1 jpg After we defined the UI for first level we should think what the second user interfaces are What number circuits of...

Страница 42: ...int nC int nI g_ConfigPage 2 PlaySound windows default wav nDIB 0 nC 0 LoadBMP nDIB 0 0 240 320 level2 level2 jpg nDIB nDIB 1 LoadBMP nDIB 0 230 216 20 level2 help jpg nDIB nDIB 1 HelpWindow 10 232 20...

Страница 43: ...number 7_on bmp nDIB nDIB 1 LoadBMP nDIB 193 210 14 14 level2 number 8_on bmp nDIB nDIB 1 nV GetScenarioReg nC 0 LoadBMPByValue nDIB 4 250 52 65 level2 icons curtain nV nC nC 1 nDIB nDIB 1 nV GetScena...

Страница 44: ...evel2 left bmp nDIB nDIB 1 3 3 Web enabled UI Access There is one default home page present while you connect UbiQ 230 by Internet Browser UbiQ 230 device provides three modes to be accessed by remote...

Страница 45: ...39 UbiQ Scenario Manager User Manual Chapter 3 Tutorials Text Mode will display all scenarios with text in the IE window Screen Mode will show graphic display of UbiQ 230 in the IE window...

Страница 46: ...UbiQ Scenario Manager User Manual 40 Configuration Mode will show graphic display of UbiQ 230 and allow user adjusting the values of each circuit and DO signals...

Страница 47: ...Chapter 4 4 Basic of Smart C Script Language...

Страница 48: ...section are examples of tokens Punctuation characters such as brackets braces parentheses and commas are also tokens 4 1 2 Comments A comment is a sequence of characters beginning with a forward slash...

Страница 49: ...ntax constant floating point constant integer constant character constant Constants are characterized by having a value and a type 4 1 5 Hex decimal Integer Constant Syntax Hex decimal constant 0xHex...

Страница 50: ...main to have parameters The term parameter or formal parameter refers to the identifier that receives a value passed to a function When one function calls another the called function receives values f...

Страница 51: ...specifiers and declarators In the general form of a variable declaration type specifier gives the data type of the variable The declarator gives the name of the variable possibly modified to declare...

Страница 52: ...Relational operators Bitwise operators Logical operators Bit Shift operators The conditional expression operator has lower precedence than binary expressions and differs from them in being right asso...

Страница 53: ...to left or from left to right The direction of evaluation does not affect the results of expressions that include more than one multiplication addition or binary bitwise operator at the same level St...

Страница 54: ...ample illustrates a compound statement if i 0 line i x x x 1 i i 1 In this example if i is greater than 0 all statements inside the compound statement are executed in order break statement The break s...

Страница 55: ...pical use of the continue statement is to return to the start of a loop from within a deeply nested loop Syntax continue statement continue The next iteration of a for or while statement is determined...

Страница 56: ...es until an optional condition becomes false You can use optional expressions within the for statement to initialize and change values during the for statement s execution Syntax for statement for ini...

Страница 57: ...the body of one or neither of the if statements is executed Then i is incremented and tested against MAX the statement body is executed repeatedly as long as i is less than MAX if statement The if st...

Страница 58: ...e return value of the function is undefined The expression if present is converted to the type returned by the function If the function was declared with return type void a return statement containing...

Страница 59: ...f the statement is executed and the process is repeated beginning at step 1 The while statement can also terminate when a break or return within the statement body is executed Use the continue stateme...

Страница 60: ...nclude type specifier the return type int is assumed The return type given in the function definition must match the return type in declara tions of the function elsewhere in the program A function re...

Страница 61: ...to the prototype s corresponding parame ter If they do not match either a conversion is performed or a diagnostic message is issued The number of expressions in expression list must match the number...

Страница 62: ...UbiQ Scenario Manager User Manual 56...

Страница 63: ...Chapter 5 5 Functions Reference...

Страница 64: ...your programs g_fVar1 Global variable its type is double initialized to 0 can be used in your programs g_fVar2 Global variable its type is double initialized to 0 can be used in your programs g_sVar1...

Страница 65: ...opy a file to another file Name Description OpenPort Open the specified COM port sendComData Send data to the specified COM port Name Description strlen Return the length of a string strcpy Copy a str...

Страница 66: ...the notified text on screen HelpWindow Assign the help caption to the specified coordinate on screen SetupTime Display and provide the interface to setup the time on screen Name Description GetScenar...

Страница 67: ...s char 20 double fValue setdebug TRUE pChar 23 4567 fValue atof pChar debug atof pChar fValue It will show atof 23 4567 23 4567 See Also itoa ftoa atoi atoh 5 2 2 atoh Syntax int atoh char pDest or in...

Страница 68: ...0 declare pDest as char 20 int nI setdebug TRUE pChar 2310 nI atoi pChar debug atoi pChar nI It will show atoi 2310 2310 See Also itoa ftoa atof atoh 5 2 4 close Syntax void close int hFile Parameters...

Страница 69: ...e debug window more variant variables to be shown Description This function will show the values of the argument in the debug window if the mode of the debug is TRUE Comments The arguments are variant...

Страница 70: ...hFile data while eof hFile readln hFile data close hFile close the file See Also open close read write seek readln writeln filecopy 5 2 8 filecopy Syntax int filcopy char pSrc char pDest or int filco...

Страница 71: ...pDest as char 20 dobuble fValue int nLen setdebug TRUE fValue 23 4567 nLen ftoa fValue pDest 3 debug ftoa fValue pDest 3 pDest It will show ftoa 23 4567 pDest 3 23 457 See Also itoa atoi atof atoh 5 2...

Страница 72: ...p string sDestFile sHttp http taiwan advantech com tw unzipfunc Unzip EH 7105_ds pdf sDestFile EH7105 pdf GetFileFromHttp sHttp sDestFile See Also none 5 2 12 getenv Syntax string getenv char pEnv or...

Страница 73: ...ple HelpWindow 10 238 200 17 See Also LoadBMP LoadBMPByValue ShowText 5 2 14 itoa Syntax int itoa int nValue char pDest int nBase Parameters nValue the value will be converted pDest Specifies the Dest...

Страница 74: ...Specifies the height of display area sFilename Specifies the bitmap filename This file needs to be a bitmap or jpeg file format If the filename is beginning with then the file will be search from root...

Страница 75: ...e is equal to LIGHT_BAR2 then the screen will show the default pictures for lighting control nValue Specifies the value associated with sFilename Description This function will put the specified bitma...

Страница 76: ...e and prepares the file for reading or writing as specified by open_flag Example int hFile hFile open flash storage template txt FILE_CREATE_RW setdebug TRUE if hFile 0 debug Open file failed else clo...

Страница 77: ...ts follow the format string the for mat string must contain specifications that determine the output format for the arguments Comments Format specifications always begin with a percent sign and are re...

Страница 78: ...double Signed value having the form dddd dddd where dddd is one or more decimal digits The number of digits before the decimal point depends on the magnitude of the number and the number of digits aft...

Страница 79: ...e the width specification the precision specification can cause either truncation of the output value or rounding of a floating point value If precision is specified as 0 and the value to be converted...

Страница 80: ...period appears without a number following it no decimal point is printed f The precision value specifies the number of digits after the decimal point If a decimal point appears at least one digit appe...

Страница 81: ...ess than nCount if there are fewer than count bytes left in the file If the function tries to read at end of file it returns 0 If the handle is invalid or the file is not open for reading or the file...

Страница 82: ...e each carriage return Clinefeed CR LF pair or single linefeed character is replaced with a Null ended character If the function tries to read at end of file it returns 0 If the handle is invalid or t...

Страница 83: ...ample int hFile int nLen char data 512 hFile open flash storage template txt FILE_CREATE_RW setdebug TRUE if hFile 0 debug Open file failed else process the file seek SEEK_END 0 data This is a test fi...

Страница 84: ...fer address nReadLen Specifies the length of receiving data nTimeout Specifies the timeout of receiving data Description This function sends the data to the COM nPort and waits until return data is re...

Страница 85: ...disabled Example The example will show the pChar and f1 in the debug window char pChar 20 declare pChar as char 20 double f1 declare f1 as double f1 2 789 pChar The value of f1 is setdebug TRUE debug...

Страница 86: ...ng sMsg sMsg Please check the input pin is OK or not ShowText 1 0 0 0 sMsg See Also HelpWindow LoadBMP LoadBMPByValue 5 2 28 Sleep Syntax void Sleep int nMilliseconds Parameters nMilliseconds Specifie...

Страница 87: ...a series of characters and values in buffer Each argument if any is converted and output according to the corre sponding format specification in format The format consists of ordinary charac ters and...

Страница 88: ...from source string to destination array Description This function return the actually length from source string to destination array Example The example will show the pChar and f1 in the debug window...

Страница 89: ...mple The example will show the pChar and f1 in the debug window char pChar 20 declare pChar as char 20 string aStr declare aStr as string aStr String pChar pChar setdebug TRUE debug strlen aStr strlen...

Страница 90: ...aining on the disk is less than the size of the buffer the function is trying to write to the disk write fails and does not flush any of the buffer s contents to the disk A return value of 1 indicates...

Страница 91: ...This function writes the buf data plus an end of line marker carriage return linefeed to the file If the han dle is invalid or the file is not open for writing or the file is locked the function retur...

Страница 92: ...tions are subject to change without notice No part of this publication may be reproduced in any form or by any means electronic photocopying recording or otherwise without prior written permis sion of...

Отзывы: