-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapax.yml
More file actions
109 lines (88 loc) · 4.99 KB
/
apax.yml
File metadata and controls
109 lines (88 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: "axopen.data-app"
version: '0.0.0-dev.0'
type: app
targets:
- "1500"
variables:
APAX_BUILD_ARGS:
- "--debug" # Generate debug information for target "1500"
PLC_NAME: "plc_line"
DEFAULT_NAMESPACE: "AXOpen.Data"
AXTARGET: 10.10.10.120
AXTARGETPLATFORMINPUT: .\bin\1500\
AX_USERNAME: "adm"
AX_TARGET_PWD: "123ABCDabcd$#!"
USE_PLC_SIM_ADVANCED: "true"
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.data": '0.0.0-dev.0'
"@ix-ax/ax.axopen.app": '0.0.0-dev.0'
"@ix-ax/axopen.simatic1500": '0.0.0-dev.0'
# this is just temporary to test new features
# upto the moment of releasing new catalog
# installStrategy: strict
"@ix-ax/ax.latest.packages": '0.0.0-dev.0'
installStrategy: overridable
apaxVersion: 3.4.2
scripts:
# For proper execution of these scripts, the following variables need to be defined as environment variables or local variables.
# Local variables can override environment variables.
# It is highly recommended NOT to store secrets such as 'AX_USERNAME' and 'AX_TARGET_PWD' in local variables.
# PLC_NAME: Name of the PLC (also equal to the PLC Profinet name)
# DEFAULT_NAMESPACE: Namespace used for HwId and IO addresses
# AX_USERNAME: Name of the PLC user used for WebAPI and HMI
# AXTARGET: IP address of the PLC
# AXTARGETPLATFORMINPUT: Folder of the compiled software to be downloaded to the PLC. Use the value ".\bin\1500\" for the S7-1500 controller, even if running inside PLCSIM
# AXTARGETPLCSIMINSTANCE: Name of the PLCSIM instance to start. The instance must already exist.
# AX_TARGET_PWD: Password for 'AX_USERNAME'
# USE_PLC_SIM_ADVANCED with value of "true" will automatically trigger PlcSimAdvanced when calling apax alf or apax all
# PNIO_MAC: MAC address of the network adapter connected to the Profinet network
plcsim: ..\\..\\scripts\\plcsimadvanced.sh $APAX_YML_NAME $PLC_NAME $AXTARGET
r: | #restart PLC
..\\..\\scripts\\restart_PLC.sh $AXTARGET $PLC_NAME
ixc: | # run ix builder
dotnet tool restore
dotnet ixc
postbuild: apax run ixc # run after build
dcpli: | # list all interfaces, used to discover MAC address of the adapter connected to PLC
..\\..\\scripts\\dcp_utility_list_interfaces.sh
dcpd: | # discover all accesible devices connected to adapter with MAC address equal to entered MAC, used to discover MAC-addresses of the slaves
..\\..\\scripts\\dcp_utility_discover.sh $PNIO_MAC
hdl: | #List configured harware and its state
..\\..\\scripts\\hw_diag_list.sh $AXTARGET $PLC_NAME
ci: | #clean and install dependencies
apax clean
apax install
reset_plc: | #total reset of the PLC including IP and name
..\\..\\scripts\\reset_plc.sh $AXTARGET
clean_plc: | #total reset of the PLC excluding IP and name
..\\..\\scripts\\clean_plc.sh $AXTARGET
ssc: | # setup secure communication, create and import certificates, setup password for AX_USERNAME
..\\..\\scripts\\setup_secure_communication.sh $PLC_NAME $AX_USERNAME $AX_TARGET_PWD
gsd: | # copy and install all gsdml files from library
..\\..\\scripts\\copy_and_install_gsd.sh
hwl: | # copy all templates from library
..\\..\\scripts\\copy_hwl_templates.sh
hwcc: | # compile hardware configuration
..\\..\\scripts\\hw_compile.sh
hwid: | # copy the generated HwIds from global constants into the type definition, matching the format as the TIA2AX tool creates
..\\..\\scripts\\copy_hardware_ids.sh $DEFAULT_NAMESPACE $PLC_NAME
hwadr: | # copy the generated IoAddresses
..\\..\\scripts\\copy_io_addresses.sh $DEFAULT_NAMESPACE $PLC_NAME
hwfd: | # copy and install gsd, copy templates,compile, copy the HwIds, copy the IoAddresses, first download HW using password and upload certificate
..\\..\\scripts\\hw_first_download.sh $DEFAULT_NAMESPACE $PLC_NAME $AXTARGET $AX_TARGET_PWD
hwu: | # copy and install gsd, copy templates, compile, copy the HwIds, copy the IoAddresses, download HW using certificate
..\\..\\scripts\\hw_update.sh $DEFAULT_NAMESPACE $PLC_NAME $AXTARGET
swfd: | # software build and full download
..\\..\\scripts\\sw_build_and_download_full.sh $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT
swdd: | # software build and delta download
..\\..\\scripts\\sw_build_and_download_delta.sh $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT
alf: | #clear plc except ip and name and provide all actions for install all, build and initial download hw so as sw
START=$(date +%s)
..\\..\\scripts\\all_first.sh $DEFAULT_NAMESPACE $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT $AX_USERNAME $AX_TARGET_PWD $USE_PLC_SIM_ADVANCED
echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s"
all: | #build and download hardware and software
START=$(date +%s)
..\\..\\scripts\\all.sh $DEFAULT_NAMESPACE $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT $AX_USERNAME $AX_TARGET_PWD $USE_PLC_SIM_ADVANCED
echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s"