Advantech UbiQ User Manual
Advantech UbiQ User Manual

Advantech UbiQ User Manual

Scenario manager

Advertisement

Quick Links

User Manual
UbiQ
Scenario Manager
User Manual V1.03

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the UbiQ and is the answer not in the manual?

Questions and answers

Summary of Contents for Advantech UbiQ

  • Page 1 User Manual UbiQ Scenario Manager User Manual V1.03...
  • Page 2 Advantech has come to be known. Your satisfaction is our primary concern. Here is a guide to Advantech’s cus- tomer services.
  • Page 3 Advantech Corporation shall not be held liable for errors in this manual or for incidental or consequential damages in connec- tion with the use of this manual or its contents. Advantech Corporation reserves the right to revise this manual at any time without prior notice.
  • Page 4 UbiQ Scenario Manager User Manual...
  • Page 5: Table Of Contents

    Installation ....................3 1.3.1 PC System Requirements............. 3 1.3.2 Installing UbiQ Scenario Manager Utility ........3 Figure 1.1 UbiQ Scenario Manager Installation Welcome Screen ................ 4 Figure 1.2 Choose Destination Location Screen ......4 Figure 1.3 Select Program Folder Screen ........5 Figure 1.4 Setup Complete Screen ..........
  • Page 6 5.2.25 setdebug ..................79 5.2.26 SetupTime .................. 79 5.2.27 ShowText..................80 5.2.28 Sleep................... 80 5.2.29 sprintf ..................81 5.2.30 strcpy ..................82 5.2.31 strlen ................... 83 5.2.32 time ..................... 83 5.2.33 write .................... 84 5.2.34 writeln ..................85 UbiQ Scenario Manager User Manual...
  • Page 7: Chapter 1 Introduction

    Chapter Introduction...
  • Page 8: Overviews

    You can also modify each controller’s network con- figurations and port specifications via UbiQ Scenario Manager utility which runs on any control units. In addition to be easy to use, UbiQ-230 is built-in C interpreter to strengthen the ability to design complex calculation or analysis.
  • Page 9: Installation

    UbiQ and test them by the UbiQ Scenario Manager utility. Installation Web server and C script engine is built-in on UbiQ platform. So you don’t install 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.
  • Page 10 Figure 1.1 UbiQ Scenario Manager Installation Welcome Screen Select a location where you want to install the UbiQ Scenario Manager utility in the Choose Destination Location window. The default location is: C:\Program Files\Advantech\UbiQ-230 Scenario manager Figure 1.2 Choose Destination Location Screen The installation program will create program shortcuts on your Windows Start menu so that you can easily launch the program.
  • Page 11 Figure 1.3 Select Program Folder Screen UbiQ Scenario Manager utility is now installed on the computer; you can start using the program. Figure 1.4 Setup Complete Screen Uninstalling UbiQ Scenario Manager Select Settings | Control Panel from the Windows Start menu and then double- click the the Add/Remove Programs icon.
  • Page 12: Start Menu Shortcuts

    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 Browser anywhere anytime. Via CGI programs, you even setup connected devices to control their behaviors remotely.
  • Page 13: Chapter 2 Getting Started

    Chapter Getting Started...
  • Page 14: Quick Start To Ubiq-230 Platform

    UbiQ-230 and scenario utility that was copied to your computer°Øs hard disk drive during the software installation. Power on the UbiQ-230 , plug-in RJ45 ethernet connector to it and be sure that UbiQ-230 is on the local network.
  • Page 15: Seek Ubiq-230 Devices

    UDP packet to get the UbiQ device’s response on the net- work. “Seek thru COM Port” : 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 UbiQ devices.
  • Page 16 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. UbiQ Scenario Manager User Manual...
  • Page 17: Information Of Connected Ubiq

    Information of Connected UbiQ Click one item of Connected Ubiq Platform, and the information of the UbiQ device will be shown on the window: “Device Name” field can be edited for the name of UbiQ device. “DHCP Enablde” checkbox is switch on/off for DCHCP server exist or not on the LAN.
  • Page 18: Control Of Connected Ubiq

    “Start Mouse Access” button : Control the UbiQ device remotely by this page. All mouse move or clicks will pass to UbiQ device when the mouse location is on the display area. When the function is enabled, the caption of the button will be changed to “Stop Mouse Access”.
  • Page 19: Explorer Of Connected Ubiq

    “Stop Mouse Access” button : Stop to control the UbiQ device remotely. 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 file view window and press the right-button of...
  • Page 20 “Add From...” menu item: Select this item and a dialog will be prompt on screen: Choose the folder and a file you want to add to UbiQ device. This function is just copy a file from PC side to UbiQ device.
  • Page 21 Input the new file name you want to rename and press OK button to confirm or Can- cel button to disable this action. “Delete” menu item: Select this item and this file on UbiQ device will be deleted. “New Folder...” menu item: Select this item and a dialog will be prompt on the...
  • Page 22: Scenarios Of Connected Ubiq

    UbiQ device program if you choose the wrong file to upgrade. Scenarios of Connected UbiQ The Scenario page will let you configure the user interface and control flow to UbiQ device. You need to prepare the bitmaps for display and write the controlling codes for relative connected controllers.
  • Page 23 On the scenario configuration area, there are two basic elements needed to explain: one is button and the other is script. There are seven buttons physically on the UbiQ- 230, so we need to define display interface and control flow after press these buttons.
  • Page 24 “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 reset. UbiQ Scenario Manager User Manual...
  • Page 25 For example, we define button 5 as Menu button, so button 5 still has the “Button Setting” sub-node to define user inter- face and control flow for its child button nodes. UbiQ Scenario Manager User Manual...
  • Page 26 “DOWN Action”: Decease one degree if the current item is numeral (i.e., the maximum is bigger than 1) or set to OFF flag if the current is switch (i.e., the maximum is equal 1). Use only on Configuration mode. UbiQ Scenario Manager User Manual...
  • Page 27 Configuration mode. “SETUPTIME Action”: Change the control flow to the Setup Clock display. In this display, you can modify current date and time on UbiQ device. “IP CAM Action” : Change the control flow to the IP CAM display. You should specify the picture file from IP CAM on °×UI script°±.
  • Page 28 “Button Hint” edit field: Input the help message for this button. It will be shown with a item on homepage in Text mode when user views UbiQ device with Inter- net Browser. “Button Memos” edit list: Input the memo text for this button.
  • Page 29: Lighting Of Connected Ubiq

    Lighting of Connected UbiQ The Lighting page will let you configure the parameters for dimmers and DO control- lers connected with UbiQ device. The page is shown as follows: There are 3 RS485 ID specified: Dimmer 1 ID: Specified the value and is stored to the global variable g_nRS485ID.
  • Page 30 Press OK to confirm the modification or press Cancel button to cancel the input. The added scenario item will be a last item on the tree view. “Insert...” menu item : Click the item and a dialog will shown as follows: UbiQ Scenario Manager User Manual...
  • Page 31 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 be got and refreshed on scenario display area. “Load from UbiQ” button: Click the button, the lighting setting file will transfer to UbiQ device.
  • Page 32: Controller Manager

    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 mouse, then a popup menu will be shown: UbiQ Scenario Manager User Manual...
  • Page 33 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...” menu item: Select this item and a dialog window with current controller information will be shown: UbiQ Scenario Manager User Manual...
  • Page 34: Function Manager Page

    “contrls.ctl”. After you have modified the information of controllers, you could transfer controllers data to UbiQ device. Please 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 UbiQ device.
  • Page 35 : The function returns a real number. – string : The function returns a string. – variant : The function returns a variant variable. “Add” button : Click this button, then a argument window will be shown: UbiQ Scenario Manager User Manual...
  • Page 36 If there are some errors on syntax check, a popup window will be shown: “Save” menu item: Select this item, then this function will be saved to internal memory. UbiQ Scenario Manager User Manual...
  • Page 37: Chapter 3 Tutorials

    Chapter Tutorials...
  • Page 38: Tutorials

    CGI scripts. 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 scenario menu items. The user interface on second level should show individual volumes for dimmers and DIO points.
  • Page 39 For each scenario mode, we could define 2 pictures to show. One is normal, and the other is selected. UbiQ Scenario Manager User Manual...
  • Page 40 We need 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.jpg"); LoadBMP(2,0,128,240,64,"main\\dinning.jpg"); UbiQ Scenario Manager User Manual...
  • Page 41 How to display the detailed information user could be understand? One example is the following: We defined the style of “Button 1” as Scenario Button. The button hint is set to “Good Morning Scenario”. This hint will be shown on the Internet Browser. UbiQ Scenario Manager User Manual...
  • Page 42 Then we begin to write the UI script for “Button 1”. The code sample is the following: int nV; int nDIB; 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,205,16); if (g_CurPage==0) for (nI=0;nI<8;nI=nI+1) nV=GetScenarioReg(nC,0); LoadBMPByValue(nDIB,7+nI*26,4,22,200,"==LIGHT_BAR4",nV); nC=nC+1; nDIB=nDIB+1; UbiQ Scenario Manager User Manual...
  • Page 43 LoadBMP(nDIB,89,210,14,14,"level2\\number\\4_on.bmp"); nDIB=nDIB+1; LoadBMP(nDIB,115,210,14,14,"level2\\number\\5_on.bmp"); nDIB=nDIB+1; LoadBMP(nDIB,141,210,14,14,"level2\\number\\6_on.bmp"); nDIB=nDIB+1; LoadBMP(nDIB,167,210,14,14,"level2\\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=GetScenarioReg(nC,0); LoadBMPByValue(nDIB,57,250,52,65,"level2\\icons\\door",nV); nC=nC+1; nDIB=nDIB+1; nV=GetScenarioReg(nC,0); LoadBMPByValue(nDIB,110,250,52,65,"level2\\icons\\dvd",nV); nC=nC+1; nDIB=nDIB+1; nV=GetScenarioReg(nC,0); LoadBMPByValue(nDIB,163,250,52,65,"level2\\icons\\window",nV); nC=nC+1; nDIB=nDIB+1; LoadBMP(nDIB,205,306,10,8,"level2\\right.bmp"); nDIB=nDIB+1; else if (g_CurPage==1) nV=GetScenarioReg(nC,1); LoadBMPByValue(nDIB,8,260,46,50,"level2\\icons\\projector",nV); nC=nC+1; nDIB=nDIB+1; UbiQ Scenario Manager User Manual...
  • Page 44: Web-Enabled Ui Access

    UbiQ-230 device by Internet Browser, please specify the IP address of UbiQ-230 device and assign the socket port as 8080. For example, If the IP address of UbiQ-230 device is 172.16.12.45, then you can launch IE for the follow- ing address: http://172.16.12.45:8080/...
  • Page 45 “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. UbiQ Scenario Manager User Manual...
  • Page 46 “Configuration Mode” will show graphic display of UbiQ-230 and allow user adjusting the values of each circuit and DO signals. UbiQ Scenario Manager User Manual...
  • Page 47: Chapter 4 Basic Of Smart-C Script Language

    Chapter Basic of Smart-C Script Language...
  • Page 48: Elements Of C

    /* Comments can contain keywords such as for and while without generating errors. */ Comments can appear on the same line as a code statement: printf( "Hello\n" ); /* Comments can go here */ UbiQ Scenario Manager User Manual...
  • Page 49: Keywords

    Punctuation and special characters The punctuation and special characters in the C character set have various uses, from organizing program text to defining the tasks that program carries out. They do not specify an operation to be performed. UbiQ Scenario Manager User Manual...
  • Page 50: Program Structure

    Ordinary identifiers All other names fall into a name space that includes variables, functions (including formal parameters and local variables), and enumeration constants. Identifier names have nested visibility, so you can redefine them within blocks. UbiQ Scenario Manager User Manual...
  • Page 51: Declarations And Types

    Type specifiers in declarations define the type of a variable or function declaration. Syntax type-specifier : void char double string variant The keyword void specify a function return type. You can use the void type to declare functions that return no value. UbiQ Scenario Manager User Manual...
  • Page 52: Expressions And Assignments

    The operators in the table are described in the sections beginning with Postfix Operators. The rest of this sec- tion gives general information about precedence and associativity. UbiQ Scenario Manager User Manual...
  • Page 53 C statements in alpha- betical order: * block statement * break statement * continue statement * expression statement * for statement * if statement * return statement * while statement block statement UbiQ Scenario Manager User Manual...
  • Page 54 Within nested statements, the break statement terminates only the for, or while state- ment that immediately encloses it. You can use a return statement to transfer control elsewhere out of the nested structure. This example illustrates the break statement: UbiQ Scenario Manager User Manual...
  • Page 55 In this example, the statement body is executed while i is greater than 0. First sum(i) is assigned to x; then, if x is equal to 1, the continue statement is executed. The rest UbiQ Scenario Manager User Manual...
  • Page 56 The loop-expression is evaluated after each iteration. There is no restriction on its type. The process then begins again with the evaluation of cond- expression. (2) If cond-expression is omitted, cond-expression is considered true, and execution proceeds exactly as described in the previous paragraph. UbiQ Scenario Manager User Manual...
  • Page 57 The following are examples of the if statement: if ( i > 0 ) { y = x / i; else x = i; UbiQ Scenario Manager User Manual...
  • Page 58 /* Sum the values between 0 and num. */ sum(int num) int running_sum; running_sum = 0; while(num>0) { running_sum = running_sum + num; num = num - 1; UbiQ Scenario Manager User Manual...
  • Page 59 A function contains dec- larations and statements. This section describes how to declare, define, and call C functions. Other topics discussed are: * Overview of functions UbiQ Scenario Manager User Manual...
  • Page 60 You need not declare functions with int return type before you call them, although prototypes are recommended so that correct type checking for arguments and return values is enabled. Arguments The arguments in a function call have this form: expression ( expression-list ) /* Function call */ UbiQ Scenario Manager User Manual...
  • Page 61 = running_sum + num; num = num - 1; return(running_sum); In this example, the sum function is declared in main to have one argument, repre- sented by the identifier num, is an int values. UbiQ Scenario Manager User Manual...
  • Page 62 UbiQ Scenario Manager User Manual...
  • Page 63: Functions Reference

    Chapter Functions Reference...
  • Page 64: Summary Tables

    Global variable, its type is integer. g_nRS485ID Global variable, its type is integer. g_nRS485ID2 Global variable, its type is integer. g_nRS485ID3 Global variable, its type is integer. g_nRS485ID4 Global variable, its type is integer. UbiQ Scenario Manager User Manual...
  • Page 65 Format the output to the debug window or web-client getenv Get the value of the environment variable of web-client Date/Time functions: Name Description date Get the current date string time Get the current time string UbiQ Scenario Manager User Manual...
  • Page 66 Get item value on the current scenario registry. SetScenarioInit Set the initialization value of the specified scenario index Voice functions: Name Description PlaySound Play the specified sound wave file Ethernet functions: Name Description GetFileFromHttp Get one file from specified homepage UbiQ Scenario Manager User Manual...
  • Page 67: Support Functions

    // The example will convert a string to a integer and show them char pChar[20]; // declare pDest as char[20] int nI; setdebug(TRUE); pChar=”20A”; nI=atoh(pChar); debug(“atoh(“,pChar,)=”,nI); // It will show “atoh(20A)=522” See Also itoa, ftoa, atof, atoi UbiQ Scenario Manager User Manual...
  • Page 68: Atoi

    This function closes the file associated with handle. Example int hFile; hFile=open(“\\Flash Storage\\template.txt”, FILE_CREATE_RW); setdebug(TRUE); if (hFile==0) { debug(“Open file failed!”); else { // process the file close(hFile); // close the file See Also open, read, write, seek, readln, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 69: Date

    // declare pChar as char[20] double f1; // declare f1 as double f1=2.789; pChar=”The value of f1 is “; setdebug(TRUE); debug(pChar,f1); // It will show “The value of f1 is 2.789” See Also setdebug, printf UbiQ Scenario Manager User Manual...
  • Page 70: Eof

    This function returns the result of copying source file to destination file. If it suc- cesses, returns TRUE; otherwise returns FALSE. Example ilecopy(“\\flash storage\\program.c1”,”\\flash storage\\program.cgi”); See Also open, close, read, write, seek, readln, writeln, eof UbiQ Scenario Manager User Manual...
  • Page 71: Ftoa

    This function returns the value of the current scenario registry by the given item and page index. Example Int nV; // Get the current scenario registry for item 1 and page 0 nV=GetScenarioReg(1,0); See Also SetScenarioInit UbiQ Scenario Manager User Manual...
  • Page 72: Getfilefromhttp

    Specifies the environment variable string. Description This function returns the string value to the given environment variable. Comments This function just is used for writing CGI script on the WebCON kernel. Example string sButton; sButton=getenv(“BUTTON”); printf(“BUTTON=%s”,sButton); See Also printf UbiQ Scenario Manager User Manual...
  • Page 73: Helpwindow

    // The example will convert a integer to string and show them char pDest[20]; // declare pDest as char[20] int nI; int nLen; setdebug(TRUE); nI=1024; nLen=itoa(nI,pDest,10); debug(“itoa(“,nI,”pDest,10)=”,pDest); // It will show “itoa(1024,pDest,10)=1024” itoa(nI,pDest,16); debug(“itoa(“nI,”pDest,16)=”,pDest); // It will show “itoa(1024,pDest,16)=400” See Also ftoa, atoi, atof, atoh UbiQ Scenario Manager User Manual...
  • Page 74: Loadbmp

    // Load the background bitmap from current bitmap folder on the screen LoadBMP(0,0,0,240,320,"level2\\level2.jpg"); // Load help background to the display area (0,238),(218, 238+18) LoadBMP(1,0,238,218,18,"level2\\help.jpg"); // Load the icon background to display area (0,256),(218,256+64) LoadBMP(2,0,256,218,64,"level2\\icon_bg.jpg"); See Also LoadBMPByValue UbiQ Scenario Manager User Manual...
  • Page 75: Loadbmpbyvalue

    OpenPort(int nPort, int nBaudRate) Parameters nPort: Specifies the COM port ID. The UbiQ-230 device RS485 port is set to COM3:. nBaudRate: Specifies the baud rate of COM Port. The UbiQ-230 device for RS485 port is set to 19200 bps.
  • Page 76: Open

    Example int hFile; hFile=open(“\\flash storage\\template.txt”, FILE_CREATE_RW); setdebug(TRUE); if (hFile==0) { debug(“Open file failed!”); else { close(hFile); See Also read, write, close, seek, readln, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 77: Playsound

    (for example, %s). If a percent sign is fol- lowed by a character that has no meaning as a format field, the character is copied to stdout. For example, to print a percent-sign character, use %%. UbiQ Scenario Manager User Manual...
  • Page 78 If width is prefixed with 0, zeros are added until the No padding. minimum width is reached. If 0 and ®C appear, the 0 is ignored. If 0 is specified with an integer format (i, u, x, X, o, d) the 0 is ignored. UbiQ Scenario Manager User Manual...
  • Page 79 If the number of digits in the argument is less than preci- sion, the output value is padded on the left with zeros. The value is not truncated when the number of digits exceeds precision. UbiQ Scenario Manager User Manual...
  • Page 80 // declare pChar as char[20] double f1; // declare f1 as double int nI; string aStr; char pBuf[30]; f1=2.789; nI=120; pBuf=”Test Printf”; aStr=”Test printf 2”; setdebug(TRUE); printf(“The f1=%f, nI=%d, pBuf=%s, aStr=%s”,f1,nI,pBuf,aStr); See Also sprintf, debug, setdebug, getenv UbiQ Scenario Manager User Manual...
  • Page 81: Read

    (hFile==0) { debug(“Open file failed!”); else { // process the file nLen=read(hFile, data, 512); while (nLen!=512) { nLen=read(hFile,data,512); close(hFile); // close the file See Also open, close, write, seek, readln, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 82: Readln

    FILE_READ); setdebug(TRUE); if (hFile==0) { debug(“Open file failed!”); else { // process the file readln(hFile, data); while (!eof(hFile)) { readln(hFile,data); close(hFile); // close the file See Also open, close, read, write, seek, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 83: Seek

    (hFile==0) { debug(“Open file failed!”); else { // process the file seek(SEEK_END,0); data=”This is a test file.”; nLen=write(hFile, data, strlen(datta)); close(hFile); // close the file See Also open, close, read, write, readln, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 84: Sendcomdata

    Out in", 0); nRet = sendComData(2,pOut,8,pRead,2,1000); //send data to COM2 if (nRet==2) { debug("Data is correct!",nRet); return (1); return (0); See Also OpenPort UbiQ Scenario Manager User Manual...
  • Page 85: Setdebug

    5.2.26 SetupTime Syntax void SetupTime() Parameters None Description This function will display the clock on the screen and provide user interface to setup time and clock. Example SetupTime(); See Also HelpWindow, LoadBMP, LoadBMPByValue UbiQ Scenario Manager User Manual...
  • Page 86: Showtext

    Description This function suspends the execution of the current thread for a specified inter- val. Example int nI; setdebug(TRUE); for (nI=0;nI<500;nI=nI+1) { Sleep(1000); debug(“Sleep “,nI,” mini-second”); See Also UbiQ Scenario Manager User Manual...
  • Page 87: Sprintf

    // declare pChar as char[20] double f1; // declare f1 as double int nI; string aStr; char pData[15]; char pBuf[50]; f1=2.789; nI=120; pData=”Test Printf”; aStr=”Test printf 2”; setdebug(TRUE); sprintf(pBuf,”The f1=%f, nI=%d, pBuf=%s, aStr=%s”,f1,nI,pBuf,aStr); See Also printf, debug , setdebug UbiQ Scenario Manager User Manual...
  • Page 88: Strcpy

    // declare pDest as char[20] char pSour[20]; // declare pSour as char[20] string aStr; // declare aStr as string aStr=”0123456789”; pSour=”abcdefghijk”; setdebug(TRUE); strcpy(pDest,pSour,5,4); debug(“strcpy(pDest,”,pSour,”,5,4)=”,pDest); // It will show “strcpy(pDest,abc- defghijk,5,4)=fghi strcpy(pDest,aStr,3,5); debug(“strcpy(pDest,”,pSour,”,3,5)=”,pDest); will show “(0123456789,3,5)=34567 See Also strlen UbiQ Scenario Manager User Manual...
  • Page 89: Strlen

    See Also strcpy 5.2.32 time Syntax string time() Parameters none Description This function returns the current date, its format is fixed as “hh:mm:ss”. Example string sTime; setdebug(TRUE); sDate=time(); debug(“The current time is”,sTime); See Also date UbiQ Scenario Manager User Manual...
  • Page 90: Write

    (hFile==0) { debug(“Open file failed!”); else { // process the file seek(hFile,SEEK_END,0); data=”This is a test file”; nLen=write(hFile, data, strlen(datta)); close(hFile); // close the file See Also open, close, read, seek, readln, writeln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 91: Writeln

    (hFile==0) { debug(“Open file failed!”); else { // process the file data = “This is a test”; writeln(hFile, data); close(hFile); // close the file See Also open, close, read, write, seek, readln, filecopy, eof UbiQ Scenario Manager User Manual...
  • Page 92 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 the publisher. All brand and product names are trademarks or registered trademarks of their respective companies. © Advantech Co., Ltd. 2007...

Table of Contents