terça-feira, 6 de abril de 2021

Roboguide secret text editor

(Published originally in Portuguese here
 
It's not that secret, and it is well described in the Roboguide help. But who reads the help, after all? 😀

However, as with other FANUC IDE resources, its location is not evident, and many people are unaware of this feature.

Editing programs in Roboguide is often a laborious activity. Even with the use of shortcuts, virtual TP may not be the most comfortable way to write a program.

And there comes the text editor.

With it, it is possible to edit any text file (or ASCII, using the FANUC nomenclature) recognized by a robot from the manufacturer, within the Roboguide itself.
 

The best way to use it is to gather all “source” files that are in text / ASCII format (.ls, .kl, .cm, etc.) in a folder on the PC, which we will call a repository. Put a name that is easy to remember. If you have more than one robot in the cell, create a repository for each one.

In the project tree (Cell Browser), inside each controller, there is an item called Files.


Right-click on it, and click on the Add option.

 
 Select the files you want to upload to the project, and change them using the editor.
 
 

Note that they will appear in the project tree, under the Files item.

Every time you double-click on that file, the editor will open.


After making the necessary edits, click on the Build button.


Once this is done, the program will be converted to the corresponding binary format, and will be saved in the repository and will also be loaded into the virtual controller, as if a LOAD was made through the robot's file manager.



In case of syntax error, the program will not be compiled, and a failure message will appear, indicating the line and column where the error is located.


Please note that this method has some limitations.

There is no synchronization between the repository and the Roboguide Files list. Every time a file is placed in the repository through Windows Explorer, it is necessary to manually add it to Files.

There is also no synchronization between ASCII files (Files) and binary files (Programs). The development direction should always be ASCII> Build> Binary> Tests.

This can be somewhat obvious in the case of Karel files, which cannot be edited via TP, but  can be confusing in the case of conventional programs.

If you edit an ASCII file, build it, and then continue editing it through the virtual Teach Pendant, the source file will NOT be updated with these changes. If you want to keep your repository up to date, you will need to export the program as ASCII from within the virtual robot, and overwrite it within the repository.

On the other hand, deleting a file in Cell Browser does not delete it in the repository, which ends up creating an extra layer of security.

In addition to the files that are recognized by the robot, it is also possible to create .txt files. In these it is not possible to give a Build. But you can, for example, create a file called Notes.txt, add it to the Files list, and use that file as a notepad for that project, editing it from within Roboguide itself.


 
Although it seems like a good idea, I don't think it's safe to leave the repository inside the robot's cell because, in some cases, when it is necessary to "clean" the cell, Roboguide often deletes the files, or restores a previous backup.

I believe that Roboguide would be even more useful for heavy programming tasks if it had two more small features:

1) when clicking on a program in the project tree, it could be automatically converted to .ls and opened in the editor, instead of opening in the virtual TP. In fact, I'm not even sure about the need for conversion, since the MD: of the virtual robot already has the files converted to .ls format. This would also help in the synchronization of files, since every time a program is edited via TP (real or virtual), its copy in .ls format is saved on the MD.

2) open individual files in Roboguide, as in RobotStudio, for example. Today it is necessary to create a cell, and load the program inside the virtual robot.

Questions, comments, suggestions about this post or about the blog content?

Show up in our Telegram group!

P.S .: My sincere thanks to Douglas, who warned me of the problem with the images in the post. Thanks bro!