12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ReadErrDataAdvanced <strong>RAPID</strong>InstructionE.g. 10008 Program restarted, is returned as 8.ErrorTypeData type: errtypeThe type of event such as error, state change, or warning that occurred.Ref. to predefined data of type errtype.[ \Str1 ] ... [ \Str5 ] Data type: stringThe string holding information that is intermixed into the error message. Therecould be up to five strings in a message. Str1 holds the first string, Str2 holds thesecond string and so on. Information about how many strings there are in a messageis found in User Guide - Error Management, System and Error Messages.The intermixed string are maked as %s, %d or %f in that document.Program executionThe ErrorDomain, ErrorId, ErrorType and Str1 ... Str5 variables are updated accordingto the contents of TrapEvent.If different events are connected to the same trap routine, the program must make surethat the event is related to error monitoring. This can be done by testing that INTNOmatches the interrupt number used in the instruction IError;ExampleVAR intnum err_interrupt;VAR trapdata err_data;VAR errdomain err_domain;VAR num err_number;VAR errtype err_type;...CONNECT err_interrupt WITH trap_err;IError COMMON_ERR, TYPE_ERR, err_interupt;...IDelete err_interrupt;...TRAP trap_errGetTrapData err_data;ReadErrData err_data, err_domain, err_number, err_type;! Set domain no 1 ... 13SetGO go_err1, err_domain;! Set error no 1 ...9999SetGO go_err2, err_number;ENDTRAPWhen an error occurs (only errors, not warning or state change), the error numberis retrieved in the trap routine and its value is used to set 2 groups of digital outputs.384 <strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!