Mostrando postagens com marcador roboguide. Mostrar todas as postagens
Mostrando postagens com marcador roboguide. Mostrar todas as postagens

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!

segunda-feira, 9 de março de 2020

O editor de textos secreto do Roboguide




Não é tão secreto assim, pra falar a verdade. Além disso, está bem descrito no help do Roboguide. Mas quem lê o help, né? 😀

Entretanto, como acontece em outros recursos da IDE da FANUC, sua localização não é evidente, e muita gente não sabe dessa possibilidade.

Editar programas no Roboguide costuma ser uma atividade trabalhosa. Mesmo com o uso de atalhos, o TP virtual pode não ser a maneira mais confortável de escrever um programa.

E aí entra o editor de textos.

Com ele, é possível editar qualquer arquivo de texto (ou ASCII, usando a nomenclatura da FANUC) reconhecido por um robô do fabricante, dentro do próprio Roboguide.


A melhor maneira de utilizá-lo é reunir os arquivos “fonte” que estão em formato texto/ASCII (.ls, .kl, .cm, etc) em uma pasta no PC, que vamos chamar de repositório. Coloque um nome que seja fácil de lembrar. Se você tem mais de um robô na célula, crie um repositório para cada um.
Na árvore do projeto (Cell Browser), dentro de cada controlador, há um item chamado Files.


Clique no mesmo com o botão direito, e clique na opção Add.



Selecione os arquivos que vocẽ deseja carregar no projeto, e alterar usando o editor.
 

 Note que os mesmos aparecerão na árvore do projeto, sob o item Files.

Toda vez que você der um duplo clique nesse arquivo, o editor já vai abrir.



Após fazer as edições necessárias, clique na tecla Build.


Feito isso, o programa será convertido para o formato formato binário correspondente, e será salvo no repositório e também será carregado no controlador virtual, como se fosse feito um LOAD através do gerenciador de arquivos do robô.




Em caso de erro de sintaxe, o programa não será compilado, e vai surgir uma mensagem de falha, indicando a linha e a coluna onde está localizado o erro.


Note que esse método tem algumas limitações.

Não há nenhum tipo de sincronia entre o repositório e a lista Files do Roboguide. Toda vez que se colocar um arquivo no repositório através do Windows Explorer, é necessário adicioná-lo manualmente no Files.

Também não há nenhum tipo de sincronização entre os arquivos ASCII (Files) e binários (Programs). O sentido do desenvolvimento deve ser sempre ASCII > Build > Binário > Testes.

Isso pode ser meio óbvio no caso dos arquivos Karel, que não podem ser editados via TP, mas pode ser meio confuso no caso de programas convencionais.

Se você faz edita um arquivo ASCII, faz o Build, e depois continua editando o mesmo através do Teach Pendant virtual, o arquivo fonte NÃO será atualizado com essas mudanças. Se você quiser manter seu repositório atualizado, será necessário exportar o programa como ASCII de dentro do robô virtual, e sobrescrever o mesmo dentro do repositório.

Por outro lado, apagar um arquivo no Cell Browser não apaga ele no repositório, o que acaba criando uma camada de segurança extra.

Além dos arquivos que são reconhecidos pelo robô, também é possível criar arquivos .txt. Nesses não é possível dar um Build. Mas você pode, por exemplo, criar um arquivo chamado Notas.txt, adicioná-lo na lista Files, e usar esse arquivo como um bloco de notas referente àquele projeto, editando o mesmo de dentro do próprio Roboguide.


Embora pareça uma boa ideia, não acho seguro deixar o repositório dentro da célula do robô pois, em alguns casos, quando é necessário dar um “clean” na célula, muitas vezes o Roboguide apaga os arquivos, ou restaura um backup anterior.

Acredito que o Roboguide ficaria ainda mais prático se tivesse mais duas pequenas funcionalidades:

1) ao clicar em um programa na árvore do projeto, o mesmo poderia ser convertido automaticamente para .ls e já ser aberto no editor, em vez de abrir no TP virtual. Na verdade, nem estou certo sobre a necessidade da conversão, visto que no MD: do robô virtual já existem os arquivos convertidos para formato .ls. Isso também ajudaria na sincronização dos arquivos, visto que toda vez que um programa é editado via TP (real ou virtual), sua cópia em formato .ls é salva no MD.

2) abrir arquivos individuais no Roboguide, como acontece no RobotStudio, por exemplo. Hoje é necessário criar uma célula, e carregar o programa dentro do robô virtual.

Dúvidas, comentários, sugestões sobre esse post ou sobre o conteúdo do blog?

Cola lá no grupo do Telegram!

P.S.: meus sinceros agradecimentos ao Douglas, que me avisou do problema com as imagens do post. Valeu, mano!