Cellwrite Studio operating manual · CWS-OM-001, revision A
Programming
This chapter describes the Code workspace: the editor, finding things in programs, checking them and saving them.
The editor
The editor shows one module in each tab. RAPID keywords, data, strings and comments have their own colours. The gutter shows line numbers, bookmarks and the lines changed since the backup was opened.
- While you type, the names the program knows are offered: routines, data, signals, instructions and their arguments. Tab or Enter takes the name offered, Esc closes the list.
- Hold the pointer over a name to see what it is: a routine's arguments, a point's values, an instruction's syntax.
- Ctrl+click a name to go to where it is declared.
- Errors are underlined while you type. Hold the pointer over the line to read the error.
Finding
| Command | Keys | What it does |
|---|---|---|
| Find | Ctrl+F | Finds text in the module in front. |
| Replace | Ctrl+H | Finds and replaces in the module in front. |
| Find next | F3 | Goes to the next match. |
| Find in files | Ctrl+Shift+F | Finds text in every module of the backup, or of every robot open. |
| Find references | Shift+F12 or F4 | Every place the name under the cursor is used. |
| Definition | F12 | Where the name under the cursor is declared. |
| Search | Ctrl+K | A routine, point or signal of any robot open, by name. |
| Go to symbol | Ctrl+Shift+O | A routine or data in the module in front. |
| Go to line | Ctrl+G | A line of the module in front. |
| Find anything | Ctrl+Shift+A | Describe what you are looking for in your own words. |
| Commands | Ctrl+Shift+P | Every command of the program, by name. |
The Go to group of the ribbon has a list of the module's routines. Select one to go to it.
Editing tools
| Command | Keys | What it does |
|---|---|---|
| Comment | Ctrl+/ | Comments or uncomments the lines selected. |
| Format | Shift+Alt+F | Lays the module out to the style set in Settings > Formatting. By default only what is out of place is changed. |
| Bookmark | Ctrl+F2 | Sets or clears a bookmark on the line. Ctrl+B goes to the next bookmark, Ctrl+Shift+B to the one before. |
| Undo and Redo | Ctrl+Z and Ctrl+Y | Every change, including those made by Cellwrite AI and by the Points tools. |
Checking programs
Check program (F8) checks every module of the program together, as the controller does when the program is loaded. It finds, for example:
- names that are not declared anywhere in the program or the system;
- instructions with missing or wrong arguments;
- data of the wrong type;
- routines that cannot be reached, and data that is never used;
- moves with a tool, work object or point that does not exist.
A name is marked as unknown only when the whole program is open. A single module opened on its own may use names declared in other modules, so those are not marked.
The checks and how serious each one is are set in Settings > Code checks.
Note
Check program reads the program as the controller reads it, but it is not the controller. A program that loads on the controller is the final test.
The RAPID reference
Hold the pointer over an instruction, function or data type to see a short description and its syntax. Press F1 with the cursor on it to open its page in Appendix A. The page can open the ABB manual at the same instruction.
Several robots
Several backups can be open together. The Explorer lists each one. Find in files and Search look through all of them. The robot whose module is in front is the active robot; the 3D view, the Inspector and Check program work on it.
Call graph
Code > Call graph shows which routine calls which. Double-click a routine to open it.
Saving
| Command | Keys | What it saves |
|---|---|---|
| Save | Ctrl+S | The module in front. |
| Save backup | Ctrl+Shift+S | Every changed module of the backup. |
| Save module copy | The module in front, to a new file. | |
| Save backup copy | The whole backup with its changes, to a new folder. The backup opened stays as it was. |
A module with errors is saved. The status bar says how many errors it holds and the Problems panel lists them.
FANUC robots
A FANUC backup opens in the same way as an ABB backup. Its TP programs are shown as listings, with their points, registers and signals. Find references, Definition, Check program and the 3D view work in the same way. A compiled program in the backup (a .PC file) opens read only, on a page of its own that lists what calls it and the variables it holds.