2cascadingandmodulecalls, 39 pgmⅢ programmable ethernet control system – CREATOR CR-PGMIII User Manual

Page 46

Advertising
background image

CREATOR CHINA 2011-03

WWW.CREATOR1997.COM

39

PGMⅢ Programmable Ethernet Control System

}

BUTTON_EVENT(tp,2)
{

PUSH()
{

OFF_RELAY(m_relay,1); // turn of

the first way of the relay module

}

}

BUTTON_EVENT(tp,3)
{

PUSH()
{

ON_RELAY(m_relay,2); //turn on

the second way of the relay module

}

}
BUTTON_EVENT(tp,4)
{

PUSH()

{

ON_RELAY(m_relay,2); // turn off

the 2 way of the relay module

}

}

BUTTON_EVENT(tp,5)
{

PUSH()
{

ON_RELAY(m_relay,3); //turn on

the 3 way of the relay module

}

}

BUTTON_EVENT(tp,6)
{

PUSH()

{

ON_RELAY(m_relay,3); // turn off

the first way of the relay module

}

}

7.9.2 Cascading and Module calls

DEFINE_DEVICE

tpx = T:1002:TP;
mtp = M:0:TP;
com = M:1003:COM;
mr = M:1000:IR;
io = M:1000:IO;
tp7600 = N:07100:TP;
acar = L:12:ACAR;

DEFINE_COMBINE
[tpx,mtp];

DEFINE_EVENT

// receive the data from the first COM

interface and send it to the second COM interface

DATA_EVENT(com ,1)
{

ONDATA()
{

SEND_COM(com,2,”0x”

+

BYTES_TO_HEX(DATA. Data));

}

}

BUTTON_EVENT(tpx,12)
{

PUSH()
{

SEND_ACAR(acar,1,12);
SEND_ACAR(acar,1,12);

}

}

Advertising