arrowLeft  SUPPORT  arrowRight

JDS Technologies

 

Communication Protocol Specifications

 

TimeCommander

TimeCommander-Plus

STARGATE

 

JDS Technologies
12200 Thatcher Court
Poway, CA 92064
Tel: 858-486-8787
Fax: 858-486-8789
onlinejds@aol.com
www.jdstechnologies.com

TimeCommander / TimeCommander-Plus / Stargate

Protocol Specifications

Version 1.3

 

Table Of Contents

Abstract, Notes, Contact Information

Firmware


Reset Routine
Serial I/O
Serial Port Pinout
TimeCommander Internal Variables
PowerFail Flag
Firstpass Flag
X10 Loss

X10Status Array
Data Logging
BIST (Built in Self Test)
Direct X10 Command
Set Time
Read Time
Return System Info
Clear Schedule
Download Refresh Value
Download X10 Status
Upload Timer information
Download Flag information
Upload Flag Information
Download Variable information
Upload Variable Information
Download Security Offset
Dump Message Log
Clear Message Log
Halt Schedule
Start Schedule
Disable Echo Mode
Enable Echo Mode
Start X10 Signal Test
Stop X10 Signal Test
Upload X10 status to host - Fast Mode
Dump X10 History
Store Schedule Name
Direct Flag Command
Direct Variable Command
IIC Transmit byte command
IIC Receive byte command
Is Schedule running
Return firmware version
Modem Call Back Command
Get Timer
Store Ringcount
Store Modem Init String
Network Reset *
Read/Write I/O Structure *
Read IO Structure *
Read/Write Time Label *
Get X10 Status *
Enable/Disable Expansion Bus *
Bus Fault Check *
Performance Monitor

Acknowledge


I/O Addresses

Internal Data Structures


Examples:

Using the Read/Write IO Structure Command
Example 1: Set Relay 7 on TimeCommander-Plus
Example 2: Clear Relay 4 on IO Xpander - 3
Example 3: Read the scaled A/D value on A/D 1 on the TimeCommander-Plus
Example 4: Read the Digital Inputs for DI Xpander - 2

Addendum:

1.1.1   Get Controller Type
1.1.2    Advanced X10 Command (Version 2.40 and higher)
1.1.3    Return firmware version

 


 

 

Abstract:

This document is a specification of the TimeCommander Protocol(tm) format -- a defined command language for computer interface and control of home automation systems, such as TimeCommander, TimeCommander-Plus and Stargate.

 

(c) 1995 IHS.

Printed in USA All rights reserved.

 

This document may be reproduced or copied -- provided that this document is reproduced in its entirety and all copyright notices are intact. This document is believed to be accurate at the time of publication, however, JDS Technologies and IHS makes no claim that this document is error-free.

 

Please direct any inquiries to:

JDS Technologies

Phone: (858) 486-8787

FAX: (858) 486-8789

 

 

Note: Numeric values in this document may appear with or without a suffix character:

254 No suffix: decimal

254d 'd' suffix: decimal

10110001b 'b' suffix: binary

6FC5h 'h' suffix: hexadecimal

69bcd "bcd" suffix: binary-coded-decimal (hex, without the A-F values)

 

 

 

TimeCommander, TimeCommander-Plus and Stargate are trademarks of JDS.

WinEVM, Event Manager and MegaController are trademarks of IHS.

Visual Basic and Windows are trademarks of Microsoft Corporation.

X-10 is a registered trademark of X-10 (USA), Inc.

 

Firmware

Reset Routine

Upon reset the TimeCommander will do the following:

1. Set I/O ports to inactive state, i.e., LED, X10 xmit.

2. Do a memory integrity check to determine if the data storage memory is intact. This is in case of a power fail. If this is the case, the firmware will preload any variables from NV memory into the microcontroller memory. If the data is corrupt, the event data storage and any variables associated with it will be reset.

3. Clear any variables and memory

4. Set up timer1 for serial I/O

5. Read RTC and update local time

6. Send out a reset complete message with status.

Serial I/O

The TimeCommander uses buffered serial I/O for communicating to the host computer. Both the input and output buffer are 250 bytes in length. There is a 2 second serial port timeout. When a serial port timeout occurs, a carriage return is automatically inserted into the input buffer. This is done to keep spurrious serial port activity from hanging up the system. This means that there can be no more than 2 seconds between characters sent to the TimeCommander.

The serial port parameters are as follows:

Baud: 2400

Parity: None

Bits: 8

Stop Bits: 1

 

Serial Port Pinout:

Pin 2: Transmit data

Pin 3: Receive data

Pin 5: Signal Ground

 

 

TimeCommander Internal Variables

TimeCommander keeps internal variables. These are:

Figure 1: Internal Devices

 

Variable Name Quantity
X-10 Status 256
Timers 32
Variables 256
Flags 256
Time Labels 16

 

PowerFail Flag

After a powerup condition, TimeCommander sets the Powerfail flag and clears it after the first pass through the schedule loop. TimeCommander also logs the PowerFail message in the message log.

Firstpass Flag

When the schedule is first started, the Firstpass flag will be set, and cleared at the end of the eval loop. This can be used in a schedule to provide an initialization event.

X10 Loss

This flag will be set when the X10 zero crossing is lost.

 

 

 

X10 Status Array

The X10Status Array is a 16 x 16 array that holds the status of the X10 device, ON, OFF, or IDLE as well as other parameters.

 

Figure 2: X10 Status Array

 

X-10 Status Array

Each ‘x’ in the array corresponds to a status byte as shown in Figure 3: X10 Status Bytes.

 

Figure 3: X10 Status Bytes

X-10 Status Bytes

 

There is a corresponding 16x16 Dim Status array using the same structure as the X10 Status array. This array keeps track of the Dim/Bri level of each X10 device. The Dim/Bri levels are shown in Figure 4: X10 Dim Status Values.

 

X10 Dim Status Values

Figure 4: X10 Dim Status Values

The reason the OFF commands set the status to 21, is that when the dim level command is issued, the current level is looked at to determine how many dim or bright commands to issue. If a lamp module is OFF, a dim or bright command will turn the module ON, before it will dim. With this in mind, if a lamp module is issued an OFF command, the dimstatus is set to 21, when a dim level command is issued, say to level 8 (of 20), if the dimstatus was 0, it would issue 8 bright commands. By setting it to 21, it will issue 3 dim commands, the first one will turn on the lamp, the next 2 to reduce the level to 8.

The SetLevel feature for Dim/Bri of X10 lamp modules disables reception of DIM/BRI commands while it is sending. This is due to the TW523’s inability to receive properly. It will update the dimstatus directly.

* The X10dimstatus will only be updated by DIM and BRIGHT commands only when these commands are issued by the TimeCommander. This is due to the TW523's inability to accurately decode DIM/BRI commands that are sequential with no quiet periods between transmissions.

 

 

Data Logging

TimeCommander can log any type of text message. The data log is 8000 bytes in size. Each message that is logged must be NULL terminated. The data log is a circular buffer that has a head and tail pointer. If the log fills up, it will start to overwrite the oldest data. Reading the log is done by starting with the tail pointer and 'puts()' until the head pointer passes the head pointer.

The Log_head will always point to the next location where a data message will be stored. The Log_tail will always point to the beginning of the oldest message. If the Log_head goes past the Log_tail during a data message store, the Log_tail will increment until it points to the next complete message that is past the Log_head, null filling the buffer as it increments.

During a data log read, the Log_tail will be copied into a temp tail pointer, the temp_tail will be used as the index of the buffer until it is equal to the Log_head pointer.

Command Summary
01 Run BIST
02 Download Event data
04 Direct X10 Command
05 Set Time
06 Read Time
07 Read System Info
08 Clear Memory
09 Download refresh interval
0b Download X10 status
0e Get Timer
0f Download Flags
10 Upload Flags
11 Download Counters
12 Upload Counters
13 Download security seed
15 Upload Message Log
16 Clear Message Log
1a Stop Schedule
1b Start Schedule
1c Disable Megacontroller Echo
1d Enable Megacontroller Echo
1e Start X10 Signal test
1f Stop X10 Signal test
20 Fast Upload X10 status
23 Print X10 history
24 Store Schedule Name
25 DirectFlag Command
26 Direct Counter Command
28 IIC transmit Command
29 IIC receive Command
2a Is schedule running?
2c Return firmware version number
2d Modem Callback
2e Get Timer
2f Set Ringcount
30 Set Schedule Name
31 Network Reset
33 Read/Write I/O Struct byte
34 Read Internal IO Structure
35 Read/Write Time Label
36 Get Individual X10 Status
37 Enable/Disable Expansion Bus
38 Get Expansion Bus status
39 Set Retry/3 phase
3a reserved

3b reserved


xxxx dump internal data memory

 

BIST (Built in Self Test)

The BIST is a destructive test in that it will trash the data RAM but will leave the correct time in the RTC. Running BIST will set all parameters to their default states. BIST consists of the following tests:

1. Power Connections: Inherent because the test will not work if power is not being supplied to all components.

2. Serial port test: Inherent because the tester will use the serial port to initiate the BIST.

3. ROM checksum: This test will do a checksum of the ROM, hoping to catch any address and/or data line, ALE, shorts or un-connects.

4. RAM test: This test will write and read various RAM locations This is used to determine the RAM size and also RAM integrity.

5. RTC test: This test will write and read the clock chip and connections. It will attempt to keep the time intact.

6. X10 test: This test will check first to see if zero crossings are happening, then it will send out a P1 OFF, checking for a return P1 OFF.

Command Format:

##%01[cr]

TimeCommander will respond with text output showing status.

Default States

Refresh Interval 30

Security Interval 30

X10 Status bytes 0x01

X10 Retry 5

X10 3 Phase enabled

Answeronring 0

ModemInitString "AT"

X10 History cleared

Message Log cleared

 

 

 

 

Direct X10 Command

Direct command will allow an X10 command to be sent. After the command is sent an acknowledge will be returned. The format for direct command is:

##%04xxxx[cr]

where xxxx is an X10 command in hex format. The bit pattern is as follows :

zzzzzbbk kkkkhhhh

zzzzz = New Dim/Bri level *( unused if normal command)

if bb = 00, normal x10 type command

if bb = 01, the module will be set to IDLE.

if bb = 10, the module will be set to the dim/bright level that is specified in zzzzz

if bb = 11, reserved

kkkkk = keycode (hex)

hhhh = house code(hex)

[cr] carriage return

* to repeat a command, such as sending 3 DIM commands, the X10 command format is different:

zzzzbbbk kkkkhhhh

zzzz = Number of repeats - 1

bbb = reserved, set to 000

kkkkk = keycode (hex)

hhhh = house code(hex)

[cr] carriage return

 

House and unit codes used by the TimeCommander are coded as follows:

Figure 5: House and Unit Hex values

 

Below are some examples:

##%0400a6[cr] // command for A-7

##%040146[cr] // command for A-ON

##%04002d[cr] // command for L-15

##%04412d[cr] // command for ‘5’ L-DIM commands

For PCS modules only

to set B3 to 40%,

##%040047 // first send out B-3

##%042447 // then send out B-3 set level 40%

 

Set Time

The set time command will set the time and date of real-time clock inside of the unit. It will set the local clock as well as changing the time in the clock chip. When the unit receives this command, it will update the RTC with the time given, zeroing the seconds. The command for setting the clock is:

##%05AAAALLLLTTSSYYMMDDRRHHMMCC[cr]

where:

· AAAA - Latitude (hex)

· LLLL - Longitude (hex)

· TT - Timezone (hex)

· SS - Daylight savings time flag

bit 0 - Daylight Savings time Enabled

bit 4 - Set if Daylight savings time is in effect

· YY - Year (0-99 bcd)

· MM - Month (1-12 bcd)

· DD - Date (1-31 bcd)

· RR - Day of week (1-7)

· HH - Hour (0-23 bcd)

· MM - Minute (0-59 bcd)

· CC - checksum

The TimeCommander will respond with an acknowledge after receiving the command and setting the time.

 

Read Time

Read time will read the time and date of the TimeCommander. The command format is as follows:

##%06[cr]

The TimeCommander will respond with:

>YYMMDDRRHHMM[cr] (see Set time for description)

 

Return System Info

This command will prompt the TimeCommander to return the system information. The information consists of ROM version, amount of RAM available, last download date and file, etc.

##%07[cr]

The TimeCommander will return a text based data dump on the internal states.

 

Clear Schedule

The clear memory command will wipe out all of the TimeCommander schedule information. After the TimeCommander receives the command and clears the memory, it will respond with an acknowledge.

The command syntax for memory clear is:

##%08[cr]

 

Download Refresh Value

This command will download the refresh value interval that the TimeCommander uses to update the selected X10 devices. Any X10 device with it’s REF bit set will be refreshed at the end of the interval period.

##%09xx[cr]

where xx is the refresh interval in minutes (hex).

 

Download X10 Status

This will download the X10 status to initialize the TimeCommander's receive status array with pre-defined module status and identify whether it is a lamp module, frozen or plays catch-up after a power failure. After downloading the X10 status and before the schedule is started, TimeCommander will send the X10 command that will set the each defined device to the state specified in the status byte.

 

FIGURE 8: X10 Status Byte

Status Byte

 

The command syntax for X10 status download is:

##%0b[cr]

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `M' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `N' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `O' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `P' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `C' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `D' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `A' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `B' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `E' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `F' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `G' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `H' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `K' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `L' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `I' */

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[cr] /* housecode `J' */

Each ‘XX’ pair is the hex value of the status byte(shown above). The unit code order in each line is as follows:

13 14 15 16 3 4 1 2 5 6 7 8 11 12 9 10

 

Upload Timer information

The command syntax for Timer download is:

##%0e[cr]

The TimeCommander will respond with: (using same bit format as download)

XXXX[cr] /* timer 0 */

XXXX[cr]

XXXX[cr]

...

XXXX[cr] /* last timer*/

 

Download Flag information

The command syntax for Flag download is:

##%0fXX ... XX[cr] /* flag 0 being the first character */

 

Upload Flag Information

The command syntax for Flag upload is:

##%10[cr]

The TimeCommander will respond with:

###%10XX...XX[cr] /* flag 0 being the first character */

 

Download Variable information

The command syntax for Variable download is:

##%11[cr]

XX[cr] /* variable 0 in hex*/

XX[cr]

XX[cr]

...

XX[cr] /* last variable */

 

Upload Variable Information

The command syntax for Variable upload is:

##%12[cr]

XX[cr] /* variable 0 in hex*/

XX[cr]

XX[cr]

...

XX[cr] /* last variable */

 

Download Security Offset

The Security Offset is the outer limits that the security variation can be. For example, if the seed was 60 minutes, the security offset would be +/- 30 minutes from the compare time specified. The security seed has a legal range of 120 minutes, or +/- 60 minutes.

The command syntax for Message download is:

##%13xx[cr]

where xx is the security seed (hex)

 

Dump Message Log

This command will dump the message log. Each message has a time/date stamp as well as the message. The messages will be dumped starting with the oldest message in the log, ending with the newest. The command syntax for Dump Message Log is:

##%15[cr]

TimeCommander will respond with:

>##0 /* acknowledge */

MMDDYYHHMMSSxx..xx[cr] /* last message in que, cr terminated*/

MMDDYYHHMMSSxx..xx[cr]

MMDDYYHHMMSSxx..xx[cr]

...

MMDDYYHHMMSSxx..xx[cr] /*first message in que*/

##0[cr] /* acknowledge, signifies end of log */

MM = month, DD = day, YY = year, HH = hour, MM = mins, SS = sec, xx..xx = message string.

 

Clear Message Log

This command will clear the message log, resetting the que pointers.

##%16[cr]

 

Halt Schedule

This command will stop the Schedule.

##%1a[cr]

 

Start Schedule

This command will start the Schedule.

##%1b[cr]

 

Disable Echo Mode

This command will disable the Echo mode.

##%1c[cr]

 

Enable Echo Mode

This command will enable Echo mode. Any X10, flag, variable, etc., activity will be echoed through the serial port. The format of the Enable Echo Mode command is:

##%1d[cr] /* Echo enabled */

The format of the echoed command is:

!!mm/ddttttttjklm[cr]

where mm is the month(bcd), dd is the day(bcd), tttttt is the number of seconds since midnight (in decimal 10) and jklm is the TimeCommander activity(in hex) that was received. jklm can be decoded as follows:

j k l m (hex)

jjjj kkkk llll mmmm (bin)

 

jjjj = Echo command

hex binary

0x0 or (0000) == X10 activity

0x2 or (0010) == Timer

0x3 or (0011) == Flag

0x4 or (0100) == Variable

0x5 or (0101) == Relay Output

0x8 or (1000) == IR Output

0xa or (1010) == DI Input 1-8

0xc or (1100) == DI Input 9-16

kkkk, llll, mmmm are described below:

House and unit codes used by the TimeCommander are coded as follows:

Figure 6: House and Unit Hex values

Examples:

!!03/240336980064 // C1 received

!!03/2403369801C4 // C-OFF received

!!03/240336980833 // P-16 transmitted

!!03/240336980923 // P-DIM transmitted

 

Start X10 Signal Test

This command will start the X10 Signal Test. It will send out Unit/On/Off, Unit/On/Off sequences until it is stopped with the Stop X10 Signal command. The syntax for this command is:

##%1euuhh[cr]

where uu is the unit code, hh is the house code. See Figure 5: House and Unit Hex values, for the house and unit code hex values.

Example:

##%1e0603 /* uses P1 */

 

Stop X10 Signal Test

This command will stop the X10 Signal Test.

##%1f[cr]

 

Upload X10 status to host - Fast Mode

This command will instruct the TimeCommander to upload the X10 status using a condensed format to speed up the transfer. Note that only the device’s state is uploaded.

##%20[cr] /* Upload Command */


The TimeCommander will respond with:
xxxxxxxxxxxxxxxx[cr] /* Housecode A */
xxxxxxxxxxxxxxxx[cr] /* Housecode B */
xxxxxxxxxxxxxxxx[cr] /* Housecode C */

...


xxxxxxxxxxxxxxxx[cr] /* Housecode P */
where x = 0 for OFF
x = 1 for ON
x = 2 for IDLE

 


The positions for each unit are as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
x x x x x x x x x x x x x x x x [cr]

 

Trigger Then Macro

This command will instruct the TimeCommander to activate the specified Then Macro.

The format for this command is:

##%22xx[cr]

where xx = Then Macro number (position in database list)

 

Dump X10 History

This command will instruct the TimeCommander to dump out the contents of the X10 buffer.

The format for this command is:

##%23[cr]

The X10 buffer holds the last 200 X10 transmissions. The output from this command is in the same format as shown in the Echo mode.

 

Store Schedule Name

This command will store the schedule name. The schedule name will be shown when the system info is used. The format for this command is:

##%24ss...ss[cr]

where ss...ss is the schedule name.

Example: ##%24SUMMER[cr] // Store schedule name 'SUMMER'

The TimeCommander will respond with:

##0

 

Direct Flag Command

This command will instruct the TimeCommander to set/clear the specified flag.

>##%25xxyy[cr] /* Direct flag Command */

where xx is the flag number (hex)

where yy is the state to change the flag to. 00 = clear, 01 = set.

The TimeCommander will respond with:

##0

 

Direct Variable Command

This command will instruct the TimeCommander to modify a particular variable.

>##%26aabbcc[cr] /* Direct Variable Command */


aa - Variable number
bb - Load Value (if loading variable)
cc - *Variable CMD is:
0 - NOP
1 - Load Variable
2 - Clear Variable
3 - Increment Variable
4 - Decrement Variable

The TimeCommander will respond with:
##0

 

IIC Transmit Byte Command


Will send an IIC command/data. After the command is sent an acknowledge will be returned. The format for direct command is:

##%28aaxx[cr]


where aa is the IIC address in hex format.
xx is the IIC data byte to be sent in hex format.
The TimeCommander will respond with:
##0

 

IIC Receive Byte Command


Will send an IIC command and print the data that is returned. After the command is sent an acknowledge will be returned. The format for direct command is:

##%29aabb[cr]


where aa is the IIC address in hex format.

bb is the number of bytes to receive is hex format.


The TimeCommander will respond with:
###%29dd..dd
where dd is the data

 

Is Schedule Running


This command will return the 'Schedule Running' flag. The format for this command is:

##%2a[cr]


TimeCommander will reply with:
###%2a00 if schedule is stopped
###%2a01 if schedule is running

 

Return firmware version


This command will return the version of the firmware. The format for this command is:

##%2c[cr]


The TimeCommander will respond with a text string:
###%2cxxxx[cr] where xxxx is the version, i.e., 1.03

 

Modem Call Back Command


This command will enable the callback option. This will call back the number that is presented with this command using the parameters specified in the Modem Options. This command will cause the TimeCommander to send the modem the hang up command, wait 5 seconds, then dial the number specified. After the command is sent an, acknowledge will be returned. The format for this command is:

##%2dxx...xx[cr]

where xx....xx is the phone number with any delays, etc. Consult the Hayes command set for a list of modem commands.


The TimeCommander will respond with:

##0


Example: ##%2d5551212[cr] // set callback number to 555-1212

 

Get Timer


This command will return the Timer info. The format for this command is:
##%2exxxx[cr]
TBD

 

Store Ringcount


This command will store the Ringcount: The format for this command is:

##%2fxx[cr]

where xx is the Ringcount in hex.


Example: ##%2f05[cr] //set Ringcount to 5
The TimeCommander will respond with:
##0

 

Store Modem Init String


This command will store the Modem Init string. The Modem Init string will get sent to the serial port whenever TimeCommander receives characters that are not alpha-numeric, such as when a modem that may not be operating at 2400 baud. Due to the mismatched baud rate, the characters will be interpreted as non-alphanumeric, thus causing the Modem Init string to be sent which will sync the modem to 2400 baud. Note that when the self test is executed, the Modem Init string is loaded with the default 'AT'. The format for this command is:

##%30ss..ss[cr]

where ss...ss is the Modem Init string.


Example: ##%30ATS0=0[cr] // Set Init string to ‘ATS0=0’
The TimeCommander will respond with:
##0

 

Network Reset *


This command will send the Reset command to any or all I/O slave devices. Upon a valid acknowledge from the slave IO device, the internal status flag bit will be set. The format for this command is:

##%31xx[cr]


where xx is the slave address in hex, if xx = 00, all slaves will be reset.
When complete, the TimeCommander will respond with:
##0

 

Read/Write I/O Structure *


This command will read or write a byte of data in an internal structure in TimeCommander. The format for this command is:

##%33xxiimmdd[cr]


xx is the I/O Structure offset, if the MSB is 0, this is a write command, if 1 it is a read command. ii is the offset into the I/O structuremm is the mask byte, only those bits set will be affected

dd is the data byte, any bit with it’s mask bit set will be changed to the value in the data byte.

(See here for examples and descriptions of the IO structures).


The TimeCommander will respond with ##0 for a write command, and ###%33dd for a read command, dd being the data.

 

Read IO Structure *


This command will read the internal IO structures associated with each IO device.
The format for this command is:

##%34xx[cr]


where xx is the slave address in hex (see page 25 for Slave addresses)
When complete, the TimeCommander will respond with:
##0

 

Read/Write Time Label *


This command will read/write a time label. The format for this command is:
##%35ttxxyydd[cr]
tt: Time label number
xx: Time Label high byte
yy: Time label low byte

dd: days Bitvalue


When complete, the TimeCommander will respond with:
##0

 

Get X10 Status *


This command will get the status of an individual X10 address. The format for this command is:

##%36hhuu[cr]


where hh is the housecode, uu is the unitcode. These are hex values(see page 11 for House/Unit to hex). Example:
##%36060a[cr] /* get status for A7
##%360901[cr] /* get status for F14
TimeCommander will respond with:
xxyy
where xx is the status byte (see page 6) and yy is the dimstatus byte (page 7).

 

Enable/Disable Expansion Bus *


This command can enable or disable the Expansion bus on the TimeCommander. The format for this command is:
##%3700[cr] to disable
##%3701[cr] to enable
When complete, the TimeCommander will respond with:
##0

 

Bus Fault Check *


This command will return a value based on whether an Expansion bus Bus-fault is occurring. The format for this command is:
##%38[cr]
TimeCommander will respond with a '1' if a bus fault exists, a '0' if no bus fault exists.

 

Performance Monitor


This command will count the number of milliseconds for 1 pass through a schedule in increments of 70 ms. Note that this includes the time spent polling the slaves at the beginning of the Eval cycle.
The format for this command is:
xxxx[cr]

 

 

* Available in firmware version 2.10 and above.

 

 

Acknowledge


Acknowledge is used by the TimeCommander as a handshaking means. It also will contain status information concerning the last communication between the host and the TimeCommander. The command syntax is as follows:
##x[cr]
· x = 0 : OK - This is sent out after every line of data sent by the host machine used as a form of handshaking.
x = 1 : Bad checksum
x = 2 : insufficient memory to store last event
x = 3 : byte count mismatch
x = 4 : invalid command

Invalid commands will not have any status sent back, because a modem echoes any text back, this causes an endless loop.

 

 

I/O Addresses

 

TimeCommander keeps shadow registers of the dedicated I/O. This is needed to reduce the network bus traffic as TimeCommander does a read and write only once per pass through a schedule. Since all of the IO’s inputs are buffered, transitions at the inputs will not be missed.

At the beginning of the schedule, TimeCommander reads the Inputs and the A/D converters and stores the results into the shadow registers. The schedule then references the registers instead of sending out network read commands. At the end of the schedule pass, the Outputs are written to the I/O devices with relays if a change was made in a schedule.

 

I/ODevice

Offset

TimeCommander-Plus

0x00

reserved

0x01

IO Xpander -1

0x02

IO Xpander -2

0x03

IO Xpander -3

0x04

IO Xpander -4

0x05

DI Xpander-1

0x06

DI Xpander-2

0x07

DI Xpander-3

0x08

DI Xpander-4

0x09

RO Xpander-1

0x0a

RO Xpander-2

0x0b

RO Xpander-3

0x0c

RO Xpander-4

0x0d

 

 

 

Internal Data Structures

TimeCommander keeps status of each I/O device in it's internal data memory. This status gets updated at the start of each pass through the schedule. This information can be read/written using command ‘Read/Write I/O Structure’ described on page 22. The offsets into the I/O Device’s status structure is shown below:

 

12 Table 1 IO Structure Offsets

Byte Offset Name Description
TCM-Plus & IO Xpander

DI Xpander

RO Xpander
0x00 Digital Inputs 1-8 Current Digital Input 1-8 status yes yes no
0x01 Digital Inputs 9-16 Current Digital Input 9-16 status yes no no
0x02 Relay Outputs 1-8 Current Relay Status (read only) yes no yes
0x03 Raw A/D 1 Raw A/D Value yes no no
0x04 Raw A/D 2 Raw A/D Value yes no no
0x05 Raw A/D 3 Raw A/D Value yes no no
0x06 Raw A/D 4 Raw A/D Value yes no no
0x07 Raw A/D 5 Raw A/D Value yes no no
           
0x08 Raw A/D 6 Raw A/D Value yes no no
0x09 Raw A/D 7 Raw A/D Value yes no no
0x0a Raw A/D 8 Raw A/D Value yes no no
0x0b IO Status
bit 0 set if IO Device detected, bit 4 set if IO Device is used in schedule
yes yes yes
0x0c reserved   no no no
0x0d Scaled A/D 1 Scaled A/D Value yes no no
0x0e Scaled A/D 2 Scaled A/D Value yes no no
0x0f Scaled A/D 3 Scaled A/D Value yes no no
           
0x10 Scaled A/D 4 Scaled A/D Value yes no no
0x11 Scaled A/D 5 Scaled A/D Value yes no no
0x12 Scaled A/D 6 Scaled A/D Value yes no no
0x13 Scaled A/D 7 Scaled A/D Value yes no no
0x14 Scaled A/D 8 Scaled A/D Value yes no no
0x15 DI 1-8 Toggle Byte Bits set if Inputs changed since last IO read yes yes no
0x16 DI 9-16 Toggle Byte Bits set if Inputs changed since last IO read yes no no
0x17 Inputs 1-8 Prev Byte IO status from previous IO read yes yes no
           
0x18 Inputs 9-16 Prev Byte IO status from previous IO read yes no no
0x19 Relay 1-8 New Byte Set these bits to change relay status yes no yes
0x1a A/D 1 Gain A/D Gain factor yes no no
0x1b A/D 2 Gain A/D Gain factor yes no no
0x1c A/D 3 Gain A/D Gain factor yes no no
0x1d A/D 4 Gain A/D Gain factor yes no no
0x1e A/D 5 Gain A/D Gain factor yes no no
0x1f A/D 6 Gain A/D Gain factor yes no no
           
0x20 A/D 7 Gain A/D Gain factor yes no no
0x21 A/D 8 Gain A/D Gain factor yes no no
0x22 A/D 1 Offset A/D Offset yes no no
0x23 A/D 2 Offset A/D Offset yes no no
0x24 A/D 3 Offset A/D Offset yes no no
0x25 A/D 4 Offset A/D Offset yes no no
0x26 A/D 5 Offset A/D Offset yes no no
0x27 A/D 6 Offset A/D Offset yes no no
0x28 A/D 7 Offset A/D Offset yes no no
0x29 A/D 8 Offset A/D Offset yes no no

 

 

 

Examples:


Using the Read/Write IO Structure command:
##%33xxiimmdd[cr]
xx is the I/O Structure offset, if the MSB is 0, this is a write command, if 1 it is a read command. ii is the offset into the I/O structure
mm is the mask byte, only those bits set will be affected.
dd is the data byte, any bit with it’s mask bit set will be changed to the value in the data byte.

The TimeCommander will respond with ##0 for a write command, and ###%33dd for a read command, dd being the data in hex.

 


Example 1:   Set Relay7 on a TimeCommander-Plus
##%3300194040
0x00 is the IO Struct offset for TimeCommander-Plus
0x19 is the offset into the IO structure to change a relay
0x40 is the mask byte, it cooresponds to Relay 7

0x40 is the data byte, Relay 7 will be set only if it’s mask bit is set as well.


Example 2:   Clear Relay4 on IO Xpander-3
##%3304194000
0x04 is the IO Struct offset for IO Xpander-3
0x19 is the offset into the IO structure to change a relay
0x08 is the mask byte, it cooresponds to Relay 4
0x00 is the data byte, any bit with the mask bit set will be cleared.

Example 3:   Read the scaled A/D value for A/D 1 on the TimeCommander-Plus
##%33800d0000
0x80 ; 0x00 is the offset for TimeCommander-Plus, the MSB is set to signify a read command
0x0d is the offset into the IO structure for Scaled A/D 1
0x00 this byte is not used for reads
0x00 this byte is not used for reads

If the Scaled A/D1 value was 70, TimeCommander will respond with ###%3346, where 46 is the A/D value in hex (70 decimal)


Example 4:   Read the Digital Inputs for DI Xpander-2
##%3387000000
0x87 ; 0x07 is the offset for DI Xpander-2, the MSB is set to signify a read command
0x00 is the offset into the IO structure for Digital Inputs 1-8
0x00 this byte is not used for reads
0x40 this byte is not used for reads

In this example, TimeCommander will respond with ###%3383, where 83 is the hex representation of the Digital Inputs, in this case, Inputs 1,2 and 8 are set (Hex 83 in binary is 10000011), the rest are clear.

 

 

 

___________________________
1 2

 

 

 

1.1.1    Get Controller Type


Description

The command returns the Controller type, TimeCommander, TimeCommander Plus, STARGATE Lite or STARGATE.


Prototype

##%03[cr]


Return Value
###0301[cr] // for TimeCommander
###0302[cr] // for TimeCommander Plus
###0304[cr] // for STARGATE Lite
###0308[cr] // for STARGATE

 

 

1.1.2   Advanced X10 Command (Version 2.40 and higher)


Description

The Advanced X10 Command is new since version 2.40 and allows advanced X10 commands such as the Leviton 6381 extended preset codes. After the command is sent an acknowledge will be returned. The format for Advanced X10 command is:


Prototype
##%2bxxhhkkllddcc[cr]
xx = X10 Command
hh = housecode
kk = keycode (unitcode or function)
ll = level
dd = extended data
cc = extended command

 

xx = X10 Command

Description

Example

00 = DIRECTCMD

Sends House-Keycode as shown in the table below.

##%2b000606000000

sends A-1

##%2b000610000000

sends A-All Units Off

01 = UNITONLY

Sends House-Unit only, ie, A-1

##%2b010606000000

sends A-1

02 = COMMAND

Sends House-Unit House-Function, ie, A-1 A-ON. ll = 01 for OFF

ll = 02 for ON

##%2b020606020000

sends A-1 A-ON

##%2b020705010000 sends B-4 B-OFF

05 = BRI

Sends House-Unit House-BRI number of times specified in ll field, ie, A-1 A-BRI A-BRI

##%2b050703010000

sends B-16 B-BRI 1 time

##%2b050703080000

sends B-16 B-BRI 8 times

06 = DIM

Sends House-Unit House-DIM number of times specified in ll field, ie, A-1 A-DIM A-DIM

##%2b060703010000

sends B-16 B-DIM 1 time

##%2b060703080000

sends B-16 B-DIM 8 times

08 = SETLEVEL

SetLevel uses DIM/BRI commands to set a module to a brightness level. It bases the brightness level on how many DIM/BRI commands it has previously sent. SetLevel values range from 0 – 20, 0 = 0%, 20 = 100%. The ll field contains the SetLevel value.

##%2b08050e000000

sets D-9 to 0% level

##%2b08050e0a0000

sets D-9 to 50% level

##%2b08050e140000

sets D-9 to 100% level

09 = PRESETLEVEL

Set a module to a brightness level using the X10-Preset commands. Preset levels range from 0 – 31, 0 = 0%, 31 = 100%. The ll field contains the PreSetLevel value.

##%2b09050e1f0000

sends D-9 Preset 100%

##%2b09050e000000

sends D-9 Preset 0%

0a = TOGGLE

Toggle the current state of the module, if it is OFF, send an House-Unit House-ON command, if ON send a House-Unit House-Off command.

if E-6 is ON

##%2b0a0809000000

sends E-6 E-OFF

0b = REFRESHMOD

Refresh the current state. Sends the command to set the module to the state that TimeCommander thinks it is in.

if E-6 is ON

##%2b0b0809000000

sends E-6 E-ON

16 = LEVXTEND

Set a module to a brightness level using the X10-Extended Code Preset commands. Preset levels range from 0 – 63, 0 = 0%, 63 = 100%. The dd field contains the PreSetLevel value, the cc field contains the Extended Code command (0x31) for PresetLevel.

##%2b16040b003e31

sends C-Extended Code for C-8 Preset 98%

##%2b16040b003f31

sends C-Extended Code for C-8 Preset 100%

##%2b16040b000031

sends C-Extended Code for C-8 Preset 0%

 

House and unit codes used by the TimeCommander are coded as follows:

Figure 1: House and Unit Hex values


Return Value

##0


 

 

1.1.3   Return firmware version


Description

This command will return the version of the firmware. The format for this command is:


Prototype

##%2c[cr]


Return Value

xxxxx[cr] where xxxx is the version, i.e., 2.40d