6.25 Temperature Restriction of Central Units (ECU)
The main control unit ECU can operate normally in a temperature below 50°C. The user can use the PLC to read the temperature of the temperature sensor in the ECU controller and infer the ambient temperature. When the ambient temperature exceeds 50°C, an alarm message will be issued.
Ambient temperature = controller temperature sensor sensed temperature –17°C
PLC program example: (alarm will be given when the ambient temperature exceeds 45°C)
#include "plc.h"
#include "smachine.h"
static unsigned short *para;
static long *longPara;
static char *msgVersion = "Temperature_sensor";
static char *msgTemperature = "ALARM! Temperature is very high";
#define setting_Temperature (para[0])
#define Inside_Temperature (para[1])
#define Outside_Temperature (para[2])
void PLCAPI plcOpen(Status & sts, PlcBlock & plc,unsigned short *PlcData, long *LongPlcData){
plc.versionText = msgVersion; // assign version data string
para = PlcData; // get plcdata pointer
longPara = LongPlcData; // get long data pointer
setting_Temperature = 45;
}
void PLCAPI plcRun(Status & sts, PlcBlock & plc){
plc.errorMessage = (char *) 0;
plc.vto0.bit.emgsp = 0;
Inside_Temperature = sts.temperature;
Outside_Temperature = Inside_Temperature - 17;
if(Outside_Temperature>=setting_Temperature)
{
plc.vto0.bit.emgsp = 1;
plc.errorMessage = msgTemperature;
}
}
among them,
setting_Temperature is an alarm when the ambient temperature exceeds this setting.
Inside_Temperature is the temperature sensed by the temperature sensor in the CNC controller.
Outside_Temperature infers the ambient temperature by using the temperature sensed by the temperature sensor.