GETERROR                Read slave’s error

Syntax                        

GETERROR VAR32

GET oldest ERROR from RAM

GETERROR n,VAR32

GET n-th ERROR from EEPROM

 

OperandsVAR32: 32-bit long variable to store the error

       n : error position in the circular buffer

PlaceTMLOnline

Binary code

GETERROR

DescriptionThe motion controller uses a circular buffer in RAM to store the slaves’ errors. The buffer can hold up to 8 error codes. If an error is received and the buffer is full then the new error will overwrite the oldest one. The buffer is read with GETERROR VAR32 command which retrieves the oldest error from the motion controller RAM. The error code is saved in VAR32. Once it was read the buffer entry is released. GETERROR VAR32 returns zero when the buffer is empty.

       The GETERROR n, VAR32 retrieves n-th error stored in the non-volatile memory of the drive. The errors are stored in a circular buffer that can hold up to 8 error codes, n = 0 oldest entry and n = 7 newest entry. The errors can be saved in the EEPROM with the command SAVEERROR command.

 

Example

// Retrieve oldest 3 errors and save them in the EEPROM

 LONG error_code; //define variable error_code

 GETERROR error_code; //Read oldest error from motion controller RAM

 SAVEERROR error_code; // Save the error in the motion controller EEPROM

 GETERROR error_code; //Read second error from motion controller RAM

 SAVEERROR error_code; // Save the error in the motion controller EEPROM

 GETERROR error_code; //Read third error from motion controller RAM

 SAVEERROR error_code; // Save the error in the EEPROM

 GETERROR 1, error_code; // Retrieve second error from the EEPROM

 SEND error_code; // Send third error code to the host