5interlockof2waysrelay, 6repeatbuttonpressingwithoutaffectingdel, 43 pgmⅢ programmable ethernet control system – CREATOR CR-PGMIII User Manual

Page 50

Advertising
background image

CREATOR CHINA 2011-03

WWW.CREATOR1997.COM

43

PGMⅢ Programmable Ethernet Control System

// same as above, the general volume

reduces

BUTTON_EVENT(tp_1,51)
{

REPEAT()
{

SET_VOLTOTOL(CRNET_VOL,1,(cr_vol));

SET_VOLTOTOL(CRNET_VOL,2,(cr_vol));

cr_vol=cr_vol-100;
if(cr_vol<0)
{

cr_vol=0;

}

}

7.9.5 Interlock of 2 ways relay

DEFINE_DEVICE

RL_M = M:1000:RELAY;

//define the

built-in relay on the controller

tp_1 = T:10:TP;

//define

the

touch panel with the ID of 10

DEFINE_EVENT

BUTTON_EVENT(tp_1,1)

{

PUSH()
{

ON_RELAY(RL_M,1);

//turn on the first relay on the controller

OFF_RELAY(RL_M,2);

//turn off the 2

nd

relay on the controller

}
RELEASE()
{
}

}
BUTTON_EVENT(tp_1,2)
{

PUSH()
{

ON_RELAY(RL_M,2);

//turn on the 2

nd

relay on the controller

OFF_RELAY(RL_M,1);

//turn off the first relay on the controller

}
RELEASE()
{
}

}

7.9.6 Repeat button pressing without
affecting delay timer execution

DEFINE_DEVICE

REL = N:8:RELAY;

//define

the

CRNET relay with the ID of 8

tp_1 = T:10:TP;

//define

the

touch panel device with the ID of 10

DEFINE_VARIABLE

int py=1;

//define the CRNET relay’s

variables

DEFINE_EVENT

BUTTON_EVENT(tp_1,1)
{

PUSH()

{

//turn on the CRNET relay’s 1 way
ON_RELAY(REL,1);
//wait for 5 seconds, then turn off

the first way of the CRNET relay; repeat pressing
donw the button during the waiting time will not
affect the execution

if(py==1)
{

py=0;
WAIT 5000
{
OFF_RELAY(REL,1);
py=1;
}

}

Advertising