Close files on user stop
Hi,
in my program some files are opened at the beginning and data is continually written to and read from these files. The files are closed before ENDPROC.
How can these files be closed when the user stops execution of the program? UNDO doesn't work in this case.
Any help appreciated!
Regards,
Michael
0
Comments
-
Hi Michael,
You need to have a background task (which runs continuously while the controller is powered) to manage communication with the files.
Your foreground task would pass data to the background task for writing.
The background task would monitor execution of the foreground task and close the files when execution stops.
You will need the 'Multitasking' RobotWare option in your controller in order to do this.
Regards,
Kevin
0 -
Thanks for the tip Kevin, I'll see into this after the weekend :-)
Best regards,
Michael
0 -
...if you don't have Multitasking, take a look at Event Routines for the "STOP" event. This is a way to trig a Rapid routine when a specific event occur. Event routines are set up in the Controller section of the System parameters. It might be a good idea to declare the routine in a system module.0
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
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings