To connect to a PLC, sld needs connection parameters. These parameters are documented here once and apply to all sld commands that require a PLC connection such as LOAD.
| Parameter | Description |
|---|---|
| -t, --target | IP address of the SIMATIC PLC or the PLC alias. |
| -p, --password | Add a legitimation password for the PLC (e.g. '-p "MY_PASSWORD"'). Note that this password is submitted in clear text. If you want to avoid providing the password in clear text on the command line you can omit the value (e.g. '-p ""' or '-p:'). A secure prompt will appear to enter the password in a safe way. |
| -u, --username | Define the username used to legitimate at the PLC for the user access control feature of firmware version 3.1 and above (see documentation of TIA Portal V19). For writing commands like load or store-source, the user must be assigned to a role with the function right FullAccess or ReadAccess. Notice: The legitimation password must always be added if a username is used. |
| -C, --certificate | The name of the file containing the public key for communicating with the PLC. The certificate can be extracted either from the TIA Portal project or directly from the SIMATIC PLC via the certificate management tool. |
Moreover, the options target, username, and certificate can be omitted if you define variables in the apax.yml file:
variables:
myPLC_IPADDRESS: 192.168.0.1 # required
myPLC_USERNAME: myUserName # optional
myPLC_CERT: <certificate_base64_encoded_string> # optional
The alias name (here myPLC) is case-insensitive and must start with a letter.
Note
Use the command add of the plc-control tool to define the variables in the apax.yml file.
The tool can also be utilized to manage a shared connection to a SIMATIC PLC.
If you define two or more entries, you can select the PLC with the --target option:
sld load --target myPLC ...
Note
The password must always be set for each command. It cannot be stored in the apax.yml file or an .ax folder entry.