资 源 简 介
/*The program sets an arrays of positions and speeds.On the digital input #6 trigger, the program moves forward, waits one second and returns.The destination and speed of the motion are defined according to the values in the speed and position arrays, with an index set by digital inputs #1 through #5.When an error occurs, the program stops and digital output #1 is raised.The motions are executed by functions called by the main program.Errors are detected in the motion functions and returned to the main program.*///Global Variable declarationint Destination[32];int MotionSpeed[32];int MaxDest;int MaxSpeed;//Functions declarationfunction int Err = MoveForward(int MoveIndex); function int Err = MoveBack(int MoveIndex);//Program##PROGRAM1//Local variables declarationint i;float Coeff;//Program bod