GCPro Macro Language README
Buhler GCPro is a tool that helps engineers to program PLC with ease and embedded know-how.
GCPro functionalities can be extended by using Macros (gcmac files) which are use during compilation to achieve the expected result.
This Extension is used to help users with the macro syntax and provide a better view of the macro file.
Features
The instructions are tokenized and highlighted as it should be described on GCPro Developer Manual (normally under C:\Program Files (x86)\Gcpro\GCPRO-NET-Developer_MAN_1A_en.pdf
).
The extension also check some typo mistakes such as unclosed or not opened angular quotes, duplicated sub declaration and warn the user if there is any Breakpoints left on the opened files:

Snippets
sub
: Create Sub structure with comment out of the title.

CamelCase and Underscores are replaced by space on description after tab
function
: Create function structure
if
: Create If structure
ifelse
: Create If Else structure
ifelseif
: Create If ElseIf structure
looptree
: Create LOOPTREE structure
looptype
: Create LOOPTYPE structure
loopobj
: Create LOOPOBJ structure
loops7block
: Create LOOPS7BLOCK structure
loops7tag
: Create LOOPS7TAG structure
loopconnectors
: Create LOOPCONNECTORS structure
with
: Create With structure
while
: Create While structure
for
: Create For structure
foreach
: Create ForEach structure
Commands
Important: If there is any at sign (@
) inside the selection, it will be removed.
Format SCL Code Indentation
(shortcut: ctrl+shift+g ctrl+shift+f): Format the correct indentation for all output line that starts with a tab, skipping the other lines.

Convert to SCL
(shortcut: ctrl+shift+g ctrl+shift+c): Try to convert the selected text from AWL to SCL.

Important: Convert to SCL
It is a Beta command, that means you always have to double check the converted text. It also only handle the output string, so you may have to arrange the lines to select only output strings.
Requirements
You need GCPro to run the macros and to debug it you need GCPro Development version.
Additional Visual Studio Code configuration
Contribute
Everyone is really welcome to contribute to the GCPro Macro Language. Only Buhler employers have access to the repository.
If you add a feature or solve a bug, please create another branch, add a workitem for it and make a Pull Request so we can approve it to merge to master branch and release it to the Market place.
Software Requirements
- Git
- Node JS
- Visual Studio Code
Process
- Install globally the VSCE package:
npm install --global vsce
- Install all required packages:
npm install
- Build the package:
npm run vsce-package
- Now you are able to run the debugger instance going to the debugger tab of Visual Studio and running the "Run Extension" task.

Known Issues
None at the moment.