write EventLog from FP
Is it possible write log messages in the EventLog from FP SDK?
or is read only from FP?
thanks
Marcos Foglino
Comments
-
You are correct, however you can write to the error log using RAPID instructions such as ErrWrite and ErrLog. You could probably use trap routines and RAPID data or IO to generate error messages pretty easily by setting a signal or values (via FPSDK) whenever you want to write an error, then have the trap routine call the appropriate RAPID instruction to generate the error log entry.Russell Drown0
-
Ok, thanks Russ!
0 -
Russ,
Could you show me a example of how call this RAPID instruccions from FP SDK?
thanks.
0 -
You can't actually call the RAPID routine from the FPSDK, but you can use FPSDK to write to a RAPID data value or set a signal that can be connected to a TRAP routine in RAPID code that would execute the RAPID ErrWrite instruction.
For example, whenever you need to log an error message you could use FPSDK to write a numeric value representing an error code to a PERS num called nError. This variable would be declared somewhere in your RAPID code.
In the RAPID code you would set up an interrupt and trap routine connected to nError. THis is often done in an event routine, see the RAPID documentation for more info.
VAR intnum nError_int;
CONNECT nError_int WITH nErrorTrap;
IPers nError, nErrorTrap;
TRAP nErrorTrap
TEST nError
CASE 1:
ErrWrite "Error 1", "error 1 happened";
CASE 2:
ErrWrite "Error 2", "error 2 happened";
CASE 0:
!do nothing, error cleared
DEFAULT:
ErrWrite "Unknown Error", "unknown error happened";
ENDTEST
!reset the error value if necessary
IF nError>0 THEN
nError:=0;
ENDIF
ENDTRAP
Russell Drown0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 314 IRC5
- 60 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 794 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings