Reading command string from .txt file
Hey guys,
Is there any way I can read a MoveL command stored on a txt file? I've been trying to use the ReadStr function but the path to the text file on my pc is not being acknowledged by the compiler. The program runs perfectly until it stops at the Open file line with the path.
I'm trying to follow this example I saw on RAPID's manual:
Instead of "HOME:/file.doc" I'm using "C:\test\test_v1", which is the location of the txt file on my pc. I'm sorry if it sounds stupid but I'm just beginning to work with the RAPID language and I'm still not familiar with its synthax.
What is this "HOME:\" in the beginning of the example path? I inittially assumed it was there just for the sake of the example and that this would actually be my C:\ drive, but I keep getting errors if I refer to C:\. Is it something I have to set on RobotStudio?
Btw, I've connected the pc directly to the robot i.e., there's no intervention through the FlexPendant. The robot is an IRB 1600, 6kg, 1.45m with an IRC5 controller.
Any ideas on what the correct synthax for the path should be?
Any help would be greatly appreciated!
Alessandra
Comments
-
Hello moraisale:
You made a mistake,If you put your file in the lacation: C:\test\test_v1, You should write like this: c:/test/test_v1.txt. The Rapid code will be like this:PROC main()Open "c:/test/test_v1.txt", infile\Read;text := ReadStr(infile);TPWrite text;Close infile;ENDPROCI tested the code,it was running OK. I think it can help you. Any questions, we can have a further comunication.Post edited by jerry-licao on0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings