
This is a remote control tester, it uses a CNC, Ethernet Communication with a JAVAFX interface and a PLC in order to control some valves.
Dependencies: EthernetInterface mbed-rtos mbed
Fork of CNC_CONTROLLER by
EixoMonitoring.h@0:7cedfb720712, 2017-06-07 (annotated)
- Committer:
- waspSalander
- Date:
- Wed Jun 07 13:31:02 2017 +0000
- Revision:
- 0:7cedfb720712
- Child:
- 1:ef18c260ce02
CNC_Controller (2 mechanical axis)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
waspSalander | 0:7cedfb720712 | 1 | #ifndef EIXO_MONITORING_H |
waspSalander | 0:7cedfb720712 | 2 | #define EIXO_MONITORING_H |
waspSalander | 0:7cedfb720712 | 3 | |
waspSalander | 0:7cedfb720712 | 4 | #include "mbed.h" |
waspSalander | 0:7cedfb720712 | 5 | #include "rtos.h" |
waspSalander | 0:7cedfb720712 | 6 | #include "Debug.h" |
waspSalander | 0:7cedfb720712 | 7 | |
waspSalander | 0:7cedfb720712 | 8 | |
waspSalander | 0:7cedfb720712 | 9 | //#define DELAY_TIMER 500 |
waspSalander | 0:7cedfb720712 | 10 | |
waspSalander | 0:7cedfb720712 | 11 | class EixoMonitoring { |
waspSalander | 0:7cedfb720712 | 12 | |
waspSalander | 0:7cedfb720712 | 13 | public: |
waspSalander | 0:7cedfb720712 | 14 | int delayTimer; |
waspSalander | 0:7cedfb720712 | 15 | int hitSensor; |
waspSalander | 0:7cedfb720712 | 16 | Debug* debug; |
waspSalander | 0:7cedfb720712 | 17 | |
waspSalander | 0:7cedfb720712 | 18 | |
waspSalander | 0:7cedfb720712 | 19 | // Variáveis e Controle do Movimento do Eixo |
waspSalander | 0:7cedfb720712 | 20 | static bool stopAll; // false: n calibrado true: calibrado, cnc está no estágio de teste |
waspSalander | 0:7cedfb720712 | 21 | static bool isCalibrated; // false: n calibrado true: calibrado, cnc está no estágio de teste |
waspSalander | 0:7cedfb720712 | 22 | bool stopMoviment; // false: gira motor true: pára motor |
waspSalander | 0:7cedfb720712 | 23 | bool stopMonitoring; // false: executa threads true: pára threads |
waspSalander | 0:7cedfb720712 | 24 | |
waspSalander | 0:7cedfb720712 | 25 | // Switches e seu vetor de leitura |
waspSalander | 0:7cedfb720712 | 26 | int sensorInput_End; |
waspSalander | 0:7cedfb720712 | 27 | DigitalIn* sensor_End; |
waspSalander | 0:7cedfb720712 | 28 | int sensorInput_Origin; |
waspSalander | 0:7cedfb720712 | 29 | DigitalIn* sensor_Origin; |
waspSalander | 0:7cedfb720712 | 30 | |
waspSalander | 0:7cedfb720712 | 31 | |
waspSalander | 0:7cedfb720712 | 32 | // Threads |
waspSalander | 0:7cedfb720712 | 33 | Mutex stdioMutex; // controle de Acesso Mútuo |
waspSalander | 0:7cedfb720712 | 34 | Thread sensorThread_End; // threads de leitura dos sensores |
waspSalander | 0:7cedfb720712 | 35 | Thread handleSensorThread_End; // threads para lidar com a leitura dos sensores |
waspSalander | 0:7cedfb720712 | 36 | Thread sensorThread_Origin; // threads de leitura dos sensores |
waspSalander | 0:7cedfb720712 | 37 | Thread handleSensorThread_Origin; // threads para lidar com a leitur |
waspSalander | 0:7cedfb720712 | 38 | |
waspSalander | 0:7cedfb720712 | 39 | EixoMonitoring(PinName, PinName); |
waspSalander | 0:7cedfb720712 | 40 | void startThreads(); |
waspSalander | 0:7cedfb720712 | 41 | void stopThreads(); |
waspSalander | 0:7cedfb720712 | 42 | void readSensor_End(); |
waspSalander | 0:7cedfb720712 | 43 | |
waspSalander | 0:7cedfb720712 | 44 | void handleReadSensor_End(); |
waspSalander | 0:7cedfb720712 | 45 | void readSensor_Origin(); |
waspSalander | 0:7cedfb720712 | 46 | void handleReadSensor_Origin(); |
waspSalander | 0:7cedfb720712 | 47 | }; |
waspSalander | 0:7cedfb720712 | 48 | |
waspSalander | 0:7cedfb720712 | 49 | #endif |
waspSalander | 0:7cedfb720712 | 50 |