CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


Sidebar

hardware:cflink:input-output-io-module-cflink-protocol

This is an old revision of the document!


Input/Output (IO) Module CFLink Protocol

The following documentation describes the CFLink protocol for modular IO devices.

Common Definitions

Port Modes

Throughout this document, the configuration and status of each port <MODE> and it's associated <STATE> refers to the following possibilities:

  • <MODE> = Single uppercase char:
    • D = Dry contact input (Default mode), <STATE> = 0 for Open, 1 for Closed.
    • R = Resistance reading input, <STATE> = 000-100 (0 to 10,000 Ohms in 100 Ohm increments)
    • A = Analog Voltage reading input, <STATE> = 000-100 (00.0 to 10.0 Volts DC in 0.1 Volt increments)
    • V = Digital Voltage reading input, <STATE> = 0 for voltage below threshold, 1 for voltage equal to or above threshold
    • S = Video Sensing input, <STATE> = 0 for no video sensed, 1 for video sensed.
    • E = External relay control output, 0-24V DC (external power supply required), <STATE> = 0 for OFF, 1 for ON.
    • L = LED output (1mA), <STATE> = 0 for OFF, 1 for ON.

Queries

STA - Query Status

The STA (Status) query returns the status of all IO ports in a single module.

Data


> [F2]<ID>[F3]QIOXSTA[F4]<MODULE>[F5][F5]

  • <MODULE> = The module number to request the status of. 2 chars, uppercase 'M' followed by the module number.
    • eg. M1 = Module 1, M4 = Module 4.

Reply

< [F2]<ID>[F3]RIOXSTA[F4]<MODULE>|<IODATA>[F5][F5]

  • <IODATA> = For each IO port in the module, the port status is returned in P##:<MODE>:<STATE> format.
    • <MODE> = Single uppercase char. Refer to Common Definitions - Port Modes for more information on the possible modes and states.

Example

// Query the state of IO ports in Module 2 of a modular device on CFLink ID [04]
> [F2][04][F3]QIOXSTA[F4]M2[F5][F5]
// Reply, Module has 8 IO ports
< [F2][04][F3]RIOXSTA[F4]M2|P01:D:0|P02:D:1|P03:R:010|P04:V:125|P05:E:0|P06:L:1|P07:D:0|P08:S:1[F5][F5]
// Port 1 = Dry contact, Off
// Port 2 = Dry contact, On
// Port 3 = Resistence, 1000 Ohm reading
// Port 4 = Voltage, 12.5V reading
// Port 5 = External relay control, Off
// Port 6 = LED ouput, On
// Port 7 = Dry contact, Off
// Port 8 = Video Sense, video signal present.

Error

  • 004 = Invalid Module Number

PRT - Query Port Settings

The PRT (Port) query returns the configuration for all IO ports in a single module.

Data

> [F2]<ID>[F3]QIOXPRT[F4]<MODULE>[F5][F5]

  • <MODULE> = The module number to request the port configuration of. 2 chars, uppercase 'M' followed by the module number.
    • eg. M1 = Module 1, M4 = Module 4.

Reply

< [F2]<ID>[F3]RIOXPRT[F4]<MODULE>|<PORT_CONFIG>[F5][F5]

  • <PORT_CONFIG> = For each IO port in the module, the port configuration is returned in P##:<MODE>:<MIN_CHANGE>:<POWER_ON_STATE> format.
    • <MODE> = Single uppercase char. Refer to Common Definitions - Port Modes for more information on the possible modes and states.
    • <MIN_CHANGE> = The minimum change the port must read before sending a notification message.
      • 0 means reporting on change is disabled, and on change reporting can be disabled on a module level as well.
      • 0 (zero) is always returned for ports in modes D, E and L.
    • <POWERONSTATE> = The state the port will be in when the unit is powered up.
      • 0 (zero) is always returned for ports in modes D, R and V.

Example

// Query the configuration of IO ports in Module 1 of a modular device on CFLink ID [04]
> [F2][04][F3]QIOXPRT[F4]M1[F5][F5]
// Reply, Module has 8 IO ports
< [F2][04][F3]RIOXPRT[F4]M1|P01:D:0:0|P02:D:0:0|P03:R:15:0|P04:V:12:0|P05:E:0:0|P06:L:0:1|P07:D:0:0|P08:D:0:0[F5][F5]
// Port 1 = Dry contact
// Port 2 = Dry contact
// Port 3 = Resistence, 1500 Ohm minimum change
// Port 4 = Voltage, 1.2 V minimum change
// Port 5 = External relay control, Power On State = Off
// Port 6 = LED ouput, Power On State = On
// Port 7 = Dry contact
// Port 8 = Dry contact

Error

  • 004 = Invalid Module Number

CFG - Query Configuration

The CFG (Configuration) query returns the configuration of a single IO module.

Data

> [F2]<ID>[F3]QIOXCFG[F4]<MODULE>[F5][F5]

  • <MODULE> = The module number to request the module configuration of. 2 chars, uppercase 'M' followed by the module number.
    • eg. M1 = Module 1, M4 = Module 4.

Reply

< [F2]<ID>[F3]RIOXCFG[F4]<MODULE>:<ENABLED>:<REPORT_ON_CHANGE>:<REPORT_INTERVAL>[F5][F5]

  • <ENABLED> = This reports if the module is enabled or disabled for input reading (and hence disable reporting notifications). Disabling a module is great for trouble shooting to silence the module on the CFLink bus without having to physically unplug it. Single digit, 0 = disabled, 1 = enabled.
  • <REPORTONCHANGE> = This reports if the module allows for any IO ports to force a status notification when its input value changes.
    • The minimum change setting for a port must be reached before any notification will be sent.
    • If this is disabled, all port minimum change settings will be ignored.
    • 0 = Disable report on change, 1 = Enable report on change.
  • <REPORT_INTERVAL> = The interval at which the module will report it's status. 5 digits, representing 0 - 9999.9 seconds (100ms increments).
    • 00000 = Module will not report on any interval (disabled).
    • 00001 = Module will report every 0000.1 seconds (100ms).
    • 00600 = Module will report every minute.
    • 36000 = Module will report every hour.
    • 99999 = Module will report every 9999.9 seconds (2h46m39s900ms or 9,999,900ms)
    • There is a great online calculator here for converting this value into h:m:s (simply enter ::9999.9 to see the max range for example)

Example

// Query the configuration of Module 1 of a modular device on CFLink ID [04]
> [F2][04][F3]QIOXCFG[F4]M1[F5][F5]
// Reply
< [F2][04][F3]RIOXCFG[F4]M1:1:1:36000[F5][F5]
// IO module is enabled, report on change is enabled, reports status every hour.

Error

  • 004 = Invalid Module Number

Configuration Messages

PRT - Configure Port Settings

The PRT (Port) command is used to configure the settings of all IO ports in one or more modules.
If some IO port configurations are to remain unchanged, simply omit them from the message.

Data

> [F2]<ID>[F3]CIOXPRT[F4]<MODULE>|<PORT_CONFIG>[F5][F5]

  • <PORT_CONFIG> = See the definition under the PRT Query for more details.

Reply

The changes take affect immediately. See the PRT Query Reply for more details.

Example

// Set IO ports for module 1 in a modular device on CFLink ID [05] as follows:
// Port 1 = Dry contact
// Port 2 = Dry contact
// Port 3 = Resistence, 1500 Ohm minimum change
// Port 4 = Voltage, 1.2 V minimum change
// Port 5 = External relay control, Power On State = Off
// Port 6 = LED ouput, Power On State = On
// Port 7 = Dry contact
// Port 8 = Dry contact
> [F2][05][F3]CIOXPRT[F4]M1|P01:D:0:0|P02:D:0:0|P03:R:15:0|P04:V:12:0|P05:E:0:0|P06:L:0:1|P07:D:0:0|P08:D:0:0[F5][F5]
// Reply
< [F2][05][F3]RIOXPRT[F4]M1|P01:D:0:0|P02:D:0:0|P03:R:15:0|P04:V:12:0|P05:E:0:0|P06:L:0:1|P07:D:0:0|P08:D:0:0[F5][F5]

hardware/cflink/input-output-io-module-cflink-protocol.1345698917.txt.gz · Last modified: 2012/08/23 05:15 by aaron