 |
Lydia - Printhead
|
#include <PHApp.h>
|
enum | APP_STATE {
RESET = 0,
EXTRUDING = 1,
STANDBY = 2,
ERROR = 5,
VFD_TIMEOUT = 10,
PID_TIMEOUT = 11,
FEED_TIMEOUT = 12,
CONTROL_PANEL_INVALID = 13,
PID_ERROR = 20,
VFD_ERROR = 30,
FEED_ERROR = 40
} |
|
enum | CONTROLLER_STATE { E_CS_OK = 0,
E_CS_ERROR = 10
} |
|
Definition at line 34 of file PHApp.h.
◆ APP_STATE
Enumerator |
---|
RESET | |
EXTRUDING | |
STANDBY | |
ERROR | |
VFD_TIMEOUT | |
PID_TIMEOUT | |
FEED_TIMEOUT | |
CONTROL_PANEL_INVALID | |
PID_ERROR | |
VFD_ERROR | |
FEED_ERROR | |
Definition at line 43 of file PHApp.h.
◆ CONTROLLER_STATE
Enumerator |
---|
E_CS_OK | |
E_CS_ERROR | |
Definition at line 38 of file PHApp.h.
◆ PHApp()
◆ clearError()
short PHApp::clearError |
( |
| ) |
|
Definition at line 319 of file PHApp.cpp.
321 Log.verboseln(F(
"* App:clearError - " CR));
◆ getAppState()
short PHApp::getAppState |
( |
short |
val | ) |
|
◆ getExtruderFeed()
◆ getLastError()
short PHApp::getLastError |
( |
| ) |
|
|
inline |
◆ list()
short PHApp::list |
( |
short |
val0, |
|
|
short |
val1 |
|
) |
| |
|
virtual |
Definition at line 96 of file PHApp.cpp.
98 uchar s = components.size();
99 for (uchar i = 0; i < s; i++)
101 Component *component = components[i];
102 Log.verboseln(
"PHApp::list - %d | %s", component->id, component->name.c_str());
◆ loop()
◆ loopExtruderFeed()
short PHApp::loopExtruderFeed |
( |
| ) |
|
Definition at line 329 of file PHApp.cpp.
332 #ifdef HAS_FEED_SERVO
335 return E_INVALID_PARAMETERS;
349 #if defined(MB_W_FEED_VFD_RATIO) && defined(MB_RW_FEED_VFD_DEFAULT_SPEED_RATIO)
357 int vfdState = state->
state;
358 int vfdSpeed = state->
FC;
361 int newSpeed = abs(t1 * vfdSpeed / 100);
◆ loopModbus()
short PHApp::loopModbus |
( |
| ) |
|
◆ onError()
short PHApp::onError |
( |
short |
id, |
|
|
short |
code |
|
) |
| |
Definition at line 278 of file PHApp.cpp.
285 Log.error(F(
"* App:onError - component=%d (%s) code=%d" CR), byId(
id)->name.c_str(),
id, code);
291 Log.errorln(
"App::onError Timeout %d",
id);
297 Log.errorln(
"App::onError Overload %d",
id);
◆ onRegisterMethods()
short PHApp::onRegisterMethods |
( |
Bridge * |
bridge | ) |
|
|
virtual |
Definition at line 251 of file PHApp.cpp.
253 Log.verbose(F(
"* App:onRegisterMethods *" CR));
◆ onRun()
short PHApp::onRun |
( |
short |
code = 0 | ) |
|
◆ onStop()
short PHApp::onStop |
( |
short |
code = 0 | ) |
|
Definition at line 312 of file PHApp.cpp.
314 Log.verboseln(F(
"* App:onStop - " CR));
◆ onWarning()
short PHApp::onWarning |
( |
short |
code | ) |
|
Definition at line 260 of file PHApp.cpp.
262 Log.warning(F(
"* App:onWarning - code=%d" CR), code);
◆ print()
short PHApp::print |
( |
short |
arg1, |
|
|
short |
arg2 |
|
) |
| |
Definition at line 45 of file PHApp.cpp.
47 uchar s = components.size();
48 for (uchar i = 0; i < s; i++)
50 Component *component = components[i];
◆ printRegisters()
void PHApp::printRegisters |
( |
| ) |
|
Definition at line 56 of file PHApp.cpp.
59 #if ENABLED(HAS_MODBUS_REGISTER_DESCRIPTIONS)
60 Log.setShowLevel(
false);
61 Serial.print(
"| Name | ID | Address | RW | Function Code | Number Addresses |Register Description| \n");
62 Serial.print(
"|------|----------|----|----|----|----|-------|\n");
63 short size = components.size();
64 for (
int i = 0; i < size; i++)
66 Component *component = components[i];
67 if (!(component->nFlags & 1 << OBJECT_NET_CAPS::E_NCAPS_MODBUS))
71 Log.verbose(
"| %s | %d | %d | %s | %d | %d | %s |\n",
72 (Component *)component->name.c_str(),
74 component->getAddress(),
75 component->getRegisterMode(),
76 component->getFunctionCode(),
77 component->getNumberAddresses(),
78 component->getRegisterDescription().c_str());
80 Log.setShowLevel(
true);
◆ reset()
Definition at line 84 of file PHApp.cpp.
88 asm volatile(
"jmp 0");
93 return E_NOT_IMPLEMENTED;
◆ setAppState()
short PHApp::setAppState |
( |
short |
newState | ) |
|
◆ setExtruderFeed()
◆ setLastError()
short PHApp::setLastError |
( |
short |
val = 0 | ) |
|
|
inline |
◆ setup()
Definition at line 106 of file PHApp.cpp.
109 while (!Serial && !Serial.available())
112 Log.begin(LOG_LEVEL_VERBOSE, &Serial);
113 setFlag(OBJECT_RUN_FLAGS::E_OF_DEBUG);
115 bridge =
new Bridge(
this);
116 com_serial =
new SerialMessage(Serial, bridge);
118 components.push_back(bridge);
125 #ifdef OMRON_PID_SLAVE_START
127 components.push_back(
pids);
146 #if (defined(MB_ANALOG_3POS_SWITCH_0) && (defined(MB_ANALOG_3POS_SWITCH_1)))
150 #if (defined(MB_ANALOG_3POS_SWITCH_2) && (defined(MB_ANALOG_3POS_SWITCH_3)))
154 #ifdef HAS_OMRON_VFD_MODBUS
163 #ifdef HAS_FEED_SERVO
175 #ifdef MOTOR_LOAD_PIN
177 components.push_back(
mLoad);
179 #ifdef OMRON_MX2_SLAVE_ID
206 #ifdef HAS_FEED_SERVO
213 _state = APP_STATE::RESET;
217 registerComponents(bridge);
232 #ifdef PRINT_MODBUS_REGISTERS
244 #if defined(HAS_FEED_SERVO) && defined(MB_RW_FEED_VFD_DEFAULT_SPEED_RATIO)
◆ _cstate
◆ _error
◆ _state
◆ com_serial
SerialMessage* PHApp::com_serial |
◆ comTS
◆ extruderFeed
◆ loopTS
◆ mLoad
◆ modbusBridge
◆ omronVFD
◆ pids
◆ pos3Analog_0
◆ pos3Analog_1
◆ pot_0
◆ pot_1
◆ pot_2
◆ relay_0
◆ relay_1
◆ relay_2
◆ relay_3
◆ relay_4
◆ relay_5
◆ relay_6
◆ relay_7
◆ statusLight_0
◆ statusLight_1
◆ stepperController_0
◆ stepperController_1
◆ timer
Timer<10, millis> PHApp::timer |
◆ wait
◆ waitTS
The documentation for this class was generated from the following files:
#define MB_MONITORING_STATUS_FEEDBACK_0
virtual short list(short val0, short val1)
#define MB_RELAY_0_DEFAULT
#define MB_STEPPER_FEEDBACK_0
#define MB_STEPPER_ENABLED_0
#define MB_R_SYSTEM_CMD_PRINT_MEMORY
#define MB_R_APP_STATE_REG
StepperController * extruderFeed
void setExtruderFeed(StepperController *feed)
#define MB_ANALOG_3POS_SWITCH_0
#define MB_STEPPER_OVERLOAD_0
void setBlink(bool blink)
#define MB_R_SYSTEM_ERROR
#define MB_RW_FEED_VFD_DEFAULT_SPEED_RATIO
#define STATUS_ERROR_BLINK
#define STATUS_WARNING_OFF
#define ADD_RELAY(relayNum, relayPin, relayKey, relayRegister)
#define OMRON_PID_SLAVE_START
@ COMPONENT_KEY_MB_RELAY_1
#define STATUS_WARNING_BLINK
@ COMPONENT_KEY_MB_ANALOG_3POS_SWITCH_0
#define MB_R_SYSTEM_CMD_PRINT_VFD
@ COMPONENT_KEY_MB_ANALOG_3POS_SWITCH_1
#define OMRON_STATE_ACCELERATING
@ COMPONENT_KEY_FEEDBACK_0
SerialMessage * com_serial
@ COMPONENT_KEY_STEPPER_0
#define STATUS_WARNING_PIN
@ COMPONENT_KEY_MB_RELAY_0
#define MB_STEPPER_PULSE_0
#define STEPPER_DEFAULT_SPEED_0
short print(short arg1, short arg2)
#define MB_R_SYSTEM_CMD_PRINT_QUEUE
#define STATUS_ERROR_BLINK_OFF
#define MB_ANALOG_3POS_SWITCH_1
OmronVFDState * getVFDState()
@ COMPONENT_KEY_MB_ANALOG_0
short onError(short id, short code)
#define MB_ANALOG_3POS_SWITCH_2
@ COMPONENT_KEY_MB_ANALOG_1
#define MB_W_FEED_VFD_RATIO
#define SERIAL_BAUD_RATE
Serial port baud rate.
#define MB_R_SYSTEM_CMD_PRINT_PIDS
#define STEPPER_DEFAULT_DIR_0
#define MB_ANALOG_3POS_SWITCH_3
Pos3Analog * pos3Analog_1
StepperController * stepperController_0
StatusLight * statusLight_1
#define STATUS_WARNING_ON
@ COMPONENT_KEY_FEEDBACK_1
#define OMRON_VFD_MAX_FREQ
#define MB_R_SYSTEM_CMD_PRINT_REGS
#define OMRON_STATE_DECELERATING
virtual short onRegisterMethods(Bridge *bridge)
StatusLight * statusLight_0
#define OMRON_STATE_RUNNING
#define STEPPER_PULSE_WIDTH_0
#define MB_RELAY_1_DEFAULT
short speed(short val0, short val1=0)
#define STEPPER_MAX_SPEED_0
short setLastError(short val=0)
#define MB_MONITORING_STATUS_FEEDBACK_1
#define MB_RW_STEPPER_SPEED_0
#define STATUS_WARNING_BLINK_OFF
Pos3Analog * pos3Analog_0
ModbusBridge * modbusBridge
#define OMRON_MX2_SLAVE_ID
#define ADD_POS3ANALOG(posNum, switchPin1, switchPin2, switchKey, switchRegister)
#define ADD_POT(potNum, potPin, potKey, potRegister)