From b18735eb6848248c900d573c066f1da62a05d9e0 Mon Sep 17 00:00:00 2001 From: IX-BOT <137874481+IX-BOT@users.noreply.github.com> Date: Mon, 13 May 2024 11:26:06 +0200 Subject: [PATCH 1/2] Create draft PR for #396 From 03aa9c5c40f709dadaf84d7e6f324a2a6f71a3e1 Mon Sep 17 00:00:00 2001 From: "MTS\\Tomas_K" Date: Mon, 13 May 2024 15:22:19 +0200 Subject: [PATCH 2/2] componnets rexroth drives using hwc rdy2 review --- .../SystemConstants/plc_line_HwIdentifiers.st | 34 + .../SystemConstants/plc_line_IoAddresses.st | 37 + src/components.rexroth.drives/app/apax.yml | 20 +- ...roth AG-011F-Indradrive_01V01-20110705.xml | 1777 +++++++++++++++++ .../app/hwc/ST3_indradrive.hwl.json | 61 + .../app/hwc/plc_line.hwl.json | 29 + .../app/hwc/plc_template.hwl.json | 161 ++ src/components.rexroth.drives/app/ix/Entry.cs | 32 +- .../app/src/Documentation/Component_1.st | 11 +- .../app/src/IO/PLC_LINE/HwIdentifiers.st | 61 +- .../app/src/Sandbox/SandboxContext.st | 10 +- .../ctrl/assets/ST3_indradrive.hwl.json | 61 + src/components.ur.robotics/app/ix/Entry.cs | 2 +- 13 files changed, 2240 insertions(+), 56 deletions(-) create mode 100644 src/components.rexroth.drives/app/SystemConstants/plc_line_HwIdentifiers.st create mode 100644 src/components.rexroth.drives/app/SystemConstants/plc_line_IoAddresses.st create mode 100644 src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml create mode 100644 src/components.rexroth.drives/app/hwc/ST3_indradrive.hwl.json create mode 100644 src/components.rexroth.drives/app/hwc/plc_line.hwl.json create mode 100644 src/components.rexroth.drives/app/hwc/plc_template.hwl.json create mode 100644 src/components.rexroth.drives/ctrl/assets/ST3_indradrive.hwl.json diff --git a/src/components.rexroth.drives/app/SystemConstants/plc_line_HwIdentifiers.st b/src/components.rexroth.drives/app/SystemConstants/plc_line_HwIdentifiers.st new file mode 100644 index 000000000..f0c417e3b --- /dev/null +++ b/src/components.rexroth.drives/app/SystemConstants/plc_line_HwIdentifiers.st @@ -0,0 +1,34 @@ +CONFIGURATION HardwareIDs + VAR_GLOBAL CONSTANT + PROFINET_IO_System_HwID : UINT := UINT#256; + ST3_indradrive_HwID : UINT := UINT#260; + ST3_indradrive_F_Modul_not_used_ID_FMod_NotUsed_HwID : UINT := UINT#266; + ST3_indradrive_Input_9_Words_ID_InMod_9Words_HwID : UINT := UINT#264; + ST3_indradrive_Output_13_Words_ID_OutMod_13Words_HwID : UINT := UINT#263; + ST3_indradrive_ParamCh_IDN_ID_PaCh_5Words_HwID : UINT := UINT#265; + ST3_indradrive_Rack_HwID : UINT := UINT#261; + ST3_indradrive_ST3_indradrive_HwID : UINT := UINT#262; + ST3_indradrive_ST3_indradrive_DAP_1_HwID : UINT := UINT#267; + ST3_indradrive_ST3_indradrive_profinet_HwID : UINT := UINT#257; + ST3_indradrive_ST3_indradrive_profinet_Port_1___RJ45_HwID : UINT := UINT#258; + ST3_indradrive_ST3_indradrive_profinet_Port_2___RJ45_HwID : UINT := UINT#259; + plc_line_HwID : UINT := UINT#32; + plc_line_Rail_0_HwID : UINT := UINT#268; + plc_line_plc_line_HwID : UINT := UINT#48; + plc_line_plc_line__plc_line_HwID : UINT := UINT#49; + plc_line_plc_line_CPU_display_1_HwID : UINT := UINT#54; + plc_line_plc_line_CPU_exec_unit_1_HwID : UINT := UINT#52; + plc_line_plc_line_Card_reader_writer_1_HwID : UINT := UINT#51; + plc_line_plc_line_DP_interface_1_HwID : UINT := UINT#60; + plc_line_plc_line_LicenseManager_1_HwID : UINT := UINT#42; + plc_line_plc_line_OPC_UA_1_HwID : UINT := UINT#117; + plc_line_plc_line_PROFINET_interface_2_HwID : UINT := UINT#72; + plc_line_plc_line_PROFINET_interface_2_Port_1_HwID : UINT := UINT#73; + plc_line_plc_line_Virtual_communication_interface_HwID : UINT := UINT#135; + plc_line_plc_line_plc_line_HwID : UINT := UINT#50; + plc_line_plc_line_profinet_x1_HwID : UINT := UINT#64; + plc_line_plc_line_profinet_x1_Port1_HwID : UINT := UINT#65; + plc_line_plc_line_profinet_x1_Port2_HwID : UINT := UINT#66; + + END_VAR +END_CONFIGURATION diff --git a/src/components.rexroth.drives/app/SystemConstants/plc_line_IoAddresses.st b/src/components.rexroth.drives/app/SystemConstants/plc_line_IoAddresses.st new file mode 100644 index 000000000..9b34d3eb6 --- /dev/null +++ b/src/components.rexroth.drives/app/SystemConstants/plc_line_IoAddresses.st @@ -0,0 +1,37 @@ +CONFIGURATION IoAddresses + VAR_GLOBAL + ST3_indradrive_Input_9_Words_InputAddress_0 AT %IW0: WORD; + ST3_indradrive_Input_9_Words_InputAddress_1 AT %IW2: WORD; + ST3_indradrive_Input_9_Words_InputAddress_2 AT %IW4: WORD; + ST3_indradrive_Input_9_Words_InputAddress_3 AT %IW6: WORD; + ST3_indradrive_Input_9_Words_InputAddress_4 AT %IW8: WORD; + ST3_indradrive_Input_9_Words_InputAddress_5 AT %IW10: WORD; + ST3_indradrive_Input_9_Words_InputAddress_6 AT %IW12: WORD; + ST3_indradrive_Input_9_Words_InputAddress_7 AT %IW14: WORD; + ST3_indradrive_Input_9_Words_InputAddress_8 AT %IW16: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_0 AT %QW0: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_1 AT %QW2: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_2 AT %QW4: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_3 AT %QW6: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_4 AT %QW8: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_5 AT %QW10: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_6 AT %QW12: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_7 AT %QW14: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_8 AT %QW16: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_9 AT %QW18: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_10 AT %QW20: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_11 AT %QW22: WORD; + ST3_indradrive_Output_13_Words_OutputAddress_12 AT %QW24: WORD; + ST3_indradrive_ParamCh_IDN_InputAddress_0 AT %IW18: WORD; + ST3_indradrive_ParamCh_IDN_InputAddress_1 AT %IW20: WORD; + ST3_indradrive_ParamCh_IDN_InputAddress_2 AT %IW22: WORD; + ST3_indradrive_ParamCh_IDN_InputAddress_3 AT %IW24: WORD; + ST3_indradrive_ParamCh_IDN_InputAddress_4 AT %IW26: WORD; + ST3_indradrive_ParamCh_IDN_OutputAddress_0 AT %QW26: WORD; + ST3_indradrive_ParamCh_IDN_OutputAddress_1 AT %QW28: WORD; + ST3_indradrive_ParamCh_IDN_OutputAddress_2 AT %QW30: WORD; + ST3_indradrive_ParamCh_IDN_OutputAddress_3 AT %QW32: WORD; + ST3_indradrive_ParamCh_IDN_OutputAddress_4 AT %QW34: WORD; + + END_VAR +END_CONFIGURATION diff --git a/src/components.rexroth.drives/app/apax.yml b/src/components.rexroth.drives/app/apax.yml index 0377d78b8..0ba52e48c 100644 --- a/src/components.rexroth.drives/app/apax.yml +++ b/src/components.rexroth.drives/app/apax.yml @@ -14,26 +14,22 @@ devDependencies: dependencies: "@ix-ax/axopen.simatic1500": '0.0.0-dev.0' "@ix-ax/axopen.components.rexroth.drives": '0.0.0-dev.0' - "@ax/system-timer": ^6.0.94 + "@ax/system-timer": ^6.0.94 scripts: # Obsolete scripts, could be removed at some point ====> delta: - START=$(date +%s) - apax build --ignore-scripts - - apax sld load --accept-security-disclaimer -t $AXTARGET -i - $AXTARGETPLATFORMINPUT --mode delta - - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in - :" $(expr $(date +%s) - $START) "s" + - apax sld load --accept-security-disclaimer -t $AXTARGET -i $AXTARGETPLATFORMINPUT --mode delta + - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s" download: - START=$(date +%s) - apax build --ignore-scripts - dotnet ixc - apax download_only - - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in - :" $(expr $(date +%s) - $START) "s" + - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s" download_only: - - apax sld load --accept-security-disclaimer -t $AXTARGET -i - $AXTARGETPLATFORMINPUT -r + - apax sld load --accept-security-disclaimer -t $AXTARGET -i $AXTARGETPLATFORMINPUT -r check+download: | if [ $AXTARGET ]; then if [ $AXTARGETPLATFORMINPUT ]; then @@ -50,8 +46,7 @@ scripts: echo "Environment variable AXTARGET not defined!!!" fi watch: - - dotnet watch --project - ..\\app\\ix-blazor\\AXOpen.Components.Rexroth.Drives.blazorapp.csproj + - dotnet watch --project ..\\app\\ix-blazor\\AXOpen.Components.Rexroth.Drives.blazorapp.csproj fr: - ..\\..\\integrations\\scripts\\StartPlcSimAdvCli.exe - apax rr @@ -63,8 +58,7 @@ scripts: - apax clean - apax install - apax download - - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in - :" $(expr $(date +%s) - $START) "s" + - echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s" rrw: - apax rr - apax watch diff --git a/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml b/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml new file mode 100644 index 000000000..5d503b230 --- /dev/null +++ b/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml @@ -0,0 +1,1777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROFINET Device Profile + 1.00 + Device Profile for PROFINET Devices + PROFIBUS Nutzerorganisation e. V. (PNO) + Device + + 4 + 1 + GSDML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components.rexroth.drives/app/hwc/ST3_indradrive.hwl.json b/src/components.rexroth.drives/app/hwc/ST3_indradrive.hwl.json new file mode 100644 index 000000000..75aae8f50 --- /dev/null +++ b/src/components.rexroth.drives/app/hwc/ST3_indradrive.hwl.json @@ -0,0 +1,61 @@ +{ + "Devices": [ + { + "Name": "ST3_indradrive", + "Modules":[ + { + "Name": "ST3_indradrive", + "TypeIdentifier": { + "GsdId": "DAP_IndraDrive", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Interfaces": [ + { + "Name": "profinet", + "Label": "X1", + "Addresses": { + "Configured": [ + { "IPv4": "10.10.10.40/24" }, + { "ProfinetDeviceName": "ST3_indradrive" } + ] + } + } + ] + }, + { + "Name": "ParamCh_IDN", + "TypeIdentifier": { + "GsdId": "ID_PaCh_5Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 1 + }, + { + "Name": "F-Modul_not_used", + "TypeIdentifier": { + "GsdId": "ID_FMod_NotUsed", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 2 + }, + { + "Name": "Input_9_Words", + "TypeIdentifier": { + "GsdId": "ID_InMod_9Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 3 + }, + { + "Name": "Output_13_Words", + "TypeIdentifier": { + "GsdId": "ID_OutMod_13Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 4 + } + + ] + } + ] +} diff --git a/src/components.rexroth.drives/app/hwc/plc_line.hwl.json b/src/components.rexroth.drives/app/hwc/plc_line.hwl.json new file mode 100644 index 000000000..e58242acd --- /dev/null +++ b/src/components.rexroth.drives/app/hwc/plc_line.hwl.json @@ -0,0 +1,29 @@ +{ + "Devices": [ + { + "Name": "plc_line", + "Modules": [ + { + "Apply": { + "TemplateName": "PLC_1516_v3_1", + "Arguments": { + "PLCName": "plc_line", + "IpAddress": "10.10.10.120/24" + } + } + } + ] + } + ], + "IoSystems": [ + { + "Name": "profinet_plc_line", + "ControllerInterfaces": [ + { "Ref": "plc_line/plc_line/profinet_x1" } + ], + "DeviceInterfaces": [ + { "Ref": "ST3_indradrive/ST3_indradrive/profinet"} + ] + } + ] +} diff --git a/src/components.rexroth.drives/app/hwc/plc_template.hwl.json b/src/components.rexroth.drives/app/hwc/plc_template.hwl.json new file mode 100644 index 000000000..b38f4e4bb --- /dev/null +++ b/src/components.rexroth.drives/app/hwc/plc_template.hwl.json @@ -0,0 +1,161 @@ +{ + "Templates":{ + "Modules":[ + { + "Name": "PLC_1516_v3_0", + + "Placeholders":[ + { + "Name": "PLCName", + "Value": "plc_line" + }, + { "Name": "IpAddress" } + ], + "Content":{ + "Name": "${PLCName}", + "TypeIdentifier": { + "OrderNumber": "6ES7 516-3AP03-0AB0", + "Version": "V3.0" + }, + "AccessProtection": { + "AccessLevel": "FullAccess" + }, + "Services": [ + { + "Type": "WebServer", + "Enabled": true, + "Parameters": { + "HttpsOnly": true + } + } + ], + "UserManagement": { + "Roles": [ + { + "Name": "WebServerAccessRole", + "FunctionRights": [ + "ReadPlcVariables", + "WritePlcVariables", + "ReadFiles", + "QueryDiagnostics", + "FlashLed" + ] + } + ], + "Users": [ + { + "Name": "usr", + "AssignedRoles": [ + "WebServerAccessRole" + ] + } + ] + }, + "Ports": [ + { + "Name": "Port1", + "Label": "X1 P1" + }, + { + "Name": "Port2", + "Label": "X1 P2" + } + ], + "Interfaces": [ + { + "Name": "profinet_x1", + "Label": "X1", + "Addresses": { + "Configured": [ + { "IPv4": "${IpAddress}" }, + { "ProfinetDeviceName": "plc_line.profinet" } + ] + } + } + ] + } + }, + { + "Name": "PLC_1516_v3_1", + + "Placeholders":[ + { + "Name": "PLCName", + "Value": "plc_line" + }, + { "Name": "IpAddress" } + ], + "Content":{ + "Name": "${PLCName}", + "TypeIdentifier": { + "OrderNumber": "6ES7 516-3AP03-0AB0", + "Version": "V3.1" + }, + "AccessProtection": { + "AccessLevel": "FullAccess" + }, + "Services": [ + { + "Type": "WebServer", + "Enabled": true, + "Parameters": { + "HttpsOnly": true + } + } + ], + "UserManagement": { + "Roles": [ + { + "Name": "WebServerAccessRole", + "FunctionRights": [ + "ReadPlcVariables", + "WritePlcVariables", + "ReadFiles", + "QueryDiagnostics", + "FlashLed" + ] + }, + { + "Name": "FullAccessRole", + "FunctionRights": [ + "AccessProtectionFullAccess" + ] + } + ], + "Users": [ + { + "Name": "adm", + "AssignedRoles": [ + "FullAccessRole", + "WebServerAccessRole" + ] + } + ] + }, + "Ports": [ + { + "Name": "Port1", + "Label": "X1 P1" + }, + { + "Name": "Port2", + "Label": "X1 P2" + } + ], + "Interfaces": [ + { + "Name": "profinet_x1", + "Label": "X1", + "Addresses": { + "Configured": [ + { "IPv4": "${IpAddress}" }, + { "ProfinetDeviceName": "plc_line.profinet" } + ] + } + } + ] + } + } + ] + } +} diff --git a/src/components.rexroth.drives/app/ix/Entry.cs b/src/components.rexroth.drives/app/ix/Entry.cs index f19719787..e410c4702 100644 --- a/src/components.rexroth.drives/app/ix/Entry.cs +++ b/src/components.rexroth.drives/app/ix/Entry.cs @@ -5,18 +5,42 @@ using System.Text; using System.Threading.Tasks; using AXSharp.Connector.S71500.WebApi; +using Siemens.Simatic.S7.Webserver.API.Services; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; namespace AXOpen.Components.Rexroth.Drives { public static class Entry { + static Entry() + { + if (IgnoreSslErrors) + { + ServerCertificateCallback.CertificateCallback = + (sender, cert, chain, sslPolicyErrors) => true; + } + + Plc = new(ConnectorAdapterBuilder.Build() + .CreateWebApi(TargetIp, UserName, Pass, CertificateValidation)); + } + + // Load your custom certificate (example from a file) + static X509Certificate2 customCertificate = new X509Certificate2("D:\\github\\ix-ax\\axopen\\src\\components.rexroth.drives\\app\\certs\\plc_line\\plc_line.cer"); + + // Implement the delegate + private static bool CertificateValidation(HttpRequestMessage requestMessage, X509Certificate2 certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) + { + return certificate.Thumbprint == customCertificate.Thumbprint; + } + private static readonly string TargetIp = Environment.GetEnvironmentVariable("AXTARGET"); // <- replace by your IP - private const string UserName = "Everybody"; //<- replace by user name you have set up in your WebAPI settings - private const string Pass = ""; // <- Pass in the password that you have set up for the user. NOT AS PLAIN TEXT! Use user secrets instead. + private static string UserName = Environment.GetEnvironmentVariable("AX_USERNAME"); //<- replace by user name you have set up in your WebAPI settings + private static string Pass = Environment.GetEnvironmentVariable("MY_VERY_STRONG_PASSWORD"); // <- Pass in the password that you have set up for the user. NOT AS PLAIN TEXT! Use user secrets instead. private const bool IgnoreSslErrors = true; // <- When you have your certificates in order set this to false. public static app_axopen_components_rexroth_drivesTwinController Plc { get; } - = new(ConnectorAdapterBuilder.Build() - .CreateWebApi(TargetIp, UserName, Pass, IgnoreSslErrors)); + //= new(ConnectorAdapterBuilder.Build() + // .CreateWebApi(TargetIp, UserName, Pass, IgnoreSslErrors)); } } \ No newline at end of file diff --git a/src/components.rexroth.drives/app/src/Documentation/Component_1.st b/src/components.rexroth.drives/app/src/Documentation/Component_1.st index 7a7f46523..1c9db7661 100644 --- a/src/components.rexroth.drives/app/src/Documentation/Component_1.st +++ b/src/components.rexroth.drives/app/src/Documentation/Component_1.st @@ -21,8 +21,7 @@ CLASS Component_1 EXTENDS AXOpen.Core.AxoObject VAR_INPUT parent : IAxoContext; END_VAR - - RETURN; + THIS.Initialize(parent); IF(manualControl) THEN @@ -30,10 +29,10 @@ CLASS Component_1 EXTENDS AXOpen.Core.AxoObject END_IF; // IndraDrive.Run(parent := THIS, - hwID := HwIdentifiers#ST3_indradrive, - hwIdParamCh_IDN := HwIdentifiers#ST3_indradrive_ParamCh_IDN_1, - hwIdInput_9_Words := HwIdentifiers#ST3_indradrive_Input_9_Words_1, - hwIdOutput_13_Words := HwIdentifiers#ST3_indradrive_Output_13_Words_1, + hwID := HwIdentifiers#ST3_indradrive_HwID, + hwIdParamCh_IDN := HwIdentifiers#ST3_indradrive_ParamCh_IDN_ID_PaCh_5Words_HwID, + hwIdInput_9_Words := HwIdentifiers#ST3_indradrive_Input_9_Words_ID_InMod_9Words_HwID, + hwIdOutput_13_Words := HwIdentifiers#ST3_indradrive_Output_13_Words_ID_OutMod_13Words_HwID, Enable := Enable, EnablePositive := EnablePositive, EnableNegative := EnableNegative); diff --git a/src/components.rexroth.drives/app/src/IO/PLC_LINE/HwIdentifiers.st b/src/components.rexroth.drives/app/src/IO/PLC_LINE/HwIdentifiers.st index bea6517c9..5dd98bd5d 100644 --- a/src/components.rexroth.drives/app/src/IO/PLC_LINE/HwIdentifiers.st +++ b/src/components.rexroth.drives/app/src/IO/PLC_LINE/HwIdentifiers.st @@ -1,29 +1,36 @@ TYPE - HwIdentifiers : WORD - ( - PLC_LINE_Rail_0 := WORD#256, - PLC_LINE := WORD#48, - PLC_LINE_Card_reader_writer_1 := WORD#51, - PLC_LINE_CPU_display_1 := WORD#54, - PLC_LINE_OPC_UA_1 := WORD#117, - PLC_LINE_PROFINET_interface_1 := WORD#64, - PLC_LINE_PROFINET_interface_1_Port_1 := WORD#65, - PLC_LINE_PROFINET_interface_1_Port_2 := WORD#66, - PLC_LINE_PROFINET_interface_2 := WORD#72, - PLC_LINE_PROFINET_interface_2_Port_1 := WORD#73, - PLC_LINE_DP_interface_1 := WORD#60, - PLC_LINE_PROFINET_interface_GBIT_3 := WORD#120, - PLC_LINE_PROFINET_interface_GBIT_3_Port_1 := WORD#121, - ST3_indradrive_Rack := WORD#336, - ST3_indradrive := WORD#337, - ST3_indradrive_PN_IO := WORD#338, - ST3_indradrive_PN_IO_Port_1_RJ45 := WORD#339, - ST3_indradrive_PN_IO_Port_2_RJ45 := WORD#340, - ST3_indradrive_DAP_1 := WORD#341, - ST3_indradrive_F_Modul_not_used_1 := WORD#342, - ST3_indradrive_ParamCh_IDN_1 := WORD#258, - ST3_indradrive_Input_9_Words_1 := WORD#262, - ST3_indradrive_Output_13_Words_1 := WORD#259, - NONE:= WORD#0 - ); + HwIdentifiers : WORD + ( + PROFINET_IO_System_HwID := WORD#256, + ST3_indradrive_HwID := WORD#260, + ST3_indradrive_F_Modul_not_used_ID_FMod_NotUsed_HwID := WORD#266, + ST3_indradrive_Input_9_Words_ID_InMod_9Words_HwID := WORD#264, + ST3_indradrive_Output_13_Words_ID_OutMod_13Words_HwID := WORD#263, + ST3_indradrive_ParamCh_IDN_ID_PaCh_5Words_HwID := WORD#265, + ST3_indradrive_Rack_HwID := WORD#261, + ST3_indradrive_ST3_indradrive_HwID := WORD#262, + ST3_indradrive_ST3_indradrive_DAP_1_HwID := WORD#267, + ST3_indradrive_ST3_indradrive_profinet_HwID := WORD#257, + ST3_indradrive_ST3_indradrive_profinet_Port_1___RJ45_HwID := WORD#258, + ST3_indradrive_ST3_indradrive_profinet_Port_2___RJ45_HwID := WORD#259, + plc_line_HwID := WORD#32, + plc_line_Rail_0_HwID := WORD#268, + plc_line_plc_line_HwID := WORD#48, + plc_line_plc_line__plc_line_HwID := WORD#49, + plc_line_plc_line_CPU_display_1_HwID := WORD#54, + plc_line_plc_line_CPU_exec_unit_1_HwID := WORD#52, + plc_line_plc_line_Card_reader_writer_1_HwID := WORD#51, + plc_line_plc_line_DP_interface_1_HwID := WORD#60, + plc_line_plc_line_LicenseManager_1_HwID := WORD#42, + plc_line_plc_line_OPC_UA_1_HwID := WORD#117, + plc_line_plc_line_PROFINET_interface_2_HwID := WORD#72, + plc_line_plc_line_PROFINET_interface_2_Port_1_HwID := WORD#73, + plc_line_plc_line_Virtual_communication_interface_HwID := WORD#135, + plc_line_plc_line_plc_line_HwID := WORD#50, + plc_line_plc_line_profinet_x1_HwID := WORD#64, + plc_line_plc_line_profinet_x1_Port1_HwID := WORD#65, + plc_line_plc_line_profinet_x1_Port2_HwID := WORD#66, + + NONE := WORD#0 + ); END_TYPE diff --git a/src/components.rexroth.drives/app/src/Sandbox/SandboxContext.st b/src/components.rexroth.drives/app/src/Sandbox/SandboxContext.st index debccc308..4c43e2280 100644 --- a/src/components.rexroth.drives/app/src/Sandbox/SandboxContext.st +++ b/src/components.rexroth.drives/app/src/Sandbox/SandboxContext.st @@ -36,17 +36,17 @@ CLASS SandboxContext EXTENDS AXOpen.Core.AxoContext END_VAR METHOD PROTECTED OVERRIDE Main - // RETURN; + RETURN; IF(_manualControl) THEN IndraDrive.ActivateManualControl(); END_IF; IndraDrive.Run(parent := THIS, - hwID := HwIdentifiers#ST3_indradrive, - hwIdParamCh_IDN := HwIdentifiers#ST3_indradrive_ParamCh_IDN_1, - hwIdInput_9_Words := HwIdentifiers#ST3_indradrive_Input_9_Words_1, - hwIdOutput_13_Words := HwIdentifiers#ST3_indradrive_Output_13_Words_1, + hwID := HwIdentifiers#ST3_indradrive_HwID, + hwIdParamCh_IDN := HwIdentifiers#ST3_indradrive_ParamCh_IDN_ID_PaCh_5Words_HwID, + hwIdInput_9_Words := HwIdentifiers#ST3_indradrive_Input_9_Words_ID_InMod_9Words_HwID, + hwIdOutput_13_Words := HwIdentifiers#ST3_indradrive_Output_13_Words_ID_OutMod_13Words_HwID, Enable := Enable, EnablePositive := EnablePositive, EnableNegative := EnableNegative); diff --git a/src/components.rexroth.drives/ctrl/assets/ST3_indradrive.hwl.json b/src/components.rexroth.drives/ctrl/assets/ST3_indradrive.hwl.json new file mode 100644 index 000000000..75aae8f50 --- /dev/null +++ b/src/components.rexroth.drives/ctrl/assets/ST3_indradrive.hwl.json @@ -0,0 +1,61 @@ +{ + "Devices": [ + { + "Name": "ST3_indradrive", + "Modules":[ + { + "Name": "ST3_indradrive", + "TypeIdentifier": { + "GsdId": "DAP_IndraDrive", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Interfaces": [ + { + "Name": "profinet", + "Label": "X1", + "Addresses": { + "Configured": [ + { "IPv4": "10.10.10.40/24" }, + { "ProfinetDeviceName": "ST3_indradrive" } + ] + } + } + ] + }, + { + "Name": "ParamCh_IDN", + "TypeIdentifier": { + "GsdId": "ID_PaCh_5Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 1 + }, + { + "Name": "F-Modul_not_used", + "TypeIdentifier": { + "GsdId": "ID_FMod_NotUsed", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 2 + }, + { + "Name": "Input_9_Words", + "TypeIdentifier": { + "GsdId": "ID_InMod_9Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 3 + }, + { + "Name": "Output_13_Words", + "TypeIdentifier": { + "GsdId": "ID_OutMod_13Words", + "FileName": "GSDML-V2.1-BOSCH REXROTH AG-011F-INDRADRIVE_01V01-20110705.XML" + }, + "Slot" : 4 + } + + ] + } + ] +} diff --git a/src/components.ur.robotics/app/ix/Entry.cs b/src/components.ur.robotics/app/ix/Entry.cs index bf1fe1a9b..065b293ab 100644 --- a/src/components.ur.robotics/app/ix/Entry.cs +++ b/src/components.ur.robotics/app/ix/Entry.cs @@ -26,7 +26,7 @@ static Entry() } // Load your custom certificate (example from a file) - static X509Certificate2 customCertificate = new X509Certificate2("D:\\github\\ix-ax\\axopen\\src\\components.mitsubishi.robotics\\app\\certs\\plc_line\\plc_line.cer"); + static X509Certificate2 customCertificate = new X509Certificate2("D:\\github\\ix-ax\\axopen\\src\\components.ur.robotics\\app\\certs\\plc_line\\plc_line.cer"); // Implement the delegate private static bool CertificateValidation(HttpRequestMessage requestMessage, X509Certificate2 certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)