When engineering a non-trivial automation solution in AX Code Desktop IDE, the user will be required to execute multiple commands against a PLC. While apax scripting provides a method of automating common workflows, ad-hoc command invocation through the GUI requires information such as IP address and device certificate to be provided for every command that communicates with a PLC. To optimize this workflow, a user may persist one or more pieces of connection information in their project structure and simply reference this information via unique identifier. These files are known as "Local Connection Configuration" files.
Note
The use of this functionality is optional and carries additional security implications that must be considered. Please read this entire page and evaluate the security risks before using this functionality.
The AX Code Desktop IDE will look inside of the .ax/plcs folder of the current workspace for local connection configuration files, as shown by this example filesystem file/folder structure:
Note
After creating the .ax/plcs folder in a workspace, a user can generate a .yaml file that contains basic PLC connection information using the PLC Browser Extension. See the PLC Browser usage documentation for more information.
<workspace>
|── .apax
|── .ax
| |── plcs
| |── Plc_1.yaml
| |── Plc_2.yaml
| |── certificates
| |── PLC-Communication-1.pem
| |── PLC-Communication-2.pem
|── .git
|── bin
|── obj
|── src
|── test
|── apax.yml
Note
Case sensitivity of file/folder naming is important on filesystems that support case-sensitive filenames. All examples show the correct casing for file/folder names.
PLC connection information is identified by its filename (e.g. Plc_1.yaml). A file extension is not required for these files, but including a proper YAML extension will allow AX Code IDE to provide helpful features such as syntax highlighting when editing the file. The contents of this file should be valid YAML with a root mapping consisting of the following fields:
| Key | Description |
|---|---|
host |
IPv4 address of the target PLC (required) |
certificate |
Certificate to use for verifying the identity of the PLC |
displayName |
Alternate identifier for this connection information |
comment |
Freeform field for documentation purposes |
Fields not marked as "required" are optional and may be omitted. The AX Code Desktop IDE may prompt for this information if required for issuing a command to a PLC. If a specific field is not needed for a connection, set its value to null (i.e. certificate: ~ ) to indicate that no value is needed for this field.
Note
Due to current tool limitations, directly specifying a certificate for the certificate field is not possible; see !certificate directive for handling of certificates. This restriction may be removed in the future.