Controllerfunctions, 2on_relay, 3off_relay – CREATOR CR-PGMIII User Manual
Page 30: 23 pgmⅢ programmable ethernet control system

CREATOR CHINA 2011-03
WWW.CREATOR1997.COM
23
PGMⅢ Programmable Ethernet Control System
DATA_EVENT([device])
{
ONLINE()
{
// Operation to be done when received the
data online command from the device
}
OFFLINE()
{
// Operation to be done when received the
data offline command from the device
}
ONERROR()
{
// Operation to be done when received the
data error command from the device
}
ONDATA()
{
// Operation to be done when received the
data from the device
}
}
DEFINE_PROGRAME: Loop Module
When the program starts to run, the codes here
will be executed repeatedly. Some monitoring
operations can be realized here to monitor the
device’s status.
7.6.2 Controller Functions
Controller functions are used to realize different
functions of the controller.
7.6.2.1 SEND_IRCODE
Void
SEND_IRCODE(String dev,int channel,String str)
Function: send IR Data
Parameters:
dev - :IR Equipment
channel - :Equipment Chanel number
str - :IR Data HEX String
Sample:
IR_M = M:1000; //define the IR device on the
controller’s mother board
IR_M
// Send IR Code to the IR_M’s first channel
// in which,
IRCODE<“StanderIRDb:3M:CODEC:VCS3000:P
OLYCOM1:6289:6 (MNO)”> are the IR Control
codes from 3M company in the IR Code database
// CODEC type,VCS3000 Model
number,POLYCOM1 equipment to be controlled,
IR Sample number 6289’s MNO IR code
// Call the function and send out the matching IR
Code from the IR Code database
SEND_IRCODE(IR_M,1,IRCODE<“StanderIRDb:
3M:CODEC:VCS3000:POLYCOM1:6289:6
(MNO)”>);
7.6.2.2 ON_RELAY
void ON_RELAY(String dev,int channel)
Function: turn on the relay module
Parameters:
dev - :relay device
channel - : device’s channel number
Sample:
RELAY_M = M:1000:RELAY; // define the relay
with the motherboard number of 1000
ON_RELAY(RELAY_M,2); // turn on the relay
with the motherboard number of 1000
7.6.2.3 OFF_RELAY
void OFF_RELAY(String dev,int channel)
Function: turn off the relay
Parameters:
dev - :relay device
channel - :device channel number
Sample
RELAY_M = M:1000:RELAY; //define the
relay with the motherboard number of 1000
OFF_RELAY(RELAY_M,2); // turn off the relay
with the motherboard number of 1000