Proyecto de Tesis en Mecatrónica. Universidad Técnica del Norte. Ernesto Palacios <mecatronica.mid@gmail.com>
Dependencies: EthernetNetIf HTTPServer QEI_hw RPCInterface mbed
Revision 34:bdf918bc9b59, committed 2014-07-05
- Comitter:
- Yo_Robot
- Date:
- Sat Jul 05 04:11:35 2014 +0000
- Parent:
- 33:e6ff02c3e0f5
- Child:
- 35:92b0f1b75a51
- Child:
- 36:a99dcd4d8f65
- Child:
- 37:20f4a737cc13
- Commit message:
- Aumentada una funcion para consultar alarma en ethernet, aun falta la solucion para la posici?n
Changed in this revision
--- a/main.cpp Tue Jun 24 17:42:25 2014 +0000 +++ b/main.cpp Sat Jul 05 04:11:35 2014 +0000 @@ -76,6 +76,7 @@ RPCFunction ClrEnc (&setENC_eth, "CLR"); RPCFunction ReadRPM(&getRPM_eth, "RPM"); RPCFunction GoHome(&setHOME_eth, "INI"); +RPCFunction GetAlm( &getALM_eth, "ALM"); int main() {
--- a/setup.cpp Tue Jun 24 17:42:25 2014 +0000 +++ b/setup.cpp Sat Jul 05 04:11:35 2014 +0000 @@ -856,7 +856,31 @@ } - +void getALM_eth ( char * input, char * output ) +{ + + if( pin_alm == 0 ) + { + if ( limite_2 == 1 ) // Alarma muy cerca al encoder + { + sprintf( output,"A2\r\n" ); + } + if ( limite_3 == 1 ) // Alarma muy cerca al encoder + { + sprintf( output,"A1\r\n" ); + } + if ( limite_1 == 1 || limite_4 == 1 ) // ERROR DE POSICION + { + sprintf( output,"A0\r\n" ); + } + + else + sprintf( output,"OK\r\n" ); + } + else + sprintf( output,"AL" ); + +} /* LEGACY FUNCTIONS
--- a/setup.h Tue Jun 24 17:42:25 2014 +0000 +++ b/setup.h Sat Jul 05 04:11:35 2014 +0000 @@ -165,6 +165,10 @@ void setHOME_eth( char * input, char * output ); +/** @brief: Comprueba el estado de las alarmas + */ +void getALM_eth ( char * input, char * output ); + //________________ FUNCIONES ENCODER __________________// /** @brief: Cambiar Direccion @ PTO