lec 2 – let'em click (version 2.0)€¦ · lec 2 – "let'em click" (version...

17
LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner 4. Web Server 5. Possible Problems and their Solution 1. Basic Explanation and Operation of the Software "LeC 2" is a programme for Windows 2000, XP and Vista for controlling serial 8-fold relay circuit boards (Conrad order no. 197720 and/or 197730). For this, the programme offers several possibilities, such as a main menu, script editor and web server. They will be explained in detail in these instructions. "LeC 2" can not be opened several times, because all PCBs can be controlled through an interface (serial or USB by "USB to RS232 converter IC“, Conrad order no. 197257). Version 12/09 OPERATING MANUAL www.conrad.com

Upload: others

Post on 24-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

LeC 2 – "Let'em Click" (Version 2.0)

Contents1. Basic Explanation and Operation of the Software2. The Script Editor3. Task Planner4. Web Server5. Possible Problems and their Solution

1. Basic Explanation and Operation of the Software"LeC 2" is a programme for Windows 2000, XP and Vista for controlling serial 8-fold relay circuit boards(Conrad order no. 197720 and/or 197730).For this, the programme offers several possibilities, such as a main menu, script editor and web server. Theywill be explained in detail in these instructions.

"LeC 2" can not be opened several times, because all PCBs can be controlled through aninterface (serial or USB by "USB to RS232 converter IC“, Conrad order no. 197257).

Version 12/09

O P E R A T I N G M A N U A L www.conrad .com

Page 2: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

1.1 The Main Menu

After the programme is started, the start-up-screen will appear first and the PCB(s) will be initialised. Also,the relay PCB software version will be indicated after successful initialisation. Afterwards, the programme willrun in the background, and a symbol will appear in the status bar next to the time. Clicking left opens the mainmenu, clicking right opens a popup menu that will also give you access to the different functions.If you open the programme for the first time, you will see a message asking you to adjust the serial connectionand the configuration window will open. By default, the programme always assumes the first connection(COM1).In the main menu, you can directly switch the relays. You may select a PCB through the tabs. The relay namescan be taken from the relay card and relay number. You may select the relay name in the configurationdialogue.Web server, task planner and script editor can be opened under "Functions". Right-clicking on the symbol inthe task bar also calls these functions.

Page 3: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

1.2 The Configuration Dialogue

Here you can make the "LeC 2" settings. You can also determine names for the relays. When the dialogueis closed through "OK", the names are saved.

Setting "Visible after Launch":When this option is selected, the main menu is opened when "LeC 2" is started.

Setting "Activate systemwide Hotkeys":If you do not always have to open the main menu, "LeC 2" offers some system-wide hotkeys (shortcuts) forswitching the relays. When the hotkeys are active, the relays can be switched (no matter which Windowsprogramme you are currently in).The shortcuts are the following:"Shift" and F1 to F8: Switch relay on/off"Shift" and F9: Go one PCB back"Shift" and F10: Go one PCB forward"Shift" and F11: Display/hide main menu

Setting "All Relays off when close LeC 2“:All relays on all PCBs are switched off when "LeC 2" is exited.

Page 4: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

"COM port" connection settings:In this box, the serial connection to which the relay PCBs are connected is set. Where no relay PCBs arerecognised at the connection, you will receive an error message and the configuration dialogue will open.Check if the relay PCB is externally powered up and if it is connected properly. The fields for changing therelay names are not available if no PCBs were recognized. If a new connection is selected, you need to"reconnect", to accept it in the connection protocol.

Setting "Auto reconnect“:When the connection to the relay PCBs is interrupted, an attempt to re-establish the connection is made every60 seconds.

Page 5: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

1.3 The Connection Protocol

The connection protocol logs the connection between "LeC 2" and the relay PCBs. You may also manuallyre-establish the connections if an error occurred. Device may also be saved to a file.

Page 6: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

2. The Script Editor

The "LeC 2" script functions can be used to automate switching processes. In the following, the "LeC 2" scriptlanguage commands are described.

Page 7: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

2.1 Script CommandsSendbyte: Sends a byte to the relay PCB. The first parameter after the command indicates the PCB, the 2ndparameter the command byte. Enter, e.g. "Sendbyte 1 1" for the first relay on the first PCB (with a spacebetween commands and parameters!).When the first parameter indicated is 0, a broadcast is sent. For "Sendbyte 0 1", the first relay is switched onall PCBs. The command byte is handed directly to the PCB, and you need to convert from decimal to binarynumbers by yourself (see section 2.2).

Sendbin: Sends a binary byte to the relay PCB. The first parameter indicates the PCB. Then the relay bitsare given from the right to the left. "Sendbin 1 10000000" switches on the eighth relay on the first PCB andswitches all the other relays off.

Set: The set command is the easiest but most comprehensive command. The first parameter after thecommand is the PCB number again. For reasons of compatibility with the preceding PCB version (Motorolamicro controller), "Set" cannot use "0" (Broadcast) as an address. The second parameter is the relay number.The 3rd parameter can be "on", "off" or "toggle" (reverse status). The command Set only affects the relayindicated. All other relays remain unchanged.

Sleep: "Sleep" can be used to insert a pause. The pause is indicated in seconds.Goto: "Goto" can be used to programme "endless programmes" to keep repeating certain switchingsequences. As a parameter, state the line to which the programme should jump each time. The script will onlystop when interrupted or when "LeC 2" is exited.

Server: The "Server" command can be used to switch the "LeC 2" web server on and off. Thus, the web servercan be switched on and off at certain times in connection with the task planner. Use either "start" or "stop"as a parameter.

Taskplaner: The "Taskplaner" command can be used to switch the "LeC 2" task planner on and off. Use either"start" or "stop" as a parameter.

Close: Use "close" to exit "LeC 2" without confirmation. All settings are saved and the programme is exitedat once. When the setting "All relays off when close LeC 2" is selected, all relays are switched off first.

The parameters are divided with spaces You may start any comments with a "{" character at thebeginning of the line, and close it with "}" (do not enter quotes). Comments may also be writtenafter a command, with a space to separate them. For examples, see the example scripts under"Samples" in the "LeC 2" installation path.

Page 8: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

2.2 Editor WindowIn the editor window, you will be able to write, save, open and execute "LeC 2"-scripts.When a script is executed, any error messages are displayed under the editor.Furthermore, the editor has a code completion function that is called automatically. Right-click opens theediting menu, which can be used to open the help file manually through "Open script help" (Ctrl+h).

2.3 Help for Using the Script Editor for the First TimeTo become familiar with the script editor operation, proceed as follows:Open the script editor and enter the following script:{ Running Light Example 1 }Sendbyte 0 0 { Broadcast: Switch off all relays on all PCBs }Sendbyte 1 1 { Only relay 1 on PCB 1 is on }Sendbyte 1 2 { Only relay 2 on PCB 1 is on }Sendbyte 1 4 { Only relay 3 on PCB 1 is on }Sendbyte 1 8 { Only relay 4 on PCB 1 is on }Sendbyte 1 16 { Only relay 5 on PCB 1 is on }Sendbyte 1 32 { Only relay 6 on PCB 1 is on }Sendbyte 1 64 { Only relay 7 on PCB 1 is on }Sendbyte 1 128 { Only relay 1 on PCB 1 is on }Sendbyte 1 0 { All relays on PCB 1 are off }

Now click on "execute script" (F9). Now you programmed a simple running light. For explanation, this is thetable for calculating the values for the "Sendbyte" command:Bit Relay 1 Relay 2 Relay 3 Relay 4 Relay 5 Relay 6 Relay 7 Relay 8Value 1 2 4 8 16 32 64 128Example On (1) Off (0) Off (0) On (1) On (1) Off (0) Off (0) On (1)

When adding the different relay number values from the example:1 + 8 + 16 + 128 = 153To send the example, enter "Sendbyte 1 153“, with 1 being the PDB number.

Page 9: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

The "Sendbin" command works the other way around:

{ Running Light Example 2 }Sendbin 0 00000000 { Broadcast: Switch off all relays on all PCBs }Sendbin 1 00000001 { Only relay 1 on PCB 1 is on }Sendbin 1 00000010 { Only relay 2 on PCB 1 is on }Sendbin 1 00000100 { Only relay 3 on PCB 1 is on }Sendbin 1 00001000 { Only relay 4 on PCB 1 is on }Sendbin 1 00010000 { Only relay 5 on PCB 1 is on }Sendbin 1 00100000 { Only relay 6 on PCB 1 is on }Sendbin 1 01000000 { Only relay 7 on PCB 1 is on }Sendbin 1 10000000 { Only relay 8 on PCB 1 is on }Sendbin 1 00000000 { All relays on PCB 1 are off}

Here the relays are directly set or deleted with "0" or "1". The order is from the right to the left. When only"Sendbin 1 101" is indicated, the first and third relays of the 1st circuit board are activated.

Page 10: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

The "Set" command can also be used to reverse the status of individual relays:

{ This script shows the Set command }{ First parameter: PCB }{ Second parameter: Relay number 1-8 }{ Third parameter: on, off, toggle }

Sendbyte 0 0 {Switch off all relays on all PCBs }Sleep 1 { Wait for one second }Set 1 1 on { Switch on the first relay on relay card 1 }Set 1 2 on { Switch on the second relay on relay card 1 }Set 1 3 on { Switch on the third relay on relay card 1 }Set 1 4 on { etc. }Set 1 5 onSet 1 6 onSet 1 7 onSet 1 8 onSleep 5 { Wait for five seconds }Set 1 1 off { switch off the first relay on relay card 1 }Set 1 2 off { switch off the second relay on relay card 1 }Set 1 3 off { switch off the third relay on relay card 1 }Set 1 4 off { etc. }Set 1 5 offSet 1 6 offSet 1 7 offSet 1 8 offSleep 5 { Wait for five seconds }Set 1 1 toggle { Toggle the state of the first relay on relay card 1 }Set 1 2 toggle { Toggle the state of the second relay on relay card 1 }Set 1 3 toggle { Toggle the state of the third relay on relay card 1 }Set 1 4 toggle { etc. }Set 1 5 toggleSet 1 6 toggleSet 1 7 toggleSet 1 8 toggleSendbyte 1 0 { All relays on PCB 1 are off }{ Programme end }

Page 11: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

The "Sleep" command enters a short break (in seconds) in the programme.Observe that the execution speed of the programme may vary according to computer, relay PCBs andselected command due to its underlying principle (for cascading, see relay PCB instructions). For longerbreaks, break the programme into several parts and start them through the task planner.

Page 12: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

3. Task Planner

Use the task planner to plan the execution of "LeC 2" scripts at certain times. You may choose between once,daily, weekly and monthly execution. You may plan up to a maximum of 50 tasks. One-time tasks areautomatically removed from the list after they are started.

No tasks are executed while the script editor is open! Also do not use any endless loops ("goto")in the scripts or to schedule tasks directly after one another.E.g. when a one-time task is scheduled at the same time as a weekly one, the task that is farthertowards the top of the list will be executed.

The time column gives "O" (once) for once, "D" (day) for daily, "W" (week) for weekly and "M" (month) formonthly tasks. When adding a task, the time of the day is added for daily execution, the weekday is also addedfor weekly execution (with 1 being Monday and 7 Sunday) and time and day for monthly execution.If you want to delete one or all tasks, select the task from the list and open the editing menu with the right mousebutton.

Page 13: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

4. Web Server

The "LeC 2" web server can be used to control the relay PCBs through the local network or even through theinternet. Under port, select the TCP/IP port on which the server is to reply. If you do not know what this means,keep 80 as the default setting.

To protect the server, you need to select a user name and password. User name and passwordmust have more than 5 characters for the server to be activated. Otherwise, an error messagewill be returned.To change settings, the server must first be deactivated.Select a sufficiently secure password and another user name than the default one.Only clear the web server for the internet when you are clear on the risk involved.Conrad Electronic shall not be liable for any damage caused by the web server.When starting "LeC 2", the server is started automatically if it was activated when it was exited.

For testing, press "Server test" and the web interface will be opened in your standard browser.

Page 14: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

4.1 Web Interface

The "LeC 2" web interface can be used with a browser (e.g. Internet Explorer, Firefox). When it is opened,the login dialogue will be displayed first. Enter your login information for access.The interface is similar to the "LeC 2" main menu, but it is operated a bit differently:A PCB can be selected with the "Select Board" dropdown menu. Press "Switch Board" for confirmation.Switching the PCB also has some local effects! The web server switches the PCB selected in the server inthe main menu.To switch the relays, select the selection fields and click "Switch relays". The page is now reloaded and theselected relays will switch. If you want to discard your selection, click "Reset selection".You may also switch on/off all relays on the current PCB as in the main menu or to switch on/off all relays onall PCBs.You may also call all log files and display the server screen content as an image.When no PCBs are initialised, access will be limited to certain functions. The connection can be re-establishedwith "Reconnect boards".

Page 15: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

The current task list is also displayed as in the main menu. The currently active task is highlighted in red.

To close the current session, just close the browser window.

Page 16: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

5. Possible Problems and their RemovalUsually, there should be no problems when working with "LeC 2". If there should still be any error, this sectionmay help you. Otherwise, ask your technical questions under:

Germany: Tel. no.:+49 9604 / 40 88 80Fax. no.: +49 9604 / 40 88 48e-mail: [email protected]. to Thur. 8.00am to 4.30pmFri. 8.00am to 2.00pm

Problem "Programme does not react"Does the programme currently attempt to reconnect? Due to the underlying principle, the relay PCB initiationwill take a while. Also check the "reconnect automatically" setting. If this option is activated, the programmeautomatically tries to reconnect every 60 seconds.When operated via USB with a "USB converter": Was the USB cable removed or does the virtual interfaceno longer exist? Read the operating instructions of the USB converter for help on the correct installation.

Page 17: LeC 2 – Let'em Click (Version 2.0)€¦ · LeC 2 – "Let'em Click" (Version 2.0) Contents 1. Basic Explanation and Operation of the Software 2. The Script Editor 3. Task Planner

These operating instructions are a publication by Conrad Electronic SE, Klaus-Conrad-Str. 1, D-92240 Hirschau(www.conrad.com).

All rights including translation reserved. Reproduction by any method, e.g. photocopy, microfilming, or the capture in electronic data processing systemsrequire the prior written approval by the editor. Reprinting, also in part, is prohibited.These operating instructions represent the technical status at the time of printing. Changes in technology and equipment reserved.© Copyright 2009 by Conrad Electronic SE. 01_1209_01