User Tools

Site Tools


plc:ferror_implementation

FERROR implementation

FERROR.plc
main()
{
 
do{
 
 
    ferror=0;
    n=0;
    a0=gvarget(9016); if (a0<0){ a0=0-a0;};
    a1=gvarget(9017); if (a1<0){ a1=0-a1;};
    a2=gvarget(9018); if (a2<0){ a2=0-a2;};
    a3=gvarget(9019); if (a3<0){ a3=0-a3;};
    a4=gvarget(9020); if (a4<0){ a4=0-a4;};
    a5=gvarget(9021); if (a5<0){ a5=0-a5;};
 
 
    if (a0>5)  {ferror=1;};
    if (a1>5)  {ferror=1;};
    if (a2>5)  {ferror=1;};
    if (a3>5)  {ferror=1;};
    if (a4>5)  {ferror=1;};
    if (a5>5)  {ferror=1;};
 
 
    if (ferror!=0) //turn off ALL the servos
     {
       gvarset(60001,1);  //Servo OFF
     };
 
}while(1);
 
exit(99);
};
plc/ferror_implementation.txt · Last modified: 2018/09/24 21:41 by skirillov

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki