Advantech UbiQ User manual

User Manual
UbiQ
Scenario Manager
User Manual V1.03

UbiQ Scenario Manager User Manual ii
Copyright Notice
This document is copyrighted, 2006, by Advantech Co., Ltd. All rights are reserved.
Advantech Co., Ltd. reserves the right to make improvements to the products
described in this manual at any time without notice. No part of this manual may be
reproduced, copied, translated or transmitted in any form or by any means without
the prior written permission of Advantech Co., Ltd. Information provided in this man-
ual is intended to be accurate and reliable. However, Advantech Co., Ltd. assumes
no responsibility for its use, nor for any infringements upon the rights of third parties
which may result from its use.
Acknowledgements
IBM and PC are trademarks of International Business Machines Corporation.
Intel is a trademark of Intel Corporation.
MS-DOS and Windows are trademarks of Microsoft Corporation.
ActiveX, Visual Basic, Excel, Access and Visual C++ are trademarks of Microsoft
Corporation.
All other product names or trademarks are the properties of their respective owners.
Advantech Customer Services
Each and every Advantech product is built to the most exacting specifications to
ensure reliable performance in the harsh and demanding conditions typical of indus-
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 which the name Advantech has come to be
known. Your satisfaction is our primary concern. Here is a guide to Advantech’s cus-
tomer services. To ensure you get the full benefit of our services, please follow the
instructions below carefully.
Technical Support
We want you to get the maximum performance from your products. So if you run into
technical difficulties, we are here to help. For the most frequently asked questions,
you can easily find answers in your product documentation. These answers are nor-
mally a lot more detailed than the ones we can give over the phone.
So please consult this manual first. If you still cannot find the answer, gather all the
information or questions that apply to your problem, and with the product close at
hand, call your dealer. Our dealers are well trained and ready to give you the support
you need to get the most from your Advantech products. In fact, most problems
reported are minor and are able to be easily solved over the phone.
In addition, free technical support is available from Advantech engineers every busi-
ness day. We are always ready to give advice on application requirements or specific
information on the installation and operation of any of our products.

iii UbiQ Scenario Manager User Manual
Limited Warranty
Advantech Corporation does not warrant that the UbiQ Scenario Manager software
utility package will function properly in every hardware/software environment. Advan-
tech Corporation makes no representation or warranties of any kinds whatsoever
with respect to the contents of this manual and specifically disclaims any implied war-
ranties or fitness for any particular purpose. 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.
About This Manual
Advantech UbiQ Scenario Manager software is a comprehensive, flexible human
machine interface application environment, that supports the functions and utilities to
develop all types of automation 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.
Organization of this Manual
Chapter 1, Introduction gives a general background to the UbiQ platform. The
system architecture is explained, and the product’s main features are intro-
duced. Installation of the software is explained.
Chapter 2, Getting Start explains how to use UbiQ platform and complete some
of the most common tasks within UbiQ Scenario Manager software package.
Chapter 3, Tutorial explains how to complete the basic skills that you need to
use the UbiQ platform. In addition, there are step-by-step tutorials that explain
how to complete simple web-enabled system within the UbiQ platform.
Chapter 4, Basics of Smart-C Script Language explains the basics of the Smart-
C script language. In this chapter, you could learn the statements and syntax of
C languages.
Chapter 5, Functions Reference explains the UbiQ platform supporting func-
tions list, you can call these functions in your programs or CGI scripts.

UbiQ Scenario Manager User Manual iv

v UbiQ Scenario Manager User Manual
Contents
Chapter 1 Introduction..........................................1
1.1 Overviews .................................................................................................2
1.1.1 Contents........................................................................................2
1.2 System Architecture..................................................................................2
1.2.1 Module Description.......................................................................2
1.3 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 .............................................5
1.3.3 Start Menu Shortcuts....................................................................6
1.4 How Does UbiQ Work?.............................................................................6
Chapter 2 Getting Started.....................................7
2.1 Quick Start to UbiQ-230 platform..............................................................8
2.2 Seek Ubiq-230 Devices.............................................................................9
2.3 Information of 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 Manager Page..........................................................................28
Chapter 3 Tutorials .............................................31
3.1 Tutorials ..................................................................................................32
3.2 Define your user interface on UbiQ-230..................................................32
3.3 Web-enabled UI Access..........................................................................38
Chapter 4 Basic of Smart-C Script Language ..41
4.1 Elements of C..........................................................................................42
4.1.1 Tokens........................................................................................42
4.1.2 Comments...................................................................................42
4.1.3 Keywords....................................................................................43
4.1.4 Constants....................................................................................43
4.1.5 Hex-decimal Integer Constant ....................................................43
4.1.6 String literals...............................................................................43
4.1.7 Punctuation and special characters............................................43
4.2 Program Structure...................................................................................44
4.2.1 The main function and program execution..................................44
4.2.2 Name spaces..............................................................................44
4.3 Declarations and Types ..........................................................................45
4.3.1 Overview of declarations.............................................................45
4.3.2 Type specifiers............................................................................45
4.4 Expressions and Assignments................................................................46
4.4.1 Operators....................................................................................46

UbiQ Scenario Manager User Manual vi
4.4.2 Operator precedence.................................................................. 46
Chapter 5 Functions Reference ........................57
5.1 Summary Tables..................................................................................... 58
5.2 Support Functions................................................................................... 61
5.2.1 atof.............................................................................................. 61
5.2.2 atoh............................................................................................. 61
5.2.3 atoi.............................................................................................. 62
5.2.4 close ........................................................................................... 62
5.2.5 date............................................................................................. 63
5.2.6 debug.......................................................................................... 63
5.2.7 eof............................................................................................... 64
5.2.8 filecopy........................................................................................ 64
5.2.9 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 PlaySound .................................................................................. 71
5.2.20 printf............................................................................................ 71
5.2.21 read............................................................................................. 75
5.2.22 readln.......................................................................................... 76
5.2.23 seek............................................................................................ 77
5.2.24 sendComData............................................................................. 78
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

Chapter 1
1Introduction

UbiQ Scenario Manager User Manual 2
1.1 Overviews
Congratulations on your purchase of Advantech’s UbiQ-230 product for developing
scenario control for web-enabled solutions of home automation. Advantech UbiQ-
230 product is a comprehensive, flexible web-enabled controlling platform that sup-
ports the functions and utilities to develop all types of automation applications on e-
home in the Windows XP, and Windows CE environment. UbiQ-230 products provide
scenario web-based systems including Web server, remote controlling & accessing
functions and CGI-script to let your devices to be connected to Internet/Intranet.
UbiQ-230 is extremely flexible and easy to use. The client could use Internet Browser
to get/set the information of devices. A list of UbiQ devices will be automatically
probed and shown on your UbiQ Scenario Manager utility screen. Controllers°Ø and
devices’ functions and arguments are provided to you through the controller°Øs list.
You can simply add/edit/delete functions for each controller to perform specific user
defined functions; you can arrange those functions as a strategy, to manipulate the
control programs for each device. 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.
The UbiQ-230 kernel is a multi-threaded engine for optimal performance. It provides
you plug-and-play connectivity with your devices, including lighting controllers, digital
in/out controllers, and other automated devices. It saves a lot of effort and time when
developing your applications. The UbiQ platform ensures that you can integrate your
process data into existing e-Home information systems throughout your home.
In addition, UbiQ Scenario Manager software utility leverages 32-bit Windows°Ø pre-
emptive multi-tasking capability to support Windows XP environments.
1.1.1 Contents
System architecture
Installation
How does UbiQ-230 platform work?
1.2 System Architecture
We designed UbiQ-230 platform with a scenario Web-based
and open integrated architectures. The open platform is simple to configure and
allows you to easily integrate automation system with other controllers and devices in
your environment.
1.2.1 Module Description
1.2.1.1 Compact Embedded Web Server
Web Server is built-in on UbiQ-230 products. You could connect UbiQ-230 products
by Internet Browser, and also get/set the connected devices’ information.
1.2.1.2 C Script Engine
C Script Engine is the interpreter of C-language. The UbiQ-230 runs scenarios con-
trolling programs after power-up. Controlling programs are interpreted as C by C
Script Engine. In addition, CGI(Common Gateway Interface) scripts, are the interface
of the web-server and connected devices, also are interpreted as C by C Script
Engine.

3 UbiQ Scenario Manager User Manual
Chapter 1 Introduction
1.2.1.3 UbiQ Scenario Manager Software Utility
UbiQ Scenario Manager utility is used remotely to configure and control UbiQ plat-
form. When using UbiQ-230 in the first time, you must configure the name and IP
address for the UbiQ device. And you need to add the controllers/devices connected
UbiQ, if these controllers/devices are not in the default list. Then you could add these
controllers/devices to UbiQ and test them by the UbiQ Scenario Manager utility.
1.3 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.
1.3.1 PC System Requirements
OS : Microsoft Windows XP
RAM : at least 128 MB memory
Disk space: at least 4 MB space
CPU: Intel Pentium II processor 400 MHz or higher
Display: VGA resolution or higher
Microsoft-compatible mouse
Ethernet port
1.3.2 Installing UbiQ Scenario Manager Utility
UbiQ Scenario Manager utility ships with an installation program that helps you install
the program to your computer.
Installation can normally be completed within two minutes.
1. Run the UbiQ Scenario Manager utility installation program at:
d:\Scenario\setup.exe
where “d” is the drive letter of your CD-ROM drive.
2. The Welcome screen loads. Click the Next button.

UbiQ Scenario Manager User Manual 4
Figure 1.1 UbiQ Scenario Manager Installation Welcome Screen
3. 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
4. The installation program will create program shortcuts on your Windows Start
menu so that you can easily launch the program. The default program folder is:
UbiQ-230 Scenario Manager
If you want to have the shortcuts made in a different folder, type it or select it in
the Select Program Folder dialog box.

5 UbiQ Scenario Manager User Manual
Chapter 1 Introduction
Figure 1.3 Select Program Folder Screen
5. 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
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 the Add/Remove...
button.
3. Click the Yes button in the Confirm File Deletion dialog box.
4. The un-installation program removes the program files and registry entries from
your computer. Click the OK button when the un-installation program finishes.

UbiQ Scenario Manager User Manual 6
1.3.3 Start Menu Shortcuts
The UbiQ Scenario Manager utility installation program creates the following program
shortcuts on the computer’s Start menu.
The links are the following:
UbiQ-230 Scenario Manager : The program folder.
Scenario : The UbiQ Scenario Manager utility shortcut.
1.4 How Does UbiQ Work?
UbiQ platform includes two parts: controlling server and remote utility. The controlling
server is the hardware body plus web server, C Script Engine, and scenarios pro-
gram softwares. UbiQ device has one Ethernet port and 1 RS485 port. You can con-
nect PC-based controllers/devices, and lighting controllers to UbiQ device by these
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 Browser anywhere anytime. Via CGI programs, you even
setup connected devices to control their behaviors remotely.
UbiQ platform is designed to fit the following purposes:
Web-based automation system
Data acquisition provider and access controllers through Internet Browser
Enable legacy controllers to Internet
Provide remote accessing control
Easy to configure connected controllers
Simple to develop homepages combined with controller°Øs data
Offer data to other applications
The UbiQ Scenario Manager utility is the client to configure and control the UbiQ plat-
form. It could configure multi-UbiQ devices and run controlling programs to control
connected devices.

Chapter 2
2Getting Started

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.

9 UbiQ Scenario Manager User Manual
Chapter 2 Getting Started
2.2 Seek Ubiq-230 Devices
While you move the mouse cursor on the item “Connected Ubiq Platforms” and press
right-button of mouse, the popup menu will be displayed on the screen.
There are 4 items on the popup menu: “Seek thru Intranet”, “Seek thru COM Port”,
“Seek thru Internet”, and “Property...”.
“Seek thru Intranet” : Search the UbiQ devices on the local network. Application
uses the broadcast 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. These IP addresses are added on
“Property...” Window.
“Property...” : The ”Seek Property” window will be popup. There are several
fields and buttons need be specified by users.
–“Password” : Control Access Password for UbiQ device.
–“Connected Port” : Two ports “COM1:” and “COM2:” can be chosen.
–“Baud Rate” : Define baud rate for the connected port.
–“Seek IP List” : Internet IP of UbiQ devices. Double-Click the IP will enter edit-
mode for IP address.
–“Add” : Add a Internet IP address to IP List.
–“Delete” : Delete the current IP item on the IP List.

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.

11 UbiQ Scenario Manager User Manual
Chapter 2 Getting Started
2.3 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. 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.
“Set Local Time” button : set the host PC time to UbiQ device.
“H/W Rest” button : launch the H/W reset command to UbiQ device.
“Get MacID” button : get the MacID address of UbiQ device.
“Set MacID” button : set the MacID address to UbiQ device.
“Bitmap Filename” field : specify the boot logo bitmap filename.
“Set Logo” button : set the boot logo bitmap to UbiQ device.

UbiQ Scenario Manager User Manual 12
2.4 Control of Connected UbiQ
The “Control” page will enables you to access the UbiQ device remotely by 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 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”.

13 UbiQ Scenario Manager User Manual
Chapter 2 Getting Started
“Stop Mouse 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 file view window and press the right-button of
mouse, a popup menu is shown:

UbiQ Scenario Manager User Manual 14
“Copy To...” menu item: Select this item and a dialog will be prompt on screen:
Choose the folder and specify your new filename you 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 add to UbiQ device. This function is just copy
a file from PC side to UbiQ device.
“Execute” menu item: Select this item and this file will be executed on UbiQ
device.
Table of contents
Other Advantech Control Panel manuals
Popular Control Panel manuals by other brands

Insignia
Insignia MK117U user manual

Pentair
Pentair MYERS CNC-600-43DW Installation and service manual

Pyronix
Pyronix PCX 46 APP Programming reference manual

Sartorius
Sartorius arium pro Quick start operating instructions

AKO
AKO PROCool AKO-17635-1 user manual

SALUPO
SALUPO PRESS CONTROL PLUS SA640 Series Instruction and installation manual