Limbs Safety Switch Library for ESP32 (Arduino) v1.0.1
A library that provides a class that models a Limbs Safety Switch for physical dangerous devices or industrial production machines.
|
Models a Limbs Safety Launch and Forget Switch (LimbsSftyLnFSwtch) for safely activation of "launch and forget" cycle machines and devices. More...
#include <LimbsSafetySw_ESP32.h>
Public Member Functions | |
LimbsSftyLnFSwtch () | |
Class default constructor. | |
LimbsSftyLnFSwtch (swtchInptHwCfg_t lftHndInpCfg, swtchBhvrCfg_t lftHndBhvrCfg, swtchInptHwCfg_t rghtHndInpCfg, swtchBhvrCfg_t rghtHndBhvrCfg, swtchInptHwCfg_t ftInpCfg, swtchBhvrCfg_t ftBhvrCfg, lsSwtchSwCfg_t lsSwtchWrkngCnfg) | |
Class constructor. | |
~LimbsSftyLnFSwtch () | |
Default virtual destructor. | |
bool | begin (unsigned long int pollDelayMs=_minPollDelay) |
Attaches the instantiated object to a timer that monitors the input pins and updates the object status. | |
void | clrStatus () |
Clears and resets flags, timers and counters modified through the object's signals processing. | |
void | cnfgFtSwtch (const swtchBhvrCfg_t &newCfg) |
Configures the SnglSrvcVdblMPBttn class object used as Foot Switch | |
bool | cnfgLftHndSwtch (const swtchBhvrCfg_t &newCfg) |
Configures the TmVdblMPBttn class object used as Left Hand Switch | |
bool | cnfgRghtHndSwtch (const swtchBhvrCfg_t &newCfg) |
Configures the TmVdblMPBttn class object used as Right Hand Switch | |
fncVdPtrPrmPtrType | getFnWhnTrnOffLtchRlsPtr () |
Returns the function that is set to execute every time the object's Latch Release is set to Off State. | |
fncVdPtrPrmPtrType | getFnWhnTrnOffPrdCyclPtr () |
Returns the function that is set to execute every time the object's Production Cycle is set to Off State. | |
fncVdPtrPrmPtrType | getFnWhnTrnOnLtchRlsPtr () |
Returns the function that is set to execute every time the object's Latch Release is set to On State. | |
fncVdPtrPrmPtrType | getFnWhnTrnOnPrdCyclPtr () |
Returns the function that is set to execute every time the object's Production Cycle is set to On State. | |
SnglSrvcVdblMPBttn * | getFtSwtchPtr () |
Get the ftSwcthPtr attribute value. | |
TmVdblMPBttn * | getLftHndSwtchPtr () |
Get the lftHndSwcthPtr attribute value. | |
const bool | getLsSwtchOtptsChng () const |
Returns the value of the lsSwtchOtptsChng attribute flag. | |
uint32_t | getLsSwtchOtptsSttsPkgd () |
Returns the relevant attribute flags values for the object state encoded as a 32 bits value, required to pass current state of the object to another thread/task managing the outputs changes. | |
const bool | getLtchRlsIsOn () const |
Returns the ltchRlsIsOn attribute flag value. | |
unsigned long int | getLtchRlsTtlTm () |
Returns the time configured to keep the Latch Released state On | |
const bool | getPrdCyclIsOn () const |
Returns the prdCyclIsOn attribute flag value. | |
unsigned long int | getPrdCyclTtlTm () |
Returns the time configured for the production cycle to be completed. | |
TmVdblMPBttn * | getRghtHndSwtchPtr () |
Returns the rghtHndSwcthPtr attribute value. | |
const TaskHandle_t | getTskToNtfyBthHndsOnMssd () const |
Returns the TaskHandle for the task to be unblocked when the object's state changes from the "foot switch enabled" state to the "foot switch disabled" state, instead of the "Production cycle activated" state. | |
const TaskHandle_t | getTskToNtfyLsSwtchOtptsChng () const |
Returns the TaskHandle for the task to be unblocked when the object's lsSwtchOtptsChng attribute flags is set to true. | |
const TaskHandle_t | getTskToNtfyTrnOffLtchRls () const |
Returns the TaskHandle for the task to be unblocked when the object's ltchRlsIsOn attribute flag is set to false. | |
const TaskHandle_t | getTskToNtfyTrnOffPrdCycl () const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to false. | |
const TaskHandle_t | getTskToNtfyTrnOnLtchRls () const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to true. | |
const TaskHandle_t | getTskToNtfyTrnOnPrdCycl () const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to true. | |
void | resetFda () |
Resets the LsSwitch behavior automaton to it's Initial or Start State | |
void | setFnWhnBthHndsOnMssd (fncVdPtrPrmPtrType &newFnWhnBthHndsOnMssd) |
Sets the function to be executed when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state. | |
void | setFnWhnTrnOffLtchRlsPtr (fncVdPtrPrmPtrType &newFnWhnTrnOff) |
Sets the function to be executed when the object's ltchRlsIsOn attribute flag is set to false. | |
void | setFnWhnTrnOffPrdCyclPtr (fncVdPtrPrmPtrType &newFnWhnTrnOff) |
Sets the function to be executed when the object's prdCyclIsOn attribute flag is set to false. | |
void | setFnWhnTrnOnLtchRlsPtr (fncVdPtrPrmPtrType &newFnWhnTrnOn) |
Sets the function to be executed when the object's ltchRlsIsOn attribute flag is set to true. | |
void | setFnWhnTrnOnPrdCyclPtr (fncVdPtrPrmPtrType &newFnWhnTrnOn) |
Sets the function to be executed when the object's prdCyclIsOn attribute flag is set to true. | |
void | setLsSwtchOtptsChng (bool newLsSwtchOtptsChng) |
Sets the value of the attribute flag indicating if a change took place in any of the output attribute flags. | |
bool | setLtchRlsTtlTm (const unsigned long int &newVal) |
Set the Latch Release Total Time (ltchRlsTtlTm) attribute value. | |
bool | setPrdCyclTtlTm (const unsigned long int &newVal) |
Set the Production Cycle Total Time (prdCyclTtlTm) attribute value. | |
void | setTrnOffLtchRlsArgPtr (void *&newVal) |
Sets the pointer to the arguments for the function to be executed when the object's ltchRlsIsOn attribute flag is set to false. | |
void | setTrnOffPrdCyclArgPtr (void *&newVal) |
Sets the pointer to the arguments for the function to be executed when the object's prdCyclIsOn attribute flag is set to false. | |
void | setTrnOnLtchRlsArgPtr (void *&newVal) |
Sets the pointer to the arguments for the function to be executed when the object's ltchRlsIsOn attribute flag is set to true. | |
void | setTrnOnPrdCyclArgPtr (void *&newVal) |
Sets the pointer to the arguments for the function to be executed when the object's prdCyclIsOn attribute flag is set to true. | |
void | setTskToNtfyBthHndsOnMssd (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state. | |
void | setTskToNtfyLsSwtchOtptsChng (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when ANY of the object's attribute flags changes it's value. | |
void | setTskToNtfyTrnOffLtchRls (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's ltchRlsIsOn attribute flag is set to false. | |
void | setTskToNtfyTrnOffPrdCycl (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's prdCyclIsOn attribute flag is set to false. | |
void | setTskToNtfyTrnOnLtchRls (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's ltchRlsIsOn attribute flag is set to true. | |
void | setTskToNtfyTrnOnPrdCycl (const TaskHandle_t &newTaskHandle) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's prdCyclIsOn attribute flag is set to true. | |
bool | setUndrlSwtchsPollDelay (const unsigned long int &newVal) |
Sets the update period length for the DbncdMPBttn subclasses objects used as input by the LimbsSftyLnFSwtch. | |
Models a Limbs Safety Launch and Forget Switch (LimbsSftyLnFSwtch) for safely activation of "launch and forget" cycle machines and devices.
This industry grade machinery oriented switch enforces conditioned activation of several switches to ensure limbs security, enabled for ISO 13849-1 standard compliance. This enforced conditions include sequenced pressing order and timings as main parameters. The most basic configuration requires each hand pressing simultaneously two switches to enable a foot switch. The enabled foot switch activates the machine action.
Operators' or production managers' needs and criteria often end with regular security switches tampered, played down, rigged or other actions that degrade the security provided by regular switches, far below the real needs and the standards. The switches modeled by this class ensures the required enforced security practices, while letting some aspects to be configured for specific production tasks on the machine, or to adapt the switch to machines with different security needs.
This class relies on ButtonToSwitch_ESP32 class objects:
LimbsSftyLnFSwtch::LimbsSftyLnFSwtch | ( | swtchInptHwCfg_t | lftHndInpCfg, |
swtchBhvrCfg_t | lftHndBhvrCfg, | ||
swtchInptHwCfg_t | rghtHndInpCfg, | ||
swtchBhvrCfg_t | rghtHndBhvrCfg, | ||
swtchInptHwCfg_t | ftInpCfg, | ||
swtchBhvrCfg_t | ftBhvrCfg, | ||
lsSwtchSwCfg_t | lsSwtchWrkngCnfg ) |
Class constructor.
The class models a Limbs Safety switch, a switch that gives an activation signal to a machine or device when some independent switches, activated in a designated pattern, ensures no risk for the operator limbs is completed. The constructor instantiates the DbncdMPBttn subclasses objects that compose the Limbs Safety switch, i.e. the left hand TmVdblMPBttn, the right hand TmVdblMPBttn and the foot SnglSrvcVdblMPBttn
lftHndInpCfg | A swtchInptHwCfg_t structure containing the hardware implemented characteristics for the left hand controlled TmVdblMPBttn |
lftHndBhvrCfg | A swtchBhvrCfg_t structure containing the behavior characteristics for the left hand controlled TmVdblMPBttn |
rghtHndInpCfg | A swtchInptHwCfg_t structure containing the hardware implemented characteristics for the right hand controlled TmVdblMPBttn |
rghtHndBhvrCfg | A swtchBhvrCfg_t structure containing the behavior characteristics for the right hand controlled TmVdblMPBttn |
ftInpCfg | A swtchInptHwCfg_t structure containing the hardware implemented characteristics for the foot controlled SnglSrvcVdblMPBttn |
ftBhvrCfg | A swtchBhvrCfg_t structure containing the behavior characteristics for the foot controlled SnglSrvcVdblMPBttn |
lsSwtchWrkngCnfg | A lsSwtchSwCfg_t structure containing the basic parameters needed for the instantiated object interface with the machine. The parameters provided for instantiation might be changed by dedicated setters |
bool LimbsSftyLnFSwtch::begin | ( | unsigned long int | pollDelayMs = _minPollDelay | ) |
Attaches the instantiated object to a timer that monitors the input pins and updates the object status.
The frequency of the periodic monitoring is passed as a parameter in milliseconds, and is a value that must be small (frequent) enough to keep the object updated, but not so frequent that wastes resources needed by other tasks. As the DbncdMPBttn objects components of the switch have a minimum default value, the same is provided for this method, as it makes no sense to check for changes in objects that refresh themselves slower than the checking length period.
pollDelayMs | (Optional) unsigned long integer (ulong), the time between status updates in milliseconds. |
true | Timer starting operation success for the object and for the underlying DbncdMPBttn subclasses objects |
void LimbsSftyLnFSwtch::clrStatus | ( | ) |
Clears and resets flags, timers and counters modified through the object's signals processing.
Resets object's attributes to its initialization values to safely continue operations after completing a FDA cycle that might generate unexpected distortions. This avoids risky behavior of the object due to dangling flags or partially consumed time counters.
void LimbsSftyLnFSwtch::cnfgFtSwtch | ( | const swtchBhvrCfg_t & | newCfg | ) |
Configures the SnglSrvcVdblMPBttn class object used as Foot Switch
Some behavior attributes of the DbncdMPBttn subclasses objects components can be configured to adjust the behavior of the LimbsSftyLnFSwtch. In the case of the SnglSrvcVdblMPBttn used as Foot Switch the only attribute available for adjustment is the start delay value, used to adjust the time the foot switch must be kept pressed after the debounce period, before the switch accepts the input signal. This parameter is used to adjust the "sensibility" of the switch to mistaken, accidental or conditioned reflex presses.
newCfg | A swtchBhvrCfg_t type structure, from which only the .swtchStrtDlyTm value will be used. |
bool LimbsSftyLnFSwtch::cnfgLftHndSwtch | ( | const swtchBhvrCfg_t & | newCfg | ) |
Configures the TmVdblMPBttn class object used as Left Hand Switch
Some behavior attributes of the DbncdMPBttn subclasses objects components can be configured to adjust the behavior of the LimbsSftyLnFSwtch. In the case of the TmVdblMPBttn used as Left Hand Switch the attributes available for adjustment are:
newCfg | A swtchBhvrCfg_t type structure, containing the parameters values that will be used to modify the configuration of the TmVdblMPBttn class object. |
bool LimbsSftyLnFSwtch::cnfgRghtHndSwtch | ( | const swtchBhvrCfg_t & | newCfg | ) |
Configures the TmVdblMPBttn class object used as Right Hand Switch
Some behavior attributes of the DbncdMPBttn subclasses objects components can be configured to adjust the behavior of the LimbsSftyLnFSwtch. In the case of the TmVdblMPBttn used as Right Hand Switch the attributes available for adjustment are:
newCfg | A swtchBhvrCfg_t type structure, containing the parameters values that will be used to modify the configuration of the TmVdblMPBttn class object. |
fncVdPtrPrmPtrType LimbsSftyLnFSwtch::getFnWhnTrnOffLtchRlsPtr | ( | ) |
Returns the function that is set to execute every time the object's Latch Release is set to Off State.
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffLtchRlsPtr() method. If such function is set, it will be executed every time the **_ltchRlsIsOn** attribute flag is set to false
nullptr | if there is no function set to execute when the object enters the indicated condition. |
fncVdPtrPrmPtrType LimbsSftyLnFSwtch::getFnWhnTrnOffPrdCyclPtr | ( | ) |
Returns the function that is set to execute every time the object's Production Cycle is set to Off State.
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffPrdCyclPtr() method. If such function is set, it will be executed every time the **_prdCyclIsOn** attribute flag is set to false
nullptr | if there is no function set to execute when the object enters the indicated condition. |
fncVdPtrPrmPtrType LimbsSftyLnFSwtch::getFnWhnTrnOnLtchRlsPtr | ( | ) |
Returns the function that is set to execute every time the object's Latch Release is set to On State.
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnLtchRlsPtr() method. If such function is set, it will be executed every time the **_ltchRlsIsOn** attribute flag is set to true
nullptr | if there is no function set to execute when the object enters the indicated condition. |
fncVdPtrPrmPtrType LimbsSftyLnFSwtch::getFnWhnTrnOnPrdCyclPtr | ( | ) |
Returns the function that is set to execute every time the object's Production Cycle is set to On State.
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnPrdCyclPtr() method. If such function is set, it will be executed every time the **_prdCyclIsOn** attribute flag is set to true
nullptr | if there is no function set to execute when the object enters the indicated condition. |
SnglSrvcVdblMPBttn * LimbsSftyLnFSwtch::getFtSwtchPtr | ( | ) |
Get the ftSwcthPtr attribute value.
The ftSwcthPtr is the pointer to the SnglSrvcVdblMPBttn class object instantiated to be the "Foot Safety Switch", so to have direct access to it's public members without going through a LimbsSftyLnFSwtch interface.
TmVdblMPBttn * LimbsSftyLnFSwtch::getLftHndSwtchPtr | ( | ) |
Get the lftHndSwcthPtr attribute value.
The lftHndSwcthPtr is the pointer to the TmVdblMPBttn class object instantiated to be the "Left Hand Safety Switch", so to have direct access to it's public members without going through a LimbsSftyLnFSwtch interface.
const bool LimbsSftyLnFSwtch::getLsSwtchOtptsChng | ( | ) | const |
Returns the value of the lsSwtchOtptsChng attribute flag.
The instantiated objects includes attributes linked to their evaluated states, -Attribute Flags- some of them for internal use, some of them for output related purposes. When any of those latter attributes values change, the outputsChange flag is set. The flag only signals that changes have happened -not which flags, nor how many times changes have taken place- since the last outputsChange flag reset, although an internal counter is kept to grant no multithread race conditions affect the correct execution of the outputs updates. The outputsChange flag must be reset (or set if desired) through the setOutputsChange() method.
true | Any of the object's output related behavior attribute flags have changed value since last time outputsChange flag was reset. |
false | no object's output related behavior attribute flags have changed value since last time outputsChange flag was reset. |
uint32_t LimbsSftyLnFSwtch::getLsSwtchOtptsSttsPkgd | ( | ) |
Returns the relevant attribute flags values for the object state encoded as a 32 bits value, required to pass current state of the object to another thread/task managing the outputs changes.
The inter-tasks communication mechanisms implemented on the class includes a xTaskNotify() that works as a light-weigh mailbox, unblocking the receiving tasks and sending to it a 32_bit value notification. This function returns the relevant attribute flags values encoded in a 32 bit value, according to the provided encoding documented.
const bool LimbsSftyLnFSwtch::getLtchRlsIsOn | ( | ) | const |
Returns the ltchRlsIsOn attribute flag value.
The ltchRlsIsOn attribute flag indicates if the object is in the Latch Released state.
true | The object is in the latch released state |
false | The object is in the latch not released state |
unsigned long int LimbsSftyLnFSwtch::getLtchRlsTtlTm | ( | ) |
Returns the time configured to keep the Latch Released state On
const bool LimbsSftyLnFSwtch::getPrdCyclIsOn | ( | ) | const |
Returns the prdCyclIsOn attribute flag value.
The prdCyclIsOn attribute flag indicates if the object is in the Production Cycle state.
true | The object is in the production cycle on state |
false | The object is not in the production cycle on state |
unsigned long int LimbsSftyLnFSwtch::getPrdCyclTtlTm | ( | ) |
Returns the time configured for the production cycle to be completed.
Due to the lack of sensors to register the end/completetion of the production cycle a timer will be set to control the time since the production cycle start and until the cycle is considered completed. This method returns the time configured for that timer
TmVdblMPBttn * LimbsSftyLnFSwtch::getRghtHndSwtchPtr | ( | ) |
Returns the rghtHndSwcthPtr attribute value.
The rghtHndSwcthPtr is the pointer to the TmVdblMPBttn class object instantiated to be the "Right Hand Safety Switch", so to have direct access to it's public members (including setters and getters) without going through a LimbsSftyLnFSwtch interface.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyBthHndsOnMssd | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's state changes from the "foot switch enabled" state to the "foot switch disabled" state, instead of the "Production cycle activated" state.
When the object changes it's state as mentioned, it means an opportunity to activate the production cycle, which is the main purpose of the use of the machine, was wasted. The opportunity of unblocking a blocked task as part of that state transition gives a tool to deal with this situations. Either to react immediately, either to register this situations, as the proportion of these failures compared to the expected behavior may indicate a potential anomaly either in the parameters configuration, command switches failures, machine operator related problems and other cases that harm present productivity and might end in a undesired situation. This method returns the TaskHandle for the task to unblock.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyLsSwtchOtptsChng | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's lsSwtchOtptsChng attribute flags is set to true.
One of the optional mechanisms activated when any attribute flag that includes the mechanism to modify an output pin is the unblocking of a task. This method returns the TaskHandle for the task to unblock.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyTrnOffLtchRls | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's ltchRlsIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Latch Release is Off (ltchRlsIsOn = false) state is the unblocking of a task. This method returns the TaskHandle for the task to unblock.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyTrnOffPrdCycl | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Production cycle is Off (prdCyclIsOn = false) state is the unblocking of a task. This method returns the TaskHandle for the task to unblock.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyTrnOnLtchRls | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Latch Release is On (ltchRlsIsOn = true) state is the unblocking of a task. This method returns the TaskHandle for the task to unblock.
const TaskHandle_t LimbsSftyLnFSwtch::getTskToNtfyTrnOnPrdCycl | ( | ) | const |
Returns the TaskHandle for the task to be unblocked when the object's prdCyclIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Production cycle is On (prdCyclIsOn = true) state is the unblocking of a task. This method returns the TaskHandle for the task to unblock.
void LimbsSftyLnFSwtch::resetFda | ( | ) |
Resets the LsSwitch behavior automaton to it's Initial or Start State
This method is provided for security and for error handling purposes, so that in case of unexpected situations detected, the driving Deterministic Finite Automaton used to compute the objects' states might be reset to it's initial state to safely restart it, maybe as part of an Error Handling procedure.
void LimbsSftyLnFSwtch::setFnWhnBthHndsOnMssd | ( | fncVdPtrPrmPtrType & | newFnWhnBthHndsOnMssd | ) |
Sets the function to be executed when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state.
When the object changes it's state as mentioned, it means an opportunity to activate the production cycle, which is the main purpose of the use of the machine, was wasted. The opportunity to execute a function as part of that state transition gives a tool to deal with this situations. Either to react immediately, either to register this situations, as the proportion of these failures compared to the expected behavior may indicate a potential anomaly either in the parameters configuration, command switches failures, machine operator related problems and other cases that harm present productivity and might end in a undesired situation. This method sets the pointer to the function to call.
newFnWhnBthHndsOnMssd | Function pointer to the function to be executed when the object makes the transition from "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state. |
void LimbsSftyLnFSwtch::setFnWhnTrnOffLtchRlsPtr | ( | fncVdPtrPrmPtrType & | newFnWhnTrnOff | ) |
Sets the function to be executed when the object's ltchRlsIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Latch Release is Off (ltchRlsIsOn = false) state is the execution of a fncVdPtrPrmPtrType function, i.e. void (FnWhnTrnOff)(void). This method sets the pointer to the function.
newFnWhnTrnOff | Function pointer to the function to be executed when the object enters the "Latch Release is Off" state. |
void LimbsSftyLnFSwtch::setFnWhnTrnOffPrdCyclPtr | ( | fncVdPtrPrmPtrType & | newFnWhnTrnOff | ) |
Sets the function to be executed when the object's prdCyclIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Production Cycle is Off (_prdCyclIsOn = false) state is the execution of a fncVdPtrPrmPtrType function, i.e. void (FnWhnTrnOff)(void). This method sets the pointer to the function.
newFnWhnTrnOff | Function pointer to the function to be executed when the object enters the "Production Cycle is Off" state. |
void LimbsSftyLnFSwtch::setFnWhnTrnOnLtchRlsPtr | ( | fncVdPtrPrmPtrType & | newFnWhnTrnOn | ) |
Sets the function to be executed when the object's ltchRlsIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Latch Release is On (ltchRlsIsOn = true) state is the execution of a fncVdPtrPrmPtrType function, i.e. void (FnWhnTrnOn)(void). This method sets the pointer to the function.
newFnWhnTrnOn | Function pointer to the function to be executed when the object enters the "Latch Release is On" state. |
void LimbsSftyLnFSwtch::setFnWhnTrnOnPrdCyclPtr | ( | fncVdPtrPrmPtrType & | newFnWhnTrnOn | ) |
Sets the function to be executed when the object's prdCyclIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Production Cycle is On (_prdCyclIsOn = true) state is the execution of a fncVdPtrPrmPtrType function, i.e. void (FnWhnTrnOff)(void). This method sets the pointer to the function.
newFnWhnTrnOff | Function pointer to the function to be executed when the object enters the "Production Cycle is On" state. |
void LimbsSftyLnFSwtch::setLsSwtchOtptsChng | ( | bool | newLsSwtchOtptsChng | ) |
Sets the value of the attribute flag indicating if a change took place in any of the output attribute flags.
The usual path for the lsSwtchOtptsChng flag is to be set by any method changing an output attribute flag, the callback function signaled to take care of the hardware actions because of this changes clears back lsSwtchOtptsChng after taking care of them. In the unusual case the developer wants to "intercept" this sequence, this method is provided to set (true) or clear (false) lsSwtchOtptsChng value.
newLsSwtchOtptsChng | The new value to set the lsSwtchOtptsChng flag to. |
bool LimbsSftyLnFSwtch::setLtchRlsTtlTm | ( | const unsigned long int & | newVal | ) |
Set the Latch Release Total Time (ltchRlsTtlTm) attribute value.
The ltchRlsTtlTm attribute holds the time the latching mechanism of the cycle machine will be freed to start the production cycle. Due to the primitive mechanical characteristics of these machines, the mechanical latching mechanism might take different times to be effectively released, so the time must be enough to ensure the correct and full unlatch, but not long enough to keep the machine unlatched when the production cycle is completed, as this might generate the next production cycle to start again, now with no limbs protection provided.
newVal | Time in milliseconds to keep the unlatch mechanism activated, must be a value greater than 0, and less than or equal to the "Production cycle time" (see setPrdCyclTtlTm(const unsigned long int)) |
bool LimbsSftyLnFSwtch::setPrdCyclTtlTm | ( | const unsigned long int & | newVal | ) |
Set the Production Cycle Total Time (prdCyclTtlTm) attribute value.
The prdCyclTtlTm attribute holds the total time for the production cycle, starting from the moment the latching mechanism of the cycle machine will be freed to start the production cycle and the hands and foot security switches are disabled. After the production cycle timer set time is consumed, the limbs security switch enters the Cycle closure state, ending with the hands and foot security switches re-enabled to their respective configuration states. Setting a short value to the attribute will produce the switch to be re-enabled before the production cycle ends, generating undesired security risks, setting an extremely long value to the attribute will produce the switch to be unavailable to start a new production cycle, slowing the production, affecting the productivity.
newVal | Time in milliseconds for the production cycle to be active, must be a value greater or equal to the "Latch Release Total Time" (see setLtchRlsTtlTm(const unsigned long int)) |
void LimbsSftyLnFSwtch::setTrnOffLtchRlsArgPtr | ( | void *& | newVal | ) |
Sets the pointer to the arguments for the function to be executed when the object's ltchRlsIsOn attribute flag is set to false.
The function to be executed is the one set by the setFnWhnTrnOffLtchRlsPtr(fncVdPtrPrmPtrType) method, function that expects a void* argument.
newVal | A void* to the argument to be passed to the mentioned function |
void LimbsSftyLnFSwtch::setTrnOffPrdCyclArgPtr | ( | void *& | newVal | ) |
Sets the pointer to the arguments for the function to be executed when the object's prdCyclIsOn attribute flag is set to false.
The function to be executed is the one set by the setFnWhnTrnOffPrdCyclPtr(fncVdPtrPrmPtrType) method, function that expects a void* argument.
newVal | A void* to the argument to be passed to the mentioned function |
void LimbsSftyLnFSwtch::setTrnOnLtchRlsArgPtr | ( | void *& | newVal | ) |
Sets the pointer to the arguments for the function to be executed when the object's ltchRlsIsOn attribute flag is set to true.
The function to be executed is the one set by the setFnWhnTrnOnLtchRlsPtr(fncVdPtrPrmPtrType) method, function that expects a void* argument.
newVal | A void* to the argument to be passed to the mentioned function |
void LimbsSftyLnFSwtch::setTrnOnPrdCyclArgPtr | ( | void *& | newVal | ) |
Sets the pointer to the arguments for the function to be executed when the object's prdCyclIsOn attribute flag is set to true.
The function to be executed is the one set by the setFnWhnTrnOnPrdCyclPtr(fncVdPtrPrmPtrType) method, function that expects a void* argument.
newVal | A void* to the argument to be passed to the mentioned function |
void LimbsSftyLnFSwtch::setTskToNtfyBthHndsOnMssd | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state.
One of the optional mechanisms activated when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state is the unblocking of a task. This method sets the TaskHandle to the task to unblock. When the object changes it's state as mentioned, it means an opportunity to activate the production cycle, which is the main purpose of the use of the machine, was wasted. The opportunity of unblocking of a task as part of that state transition gives a tool to deal with this situations. Either to react immediately, either to register this situations, as the proportion of these failures compared to the expected behavior may indicate a potential anomaly either in the parameters configuration, command switches failures and/or other cases that harm present productivity and might end in a future machine down time. This method sets the TaskHandle for the task to unblock.
newTaskHandle | The task handle of the task to be unblocked when the object's state changes from the "foot switch enabled" to the "foot switch disabled" instead of the "Production cycle activated" state. |
void LimbsSftyLnFSwtch::setTskToNtfyLsSwtchOtptsChng | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when ANY of the object's attribute flags changes it's value.
One of the optional mechanisms activated when any of the relevant attribute flags changes it's state is the unblocking of a task blocked. This method sets the TaskHandle to the task to unblock. This tool is of great importance for the integration between the electronic logic control and the mechanical device it is intended to control. While the "Latch Release status" (ltchRlsIsOn AF) and the "Production Cycle status" (prdCyclIsOn AF) have their own dedicated tasks assignation capabilities, this generic task handle provides for all the relevant AFs, including both aforementioned.
newTaskHandle | The task handle of the task to be unblocked when one or more of the object's relevant AF changes it's value. |
void LimbsSftyLnFSwtch::setTskToNtfyTrnOffLtchRls | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's ltchRlsIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Latch Release is Off (ltchRlsIsOn = false) state is the unblocking of a task blocked by a xTaskNotifyWait(). This method sets the TaskHandle to the task to unblock.
newTaskHandle | The task handle of the task to be unblocked when the object enters the "Latch Release is Off" state. |
void LimbsSftyLnFSwtch::setTskToNtfyTrnOffPrdCycl | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's prdCyclIsOn attribute flag is set to false.
One of the optional mechanisms activated by entering the Production cycle is Off (prdCyclIsOn = false) state is the unblocking of a task blocked by a xTaskNotifyWait(). This method sets the TaskHandle to the task to unblock.
newTaskHandle | The task handle of the task to be unblocked when the object enters the "Production cycle is Off" state. |
void LimbsSftyLnFSwtch::setTskToNtfyTrnOnLtchRls | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's ltchRlsIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Latch Release is On (ltchRlsIsOn = true) state is the unblocking of a task blocked by a xTaskNotifyWait(). This method sets the TaskHandle to the task to unblock.
newTaskHandle | The task handle of the task to be unblocked when the object enters the "Latch Release is On" state. |
void LimbsSftyLnFSwtch::setTskToNtfyTrnOnPrdCycl | ( | const TaskHandle_t & | newTaskHandle | ) |
Sets the task to be unblocked -by a xTaskNotify()- when the object's prdCyclIsOn attribute flag is set to true.
One of the optional mechanisms activated by entering the Production cycle is On (prdCyclIsOn = true) state is the unblocking of a task blocked by a xTaskNotifyWait(). This method sets the TaskHandle to the task to unblock.
newTaskHandle | The task handle of the task to be unblocked when the object enters the "Production cycle is On" state. |
bool LimbsSftyLnFSwtch::setUndrlSwtchsPollDelay | ( | const unsigned long int & | newVal | ) |
Sets the update period length for the DbncdMPBttn subclasses objects used as input by the LimbsSftyLnFSwtch.
Sets the periodic timer used to check the inputs and calculate the state of the object, time period value set in milliseconds.
newVal | Value to set for the update period, the period must be greater than the minimum debounce default value. |
true | The value was in the accepted range and successfully changed |
false | The value was not in the accepted range and was not successfully changed |