This shows you the differences between two versions of the page.
hardware:cflink:din-ry-cflink-protocol [2019/08/28 02:51] terrylau |
hardware:cflink:din-ry-cflink-protocol [2021/04/28 15:00] (current) terrylau Control Port Configuration |
||
---|---|---|---|
Line 2: | Line 2: | ||
====== DIN-RY CFLink Protocol ====== | ====== DIN-RY CFLink Protocol ====== | ||
- | The following documentation is for the DIN-RYx-N devices CFLink protocol messages. | + | The following documentation is for the DIN-RYx-N devices CFLink protocol messages. This protocol can be used regardless of connection method to the DIN-RYx device either via USB, RS232 or RS485. |
+ | |||
+ | ===== Control Port Configuration ===== | ||
+ | |||
+ | This command is used to configure the communication properties for each control port on the unit. | ||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]CCFXSPC[F4]<PORT>:<MODE>:<BAUD>:<DATABITS>:<PARITY>:<STOP>:<FLOW CONTROL>[F5][F5] | ||
+ | </sxh> | ||
+ | |||
+ | * **<PORT>** would be designated as: | ||
+ | * P01 = RS232 IN | ||
+ | * P02 = RS485 IN | ||
+ | * P03 = RS485 OUT | ||
+ | * P04 = RS232 OUT | ||
+ | * PZZ = All Ports | ||
+ | |||
+ | * **<MODE>** would be designated as: | ||
+ | * BUS (Bus Mode) - Messages are to be treated as control protocol commands and forwarded along the bus as per the Message Handling documentation. Available <BAUD> rates would be 115200 (default) and 38400. | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2][20][F3]CCFXSPC[F4]P04:BUS:115200:8:N:1:0[F5][F5] | ||
+ | </sxh> | ||
+ | |||
+ | * EXT (External Mode) - Messages sent to/from a third party device, allowing control of other RS232 or RS485 devices via rules and macros. Available <BAUD> rates would be: | ||
+ | * 100 | ||
+ | * 600 | ||
+ | * 1200 | ||
+ | * 2400 | ||
+ | * 4800 | ||
+ | * 9600 (Default for EXT mode) | ||
+ | * 14400 | ||
+ | * 19200 | ||
+ | * 38400 | ||
+ | * 57600 | ||
+ | * 115200 | ||
+ | * 128000 | ||
+ | * 256000 | ||
+ | |||
+ | * CFL (CFLink Mode) - Messages sent to/from the CFLink Bus, allowing control of other CFLink devices via rules and macros. 115200 is the default <BAUD> rate. Note that CFLink mode connection is only available for RS485-In port. | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2][20][F3]CCFXSPC[F4]P02:CFL:115200:8:N:1:0[F5][F5] | ||
+ | </sxh> | ||
+ | |||
+ | === Query Port Configuration === | ||
+ | This command is used to query and get the current port settings for each control port on the unit. | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]QCFXSPC[F4]<PORT>[F5][F5] \\ Query status of individual ports | ||
+ | > [F2]<ID>[F3]QCFXSPC[F4][F5][F5] \\ Query status of all ports | ||
+ | </sxh> | ||
+ | |||
+ | === Sending Command to Control External Devices === | ||
+ | |||
+ | This command is used to send data to control the external device depending on the port used. | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]TCFXSPW[F4]<PORT>:<DATA>[F5][F5] | ||
+ | </sxh> | ||
===== Relay Commands ===== | ===== Relay Commands ===== | ||
Line 28: | Line 86: | ||
To minimize the data traffic on the communication bus, the ''RRLYCHA'' will only reflect the affected ports only. It will also be sent as unsolicited messages when buttons on the display panel are set. The ''RRLYSTA'' reply will have all port status, separated by pipes. | To minimize the data traffic on the communication bus, the ''RRLYCHA'' will only reflect the affected ports only. It will also be sent as unsolicited messages when buttons on the display panel are set. The ''RRLYSTA'' reply will have all port status, separated by pipes. | ||
- | ===== DRY CONTACTS ===== | + | ===== Dry Contacts ===== |
==== Status Read ==== | ==== Status Read ==== | ||
Line 154: | Line 212: | ||
</sxh> | </sxh> | ||
+ | ===== AC Load Status Read ===== | ||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]QCFXACS[F4]<PORT>:<STATE>[F5][F5] \\ Query AC Load Status | ||
+ | > [F2]<ID>[F3]RCFXACS[F4]<PORT>:<STATE>[F5][F5] \\ Reply | ||
+ | </sxh> | ||
+ | ===== Conditional commands based on variable states ===== | ||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]TCFXCON[F4]<CONDITION>[F6]<ACTION>[F5][F5] \\ Send | ||
+ | > [F2]<ID>[F3]RCFXCON[F4]<BOOLEAN>[F5][F5] \\ Reply | ||
+ | </sxh> | ||
+ | |||
+ | Example of command syntax to send: | ||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]TCFXCON[F4]<VARIABLE><OPERATOR><VALUE>[F6]<TARGET_ID>:<COMMAND>:<DATA>[F5][F5] \\ Syntax | ||
+ | > [F2]<ID>[F3]TCFXCON[F4]01==1[F6]00:TRLYSET:M2|P02:1[F5][F5] | ||
+ | > [F2]<ID>[F3]RCFXCON[F4]TRUE[F5][F5] \\ Reply | ||
+ | </sxh> | ||
+ | |||
+ | * \xF6 splits the condition and the action. It is a single hex byte. The first \xF6 byte in the data should be considered the split location, so that the actual action can contain any byte including \xF6. | ||
+ | * <DATA> can contain anything, except \xF5\xF5, including additional colons. | ||
+ | * <VARIABLE> the data represents the variable type and variable character to get the value of, AA-ZZ. This allows you to compare a variable value in the condition. | ||
+ | * Built in variables for this device are: | ||
+ | * 00 = Any AC state is on = 1, else all off then = 0. | ||
+ | * 01 = AC Status 1 (1 = on or 0 = off) | ||
+ | * 02 = AC Status 2 (1 = on or 0 = off) | ||
+ | * .... | ||
+ | * 08 = AC Status 8 (1 = on or 0 = off) | ||
+ | * <OPERATOR> can be one of the following symbol sequences (always 2 bytes) | ||
+ | * == EQUAL TO | ||
+ | * != NOT EQUAL TO | ||
+ | * >> GREATER THAN | ||
+ | * >= GREATER THAN OR EQUAL TO | ||
+ | * << LESS THAN | ||
+ | * <= LESS THAN OR EQUAL TO | ||
+ | * <VALUE> must be a digit, 0-65535. This is used (with the <OPERATOR>) to compare the state of the <VARIABLE>. | ||
+ | * <TARGET_ID> should be the CFLink ID of the unit receiving the command, in plain ascii (range 2 - EF). Single character will work (2-9) or two characters (02-EF). 00 = local device (ie. target the same device the condition is running on). | ||
+ | * For each reply, a boolean ''TRUE'' or ''FALSE'' will be returned on each condition evaluation, as the reply data payload. ''RCFXCON'' ''TRUE'' for example. | ||
+ | |||
+ | ===== Conditional ON and OFF based on AC Status read ===== | ||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]TRLYCON[F4]<CONDITION>|<ACTION>[F5][F5] \\ Send | ||
+ | > [F2]<ID>[F3]RRLYCON[F4]<BOOLEAN>[F5][F5] \\ Reply | ||
+ | </sxh> | ||
+ | |||
+ | |||
+ | * <IF AC STATE> = S01:1 (AC state 1 is on) | ||
+ | * <IF AC STATE> = S01:0 (AC state 1 is off) | ||
+ | |||
+ | * <SET PORT STATE> = P01:1 (port 1 L1/NO) | ||
+ | * <SET PORT STATE> = P01:2 (port 1 L2/NC) | ||
+ | * <SET PORT STATE> = P01:0 (port 1 L2/NC) | ||
+ | * <SET PORT STATE> = P01:T (port 1 toggle) | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]TRLYCON[F4]S01:1|P01:1[F5][F5] \\ If AC State 1 is ON, then Set Port 1 to L1 | ||
+ | |||
+ | > [F2]<ID>[F3]TRLYCON[F4]S01:0|P01:2[F5][F5] \\ If AC State 1 is OFF, then set relay port 1 to L2 | ||
+ | > [F2]<ID>[F3]TRLYCON[F4]S01:0|P01:T[F5][F5] \\ If AC State 1 is OFF, then toggle relay port 1, effectively turning ON circuit 1 when status reads OFF. | ||
+ | > [F2]<ID>[F3]TRLYCON[F4]S01:1|P02:T[F5][F5] \\ If AC State 1 is ON, then toggle relay port 2. | ||
+ | > [F2]<ID>[F3]TRLYCON[F4]SZZ:1|PZZ:1[F5][F5] \\ All ports.If AC State 1 is ON, then Set Port 1 to L1, If AC State 2 is ON, then Set Port 2 to L1, etc. until If AC State 8 is ON, then Set Port 8 to L1. | ||
+ | </sxh> | ||
+ | |||
+ | ===== User Variable ===== | ||
+ | |||
+ | You can use user variables to store strings or values that can be retrieved anytime for use later. | ||
+ | |||
+ | The ''CVARSET'' (Send) command is used to assign a value to the defined user variable. | ||
+ | |||
+ | === Data === | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]CVARSET[F4]<VARIABLE_NAME>:<VALUE>[F5][F5] | ||
+ | </sxh> | ||
+ | |||
+ | * **<VARIABLE_NAME>** = The name of the user variable. | ||
+ | * **<VALUE>** = The value to be assigned to the variable. | ||
+ | |||
+ | === Reply === | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | < [F2]<ID>[F3]RVARSET[F4]<VARIABLE_NAME>:<VALUE>[F5][F5] | ||
+ | </sxh> | ||
+ | |||
+ | There are two variable query commands available - ''QVARLST'' command is used to query all available variables and its respective values. ''QVARGET'' command is used to query a specific variable value. | ||
+ | |||
+ | === Data === | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | > [F2]<ID>[F3]QVARLST[F4][F5][F5] \\ Query value for all variables | ||
+ | > [F2]<ID>[F3]QVARGET[F4]<VARIABLE_NAME>[F5][F5] \\ Query value for specific variable | ||
+ | </sxh> | ||
+ | |||
+ | * **<VARIABLE_NAME>** = The name of the user variable. | ||
+ | * **<VALUE>** = The value to be assigned to the variable. | ||
+ | |||
+ | === Reply === | ||
+ | |||
+ | <sxh cflink; light: true> | ||
+ | < [F2]<ID>[F3]RVARGET[F4]<VARIABLE_NAME>:<VALUE>[F5][F5] | ||
+ | </sxh> | ||