Home Support Event manager setup

Event Manager setup

 

The page is Under Construction (2012-0518)

myCNC control contains Event Manager. There are some system events. The manager can be
configured to run handler when event is occured.

List of system events:

  • Binary Input state changed events;
  • Emergency stop occured;
  • Motion event;
  • Low-speed event (event occured when current motion speed is lower then given speed);

 

All events & handlers can be configured through xml-configuration. Selected event can be activated/deactivated
either in myCNC control software GUI or in PLC procedures.For example "low-speed-event handler ( which
pauses/resumes Torch Height control (THC) on sharp corners of the path) is activated while "Cutting-ON"
procedure and deactivated in "Cutting-OFF" PLC procedure.

 

 

Binary input state changed (WATCH_BIT event).

Event id is PLCEVENT_WATCH_BIT (2). To program "WatchBit" should be given:

  • Input Port bit number, 
  • Polarity (rising or falling edge generates event;
  • Action id - identification of handler procedure;

Port numbers.
Port numbers 0...63 represent myCNC controller board inputs (for myCNC-UP3 or myCNC-ET2 boards port
numbers 0...7 are used; for myCNC-ET1 board port numbers 0...15 are used; other numbers are reserved;).
Some port numbers may be mapped to other memory/IO space area;

Action id.
At the moment just one action (id=0x10) is implemented. The action is - "stop program running". While this
action motion program is stopped smoothly with given deceleration, PLC procedure "OFF.plc" is executed.

"WatchBit" event used for watching for sensors (air/gas pressure, collant pressure, plasma arc ready) and
generates stop running when some error occured.

 

Example of configuration "WatchEvent" in cnc-config.xml-

<text-value name="event-manager-watching">255;0;0;1;16</text-value>

 There are 4 comma separated parameters should be given to configure "WatchEvent":

  1. Output port number (not used, reserved for future);
  2. Input 32-bit port number to watch (0 - is for input pin 0...31 numbers; 1 is for 32...63 pin numbers);
  3. Input bit number in 32-bit port (correct range is 0...31);
  4. Polarity - either Rising (0) or Falling (1) edge generates event;
  5. Action id (currently id=16(decimal) or 0x10 (hex) is available)

 For given line"Stop program running" will be generated, when input port, bit number 0 is released;

Messages PLCCMD_WATCHBITx_ON, PLCCMD_WATCHBITx_OFF are used to enable/disable WatchBit event
in PLC procedure. 

This example is taken from Plasma cutting profile. The input is used as plasma arc ready sensor. When plasma arc
is broken, stop running should be generated.

So watching for the input should be enabled just after "Cutting-On" (at the end of C07.plc procedure) and should
be disabled just before "Cutting-OFF" command (at the start of C08.plc procedure)

Source codes for enabling and disabling Watching are shown below-

..........

//Enable watching for plasma sensor
//Set message to EventManager;
message=PLCCMD_WATCHBIT1_ON;
texit=timer+2;
do
{
  timer++;
}while(timer<texit); //wait 2 ms till the message will be delivered

...........

 

.............

//Enable watching for plasma sensor
//Set message to EventManager;
message=PLCCMD_WATCHBIT1_OFF;
texit=timer+2;
do
{
  timer++;
}while(timer<texit); //wait 2 ms till the message will be delivered

.............

 System supports up to 4 WatchBit simultaneously.

Messages PLCCMD_WATCHBIT1_OFF...PLCCMD_WATCHBIT4_OFF,
PLCCMD_WATCHBIT1_ON...PLCCMD_WATCHBIT4_ON are used to enable/disablethe events.

Each line in xml configuration file with attribute name "event-manager-watching" configures and
turns-on Watch Event with given parameters.

 

 

Emergency Stop event.

Event id is PLCEVENT_EMERGENCY_STOP (4). To program Emergency stop event should be given:

  • Input Port bin number;
  • Polarity (rising or falling edge generates event;

Port numbers.
Port numbers 0...63 represent myCNC controller board inputs (for myCNC-UP3 or myCNC-ET2 boards port
numbers 0...7 are used; for myCNC-ET1 board port numbers 0...15 are used; other numbers are reserved;).
Some port numbares may be mapped to other memory/IO space area;

Emergency stop event is used to handle action just after Emergency Stop key pressed;
When Emergency stop event activated, Motion program running is stopped smoothly with given deceleration,
PLC procedure "EST.plc" is executed.

Example of configuration "Emergency Stop event" in cnc-config.xml-

<text-value name="event-manager-emergency-stop">9;1</text-value>

 There are two comma separated parameters should be given to configure "Emergency Stop event":

  1. Input bit number in 32-bit port (correct range is 0...31);
  2. Polarity - either Rising (0) or Falling (1) edge generates event;

 For given line"Emergency Stop" will be generated, when input port, bit number 9 is released;


 

Motion event.

Event id is PLCEVENT_MOTION (0). To program Motion event should be given:

  • Output Port bit number;
  • Turn off delay;

Output Port bit number.
Port numbers 0...63 represent myCNC controller board binary outputs (for myCNC-UP3 or myCNC-ET2 boards bit
numbers 0...7 are used; for myCNC-ET1 board port numbers 0...15 are used; other numbers are reserved;).
Some port numbers may be mapped to other memory/IO space area;

If Motion event is configured, given output pin is turned on when motion is started and turned off after motion
is stopped with given delay.

Typical application for this event is switching stepper motor driver to hold current when there is no motion.


Example of configuration "Motion event" in cnc-config.xml-

 

<text-value name="event-manager-motion">65;5.0</text-value>

 

 There are two comma separated parameters should be given to configure "Motion event":

  1. Output bit number;
  2. Turn-off delay in seconds;

 For given line output port bit number (65) actually is outside of IO space of myCNC controllers.
This address is mapped on myCNC-ET2 control board port, that switch Hi/Lo current for integrated
stepper motor drivers.


 

Lubricant event.

Event id is PLCEVENT_LUBRICANT (3). To program Lubricant event should be given:

  • Output Port bit number;
  • Turn on length,s;
  • Duty ratio (Time_on/Time_motion);

Output Port bit number.
Port numbers 0...63 represent myCNC controller board binary outputs (for myCNC-UP3 or myCNC-ET2 boards bit
numbers 0...7 are used; for myCNC-ET1 board port numbers 0...15 are used; other numbers are reserved;).
Some port numbers may be mapped to other memory/IO space area;

If Lubricant event is configured, given output pin is turned on for given time with given duty ratio while motion. 

Typical application for this event is lubricant system control.


Example of configuration "Lubricant event" in cnc-config.xml-

 

<text-value name="event-manager-lubricant">9;10.0;0.1</text-value>

 

 There are three comma separated parameters should be given to configure "Lubricant event":

  1. Output bit number;
  2. Turn on length in seconds;
  3. Duty ratio;

 For given line output port bit number (9) during motion will be turned on for 10 seconds with 0.1 ratio
(turned on for 10 seconds every 100 seconds).

 

 

Low speed event.

Event id is PLCEVENT_LOW_SPEED (1). To program Low speed event should be given:

  • Output Port bit number;
  • Hi/Lo speed ratio;

Output Port bit number.
Port numbers 0...63 represent myCNC controller board binary outputs (for myCNC-UP3 or myCNC-ET2 boards bit
numbers 0...7 are used; for myCNC-ET1 board port numbers 0...15 are used; other numbers are reserved;).
Some port numbers may be mapped to other memory/IO space area;

Hi/Lo speed ratio.
There is normal cutting speed, configured in myCNC GUI. If current motion speed is lower than given
"Hi/Lo speed ratio" * "Cutting speed", then Low speed event activated.

The Low speed signal is used for Torch Height control systems (THC) to prevent torch falls on sharp path corners. 


Example of configuration "Low speed event" in cnc-config.xml-

 

<text-value name="event-manager-lowspeed-percentage">0.7</text-value>
<text-value name="event-manager-lowspeed-port">3</text-value>

 

 There two separate xml lines to configure Hi/Lo percentage and Output port number.

 For given lines output port bit number (3) will be turned on when current motion speed is lower than 70% of given cutting speed.