22 pgmⅢ programmable ethernet control system – CREATOR CR-PGMIII User Manual
Page 29

CREATOR CHINA 2011-03
WWW.CREATOR1997.COM
22
PGMⅢ Programmable Ethernet Control System
DEFINE_VARIABLE: Variable define module
All the variables need to be defined here
DEFINE_CONSTANT: Constant define
module
All the constants need to be defined here
DEFINE_FUNCTION: Function define
module
All the functions have to be defined here
DEFINE_TIMER: Timer define module
All the timers should be defined here. For
some actual requirements, there might need a
timer to repeat an action on a regular timer
interval.
DEFINE_START: Program Initialization
Module
All codes here will be executed first before
the other parts in the program. This module can
be used to do the initialization jobs, such as
initializing
variables
and
execute
some
initialization operations.
DEFINE_EVENT: Even define module
All the events definition has to be done within
this module.
There are mainly three kinds of events:
◆
Button event
Syntax:the parameter can be 0, 1, or 2. When
there are 2 parameters, it means the even is
effective to the defined device name and joint
number. When there is only 1 parameter, the
event is only effective the defined device name.
When the parameter is 0, the event is effective to
all the devices.
There functions corresponding to four events:
“Press”, “Release”, “Hold” and “the whole button
procedure”. The even execution codes have to be
put into the corresponding functions.
BUTTON_EVENT([device] [JionNumber])
{
PUSH()
{
// The operation to be done when press
down the button
}
RELEASE()
{
// The operation to be done when release
the button
}
HOLD(
// The operation to be done after the button
has been press down and held for a certain, or, at
a certain time interval.
}
REPEAT()
{
// The repeatedly operation to be done when
the button is pressed down.
}
}
◆
Bar Event
Syntax: the parameter can be 0, 1, 2. When there
are 2 parameters, it means the event will only be
effective to the defined device and the joint
number. When there is 1 parameter, it means the
even will be effective to the defined device. When
the parameter is 0, it means the event is effective
to all devices.
LEVEL_EVENT([device] [, Jion Number])
{
// Operation to be done when the bar has
changed
}
◆
Data event