OPC for TxCANbus

just some useless info:

NN as Hi and Lo, or NHNL, where NHNL=xxyy in Hex

Setup button:

:S0000N42NHNLN;

example:

:S0000N425004;
OK
:SE010N525004;

but you don’t have control over the CAN id (10 in bold), unless you use 33 as in:

[:S0000 N 33 00 00 NH NL ID] (Setup button first)

example:

:S0000N330000500252;
 OK
 :SE520N525002;


#define OPC_SNN          0x42 NH NL          // Set NodeNumber, only after pushing setup button on board
#define OPC_NNFORCE      0x43 NH NL XX YY    // Force NN to be xx.yy
#define OPC_CANIDFORCE   0x32 NH NL ZZ       // Force CANID to be zz
#define OPC_NNCANIDFORCE 0x33 NH NL XX YY ZZ // Force NN to be xx.yy and CANID to be zz

And NEW, how to find a board with NN xxyy:

:SE010NF1xxyy;

will reply with

:SE010N7CxxyyF1;  (so it got it!)

now the Red and Green status LEDs will flash alternately so you can go find it…and when found, you have to press the Setup Button to tell it to get back to the real world, which would then broadcast a

:SE010N7C0000F0F0F0;

TxCANSignal:

OPC_SETLED 0x8C
OPC_CLRLED 0x8D
OPC_CLRFLASH 0x8E // solid
OPC_SETFLASH 0x8F

first (green) LED on NN=0001 on:

:S0000N8C00010000;

flash it:

:S0000N8F00010000;

red:

:S0000N8C00010001;

yellow:

:S0000N8C00010002;

and OFF:
green:

:S0000N8D00010000;

red:

:S0000N8D00010001;

yellow:

:S0000N8D00010002;

on and solid again:

green:

:S0000N8C00010000;
:S0000N8E00010000;

TxCanBeep:
OPC_BEEP_CALL [9C] (sent when a call button is pressed)
9C CN CN PH PL CC

OPC_BEEP_CANCEL [9D] (sent when a cancel button is pressed)
9D CN CN PH PL CC

lights only:
OPC_BEEP_CALL [9C] (datalen = 5)
9C CN CN PH PL

OPC_BEEP_CANCEL [9F] (datalen = 5)
9D CN CN PH PL

messages intended for here:
OPC_SETONTIME [E9]
set:
E9 NN NN 00 TT
get:
E9 NN NN
// s0000ne94007;
// reply
// :SE470N7C400706;

OPC_BEEP_DEFVAL [9B] (logic hi or low)
set:
9B NN NN 00 DV
// :S0000N9b400800FD; // cancel button on caller 0 is normally closed
// :S0000N9b40070055; // cancel buttons on all callers are normally closed
// set bit high if pullup resistor and button to GND used.

get setting:
9B NN NN
// s0000N9B4008;
// reply:
// OK
// :S0000N7C4008FD00; // FD for DEFVAL and 00 for BUZZALL

OPC_BEEP_BUZZALL [9B] (which buzzer [1-4], 0 for off)
set:
9B NN NN 01 BUZZ
// :S0000N9b40080100; // buzzer is not going to buzz for ALL “9C” or OPC_BEEP_CALLs
// :S0000N9b40070103; // 3rd buzzer for all “9C” commands

OPC_BEEP_CONNECT
reply with all slot’s phone numbers, ack3 with PHi, PLi, i
9F NH NL (datalen = 3)
:S0000N9F4004;
{
:SE440N7C4004400400;
:SE440N7C4004800202;
:SE440N7C4004800301;
:SE440N7C4004800103;
}

set slot to phone number (datalen = 6)
9F NH NL PH PL SS
:S0000N9F4004123401;

TxCANTurn2:

OPC_GETLOCALCTRL // E4 NN NN, LocalCtrl read
OPC_SETLOCALCTRL // E5 NN NN 00 L1 L2, Set LocalCtrl
OPC_ADDLOCALCTRL // E7 NN NN 00 AA AA, add to LocalCtrl
OPC_SUBLOCALCTRL // E8 NN NN 00 RR RR, remove from LocalCtrl
OPC_SETTIMEDON // E6 NN NN 00 TT (TT=01: Set TimedOn, TT=00 for off)

(or you can press and hold the SetupButton when the board is powered up, the GRN LED should be on while the RED is flashing)

Normal Output:

OPC_ACON // 0x90 00 00 LN OE, On event  (Reverse/Thrown in JMRI?)
OPC_ASON // 0x98 00 00 LN OE, Short Off event

0x9[0/8] 00 00 LN 00 will turn ALL outputs completely off.

Reverse Output:

OPC_ACOF // 0x91 00 00 LN OE, Off event (Normal/Close in JMRI?)
OPC_ASOF // 0x99 00 00 LN OE, Short Off event

~ by nambabwe on 2012/01/02.