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
).
Diagnostics
The extension also check some typo mistakes such as unclosed or not opened angular quotes, duplicated declaration and warn the user if there is any Breakpoints left on the opened files:
Breakpoints:
Declarations:
Structures check are also made to check missing statement parts:
Snippets
!!! note "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
Commands can be found with a right click on a context of a *.gcmac
file or *.scl
!!! important "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 "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."
Format gcmac
files with the following rules:
- Indentation of code
- Remove trailing space from brackets
- Add space before and after assignment
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 work item for it and make a Pull Request so we can approve it to merge to master branch and release it to the Marketplace.
Software Requirements
- Git
- Node JS
- Visual Studio Code
Extension Dependencies
Process
- Install globally the VSCE package:
npm install --global vsce
- Install all required packages:
npm install
- Build and watch to debug:
npm run watch
- Now you are able to run the debugger instance going to the debugger tab of Visual Studio and running the "Run Extension" task.
Release new version
- Need to be member of Buhler AG publisher
- For minor version, just type
npm run vsce-publish
- For major version, change it on package.json and run
vsce publish
Pre-release
- If one feature is needed for testing it is possible to publish a pre release version typing:
vsce publish --pre-release
Known Issues
None at the moment.