Added Modbus registers

This commit is contained in:
Matthias Heisig
2025-04-08 07:24:55 +02:00
parent e975d23694
commit 4a00a4c414
5 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.11">
<DUT Name="ST_MODBUS_REG_13" Id="{ff1eee07-3bd7-4808-a42a-073911e581d6}">
<Declaration><![CDATA[TYPE ST_MODBUS_REG_13 :
STRUCT
// String warning active flags
// Addr: 13.000
wBMSWarningActive : WORD;
// String error active
// Addr: 13.001
wBMSErrorActive : WORD;
// String warning active flags
// (Bit 0 -> String 1, Bit 1 -> String 2, etc.)
// Addr: 13.002
wStringWarningActive : WORD;
// String error active
// (Bit 0 -> String 1, Bit 1 -> String 2, etc.)
// Addr: 13.003
wStringErrorActive : WORD;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8"> <TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.11">
<GVL Name="GVL_CONFIG" Id="{0773bf51-0237-454d-a970-cfd896054edb}"> <GVL Name="GVL_CONFIG" Id="{0773bf51-0237-454d-a970-cfd896054edb}">
<Declaration><![CDATA[{attribute 'qualified_only'} <Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT VAR_GLOBAL CONSTANT
@@ -7,6 +7,7 @@ VAR_GLOBAL CONSTANT
// Number of active strings // Number of active strings
// =========================== // ===========================
uiNumberOfStrings : UINT := 2; uiNumberOfStrings : UINT := 2;
uiNumberOfUnits : UINT := uiNumberOfStrings * 12;
END_VAR END_VAR
VAR_GLOBAL PERSISTENT VAR_GLOBAL PERSISTENT
// =========================== // ===========================

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8"> <TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.11">
<GVL Name="GVL_MODBUS" Id="{913a9222-1338-4c08-b758-91c1bd26dcd9}"> <GVL Name="GVL_MODBUS" Id="{913a9222-1338-4c08-b758-91c1bd26dcd9}">
<Declaration><![CDATA[{attribute 'qualified_only'} <Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL VAR_GLOBAL
@@ -16,6 +16,15 @@ VAR_GLOBAL
eChargeStatus := E_CHARGE_STATUS.UNDEFINED, eChargeStatus := E_CHARGE_STATUS.UNDEFINED,
eBatteryStatus := E_BATTERY_STATUS.OFF) eBatteryStatus := E_BATTERY_STATUS.OFF)
); );
// Addr: 13.000
stBMSErrorReg : ST_MODBUS_REG_13;
// Addr: 14.000 -> 14.023
awWarningsUnitsActive : ARRAY [0..(GVL_CONFIG.uiNumberOfUnits-1)] OF WORD;
// Addr: 15.000 -> 15.023
awErrorsUnitsActive : ARRAY [0..(GVL_CONFIG.uiNumberOfUnits-1)] OF WORD;
END_VAR]]></Declaration> END_VAR]]></Declaration>
</GVL> </GVL>
</TcPlcObject> </TcPlcObject>

View File

@@ -9,7 +9,7 @@
<WriteProductVersion>true</WriteProductVersion> <WriteProductVersion>true</WriteProductVersion>
<GenerateTpy>false</GenerateTpy> <GenerateTpy>false</GenerateTpy>
<Name>PLC</Name> <Name>PLC</Name>
<ProgramVersion>3.1.4026.12</ProgramVersion> <ProgramVersion>3.1.4026.14</ProgramVersion>
<Application>{afd0b275-de2f-4006-ab0f-6826ccfce7be}</Application> <Application>{afd0b275-de2f-4006-ab0f-6826ccfce7be}</Application>
<TypeSystem>{18a2eab9-0077-4cea-9d3b-9a168bdf0814}</TypeSystem> <TypeSystem>{18a2eab9-0077-4cea-9d3b-9a168bdf0814}</TypeSystem>
<Implicit_Task_Info>{6e35f35d-280b-4da2-9c5b-fc35ab6da425}</Implicit_Task_Info> <Implicit_Task_Info>{6e35f35d-280b-4da2-9c5b-fc35ab6da425}</Implicit_Task_Info>
@@ -66,6 +66,9 @@
<Compile Include="DUTs\Modbus\HoldingRegisters\ST_MODBUS_REG_12.TcDUT"> <Compile Include="DUTs\Modbus\HoldingRegisters\ST_MODBUS_REG_12.TcDUT">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="DUTs\Modbus\HoldingRegisters\ST_MODBUS_REG_13.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="DUTs\Modbus\ST_EMS_MODBUS_INTERFACE.TcDUT"> <Compile Include="DUTs\Modbus\ST_EMS_MODBUS_INTERFACE.TcDUT">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>

View File

@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# TcXaeShell Solution File, Format Version 11.00 # TcXaeShell Solution File, Format Version 11.00
VisualStudioVersion = 15.0.33403.129 VisualStudioVersion = 17.7.34302.85
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "Uniper", "Uniper.tsproj", "{24BCEDE3-526F-4D87-A687-3DBA9D107213}" Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "Uniper", "Uniper.tsproj", "{24BCEDE3-526F-4D87-A687-3DBA9D107213}"
EndProject EndProject