CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


Sidebar

hardware:cflink:sw16-cflink-protocol

SW16 CFLink Protocol

This document details the CFLink protocol for the SW16 device.

Queries

STA - Query Input Status

The STA (Status) query returns the states of all the dry contact inputs.

Data

< [F2]<ID>[F3]RSWXSTA[F4]P01:<STATE>|P02:<STATE>|P03:<STATE>|P04:<STATE>|P05:<STATE>|P06:<STATE>|P07:<STATE>|P08:<STATE>|P09:<STATE>|P10:<STATE>|P11:<STATE>|P12:<STATE>|P13:<STATE>|P14:<STATE>|P15:<STATE>|P16:<STATE>[F5][F5]

  • <STATE> = The current state of each dry contact input:
    • 0 = open, off.
    • 1 = closed, on.

Example

// States returned for SW16 on CFLink ID [22]
< [F2][22][F3]RSWXSTA[F4]P01:1|P02:0|P03:0|P04:0|P05:0|P06:0|P07:0|P08:0|P09:0|P10:0|P11:0|P12:0|P13:0|P14:0|P15:0|P16:0[F5][F5]
// Port 1 is closed, on.
// Ports 2-16 are open, off.

LED - Query LED States

The LED query returns the states of all the LEDs (except backlight LEDs).

Data

> [F2]<ID>[F3]QSWXLED[F4][F5][F5]

Reply

< [F2]<ID>[F3]RSWXLED[F4]<PORT>:<STATE>:<LEVEL>[F5][F5]

The reply will include data for all ports of the device. So for the SW16, there will be 16 sets of port data, separated by single pipe |.

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <STATE> = The current action state of the LED:
    • X = Not changing
    • B = Blinking
    • D = Dimming
    • P = Pulsing
    • R = Ramping
  • <LEVEL> = The level of the LED brightness, 0 to 100.


Note that the LED level

Example

// Request the LED states of a SW16 on CFLink ID [22]
> [F2][22][F3]QSWXLED[F4][F5][F5]
// Returns states for all 16 LEDs
< [F2][22][F3]RSWXLED[F4]P01:X:0|P02:X:100|P03:D:50|P04:D:20|P05:B:0|P06:B:70|P07:P:0|P08:P:68|P09:X:0|P10:X:0|P11:X:0|P12:X:0|P13:X:0|P14:X:0|P15:X:0|P16:X:0[F5][F5]

BKL - Query Backlight LED States

The BKL (Backlight) query returns the states of all the backlight LEDs.

Data

> [F2]<ID>[F3]QSWXBKL[F4][F5][F5]

Reply

< [F2]<ID>[F3]RSWXBKL[F4]<PORT>:<STATE>:<LEVEL>[F5][F5]

BKL - Query Backlight LED States

The BKL (Backlight) query returns the states of all the backlight LEDs.

Data

> [F2]<ID>[F3]QSWXBKL[F4][F5][F5]

Reply

< [F2]<ID>[F3]RSWXBKL[F4]<PORT>:<STATE>:<LEVEL>[F5][F5]

The reply will include data for all backlight LEDs of the device. So for the SW16, there will be 4 sets of port data, separated by single pipe |.

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <STATE> = The current action state of the backlight LED:
    • X = Not changing
    • B = Blinking
    • D = Dimming
    • P = Pulsing
    • R = Ramping
  • <LEVEL> = The level of the backlight LED brightness, 0 to 100.

Example

// Request the backlight LED states of a SW16 on CFLink ID [22]
> [F2][22][F3]QSWXBKL[F4][F5][F5]
// Returns states for all 4 LEDs
< [F2][22][F3]RSWXBKL[F4]P01:X:0|P02:P:100|P03:D:50|P04:B:20[F5][F5]

Transmission Messages

LED - Set LED States

The LED command is used to set the states of one or more of the 16 LED channels on the SW16.

Data

The LED command can be used to change the LED states in a variety of ways, including basic on/off/toggle, and more advanced blinking, dimming and ramping.
Combine multiple LED port changes by using the port separator character, | (single pipe).

On, Off, Toggle

> [F2]<ID>[F3]TSWXLED[F4]<PORT>:<STATE>[F5][F5]

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <STATE> = The state to set the LED to
    • 0 = Off
    • 1 = On
    • T = Toggle (invert the LED state, on if it was off, off if it was on)
Pulse

> [F2]<ID>[F3]TSWXLED[F4]<PORT>:P:<TIME>[F5][F5]

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <TIME> = The time to pulse the LED on for, in a resolution of 0.1 seconds. Min 0 seconds, Max 999.9 seconds
    • 10 = 1 second
    • 100 = 10 seconds
    • 9999 = 999.9 seconds
Blinking, Dimming

> [F2]<ID>[F3]TSWXLED[F4]<PORT>:<MODE>:<MIN_LEVEL>:<MAX_LEVEL>:<TIME_ON>:<TIME_OFF>:<COUNT>[F5][F5]

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <MODE> = Dim or blink
    • B = Blink (no fading between levels, instant change to min and max levels)
    • D = Dim (fade between mid and max levels)
  • <MIN_LEVEL> = The minimum level to set the LED when blinking/dimming. Range from 0 to 100.
  • <MAX_LEVEL> = The maximum level to set the LED when blinking/dimming. Range from 0 to 100.
  • <TIME_ON> = The time taken to reach max level when dimming, or the time to remain at max level when blinking. In a resolution of 0.1 seconds. Min 0 seconds, Max 999.9 seconds
    • 15 = 1.5 second
    • 105 = 10.5 seconds
    • 9999 = 999.9 seconds
  • <TIME_OFF> = The time taken to reach min level when dimming, or the time to remain at min level when blinking. In a resolution of 0.1 seconds. Min 0 seconds, Max 999.9 seconds
    • 15 = 1.5 second
    • 105 = 10.5 seconds
    • 9999 = 999.9 seconds
  • <COUNT> = The number of times to blink/dim. This parameter is optional and can be omitted, resulting in continuous blinking/dimming (same as specifying a count of zero)
    • 1 = Blink/Dim to max level and back to min level once.
    • 5 = Blink/Dim to max level and back to min level 5 times.
    • 0 = Blink/Dim continuously, until state is changed by another command.
Ramping

> [F2]<ID>[F3]TSWXLED[F4]<PORT>:R:<LEVEL>:<TIME>[F5][F5]

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <LEVEL> = The level to ramp the LED to. Range from 0 to 100.
  • <TIME> = The time taken to reach the desired level. In a resolution of 0.1 seconds. Min 0 seconds, Max 999.9 seconds
    • 15 = 1.5 second
    • 105 = 10.5 seconds
    • 9999 = 999.9 seconds

Reply

See LED Query Reply for more information.

Example

// Change the state of 6 LEDs on a SW16 on CFLink ID [22]
> [F2][22][F3]TSWXLED[F4]P01:T|P02:1|P03:P:100|P04:B:10:88:10:10|P05:D:0:100:10:20:3|P06:R:55:33[F5][F5]
// LED 1 = Toggle
// LED 2 = On
// LED 3 = Pulse on for 10 seconds
// LED 4 = Blink at min level of 10 for 1 second, max level of 88 for 1 second, continuously.
// LED 5 = Dim to min level of 0 over 1 second, then to max level of 100 over 2 seconds, 3 times.
// LED 6 = Ramp to a level of 55 over a period of 3.3 seconds.

BKL - Set Backlight State

The BKL (Backlight) command is used to set the state of one or more of the 4 backlight LED channels.
It uses the exact same options as the LED command, so see the ''LED'' command for more details.

Notifications

CHA - Input State Change

The CHA (Change) notification is sent out any time a dry contact input on the SW16 changes state.
This notification only contains the state for the port that actually changed.

Data

> [F2]<ID>[F3]RSWXCHA[F4]<PORT>:<STATE>[F5][F5]

  • <PORT> = The port number in P## format. Eg. Port 1 is P01.
  • <STATE> = The current state of the dry contact input:
    • 0 = open, off.
    • 1 = closed, on.

Example

// Input 1 is closed on SW16 on CFLink ID [22]
< [F2][22][F3]RSWXCHA[F4]P01:1[F5][F5]

// Input 1 is opened on SW16 on CFLink ID [22]
< [F2][22][F3]RSWXCHA[F4]P01:0[F5][F5]

STA - Input States

The STA (Status) notification is sent out any time a dry contact input on the SW16 changes state or the input states are queried.
This notification contains the state of all ports at once, separated using the port separator character, | (single pipe).

Data

< [F2]<ID>[F3]RSWXSTA[F4]P01:<STATE>|P02:<STATE>|P03:<STATE>|P04:<STATE>|P05:<STATE>|P06:<STATE>|P07:<STATE>|P08:<STATE>|P09:<STATE>|P10:<STATE>|P11:<STATE>|P12:<STATE>|P13:<STATE>|P14:<STATE>|P15:<STATE>|P16:<STATE>[F5][F5]

  • <STATE> = The current state of each dry contact input:
    • 0 = open, off.
    • 1 = closed, on.

Example

// States returned for SW16 on CFLink ID [22]
< [F2][22][F3]RSWXSTA[F4]P01:1|P02:0|P03:0|P04:0|P05:0|P06:0|P07:0|P08:0|P09:0|P10:0|P11:0|P12:0|P13:0|P14:0|P15:0|P16:0[F5][F5]
// Port 1 is closed, on.
// Ports 2-16 are open, off.

hardware/cflink/sw16-cflink-protocol.txt · Last modified: 2012/09/05 13:17 by jarrod