Skip to content

Commit

Permalink
Merge pull request #114 from RapidScada/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master
  • Loading branch information
2mik authored Nov 15, 2021
2 parents a3e0571 + 2e793ed commit f5a9f96
Show file tree
Hide file tree
Showing 100 changed files with 8,731 additions and 4,812 deletions.
2 changes: 1 addition & 1 deletion HowToBuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Microsoft Visual Studio 2017 is needed. Visual Studio Community is OK.
OpenPlugins,
ScadaScheme,
ScadaTable,
ScadaAdmin.
ScadaAdmin5.

Switch to the Release configuration so that the references are correct.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,5 @@ public override ElemType GetDefElemType(TableType tableType)
return tableType == TableType.DiscreteInputs || tableType == TableType.Coils ?
ElemType.Bool : ElemType.Float;
}

/// <summary>
/// Gets the default number of command elements depending on the element type.
/// </summary>
public override int GetDefElemCnt(ElemType elemType)
{
return 1;
}
}
}
2 changes: 1 addition & 1 deletion ScadaComm/OpenKPs/KpHttpNotif/KpHttpNotif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\..\scada\ScadaComm\OpenKPs\AddressBook\Lang\AddressBook.en-GB.xml">
<Content Include="..\AddressBook\Lang\AddressBook.en-GB.xml">
<Link>Lang\AddressBook.en-GB.xml</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
20 changes: 11 additions & 9 deletions ScadaComm/OpenKPs/KpModbus/KpModbusLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,17 @@ public override void OnAddedToCommLine()
// определение режима передачи данных
transMode = CustomParams.GetEnumParam("TransMode", false, TransMode.RTU);

// определение возможности отправки команд
CanSendCmd = deviceTemplate != null && deviceTemplate.Cmds.Count > 0;
}

/// <summary>
/// Выполнить действия при запуске линии связи
/// </summary>
public override void OnCommLineStart()
{
// инициализация запрашиваемых элементов и команд
// располагается в OnCommLineStart, т.к. здесь Address окончательно определён
if (deviceTemplate == null)
{
elemGroups = null;
Expand All @@ -428,15 +439,6 @@ public override void OnAddedToCommLine()
}
}

// определение возможности отправки команд
CanSendCmd = deviceTemplate != null && deviceTemplate.Cmds.Count > 0;
}

/// <summary>
/// Выполнить действия при запуске линии связи
/// </summary>
public override void OnCommLineStart()
{
// инициализация объекта для опроса КП
InitModbusPoll();

Expand Down
2 changes: 1 addition & 1 deletion ScadaComm/OpenKPs/KpModbus/KpModbusView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class KpModbusView : KPView
/// <summary>
/// The driver version.
/// </summary>
internal const string KpVersion = "5.1.3.0";
internal const string KpVersion = "5.1.3.1";

/// <summary>
/// The UI customization object.
Expand Down
32 changes: 17 additions & 15 deletions ScadaComm/OpenKPs/KpModbus/Modbus/Protocol/ModbusCmd.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Mikhail Shiryaev
* Copyright 2021 Mikhail Shiryaev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
*
* Author : Mikhail Shiryaev
* Created : 2012
* Modified : 2018
* Modified : 2021
*/

using System;
Expand Down Expand Up @@ -144,16 +144,26 @@ public override void InitReqPDU()
if (Multiple)
{
// формирование PDU для команды WriteMultipleCoils или WriteMultipleRegisters
int dataLength = TableType == TableType.Coils ?
((ElemCnt % 8 == 0) ? ElemCnt / 8 : ElemCnt / 8 + 1) :
ElemCnt * ModbusUtils.GetDataLength(ElemType);
int quantity; // quantity of registers
int dataLength; // data length in bytes

if (TableType == TableType.Coils)
{
quantity = ElemCnt;
dataLength = (ElemCnt % 8 == 0) ? ElemCnt / 8 : ElemCnt / 8 + 1;
}
else
{
quantity = ElemCnt * ModbusUtils.GetQuantity(ElemType);
dataLength = quantity * 2;
}

ReqPDU = new byte[6 + dataLength];
ReqPDU[0] = FuncCode;
ReqPDU[1] = (byte)(Address / 256);
ReqPDU[2] = (byte)(Address % 256);
ReqPDU[3] = (byte)(ElemCnt / 256);
ReqPDU[4] = (byte)(ElemCnt % 256);
ReqPDU[3] = (byte)(quantity / 256);
ReqPDU[4] = (byte)(quantity % 256);
ReqPDU[5] = (byte)dataLength;

ModbusUtils.ApplyByteOrder(Data, 0, ReqPDU, 6, dataLength, ByteOrder, false);
Expand Down Expand Up @@ -218,14 +228,6 @@ public override bool DecodeRespPDU(byte[] buffer, int offset, int length, out st
}
}

/// <summary>
/// Gets the default number of command elements depending on the element type.
/// </summary>
public virtual int GetDefElemCnt(ElemType elemType)
{
return ModbusUtils.GetQuantity(elemType);
}

/// <summary>
/// Loads the command from the XML node.
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions ScadaComm/OpenKPs/KpModbus/Modbus/UI/CtrlCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ private void cbCmdElemType_SelectedIndexChanged(object sender, EventArgs e)
else
{
modbusCmd.ElemType = newElemType;
numCmdElemCnt.SetValue(modbusCmd.GetDefElemCnt(newElemType));
OnObjectChanged(TreeUpdateTypes.None);
OnObjectChanged(TreeUpdateTypes.CurrentNode);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions ScadaComm/OpenKPs/KpModbus/Modbus/UI/FrmDevTemplate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Mikhail Shiryaev
* Copyright 2021 Mikhail Shiryaev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
*
* Author : Mikhail Shiryaev
* Created : 2012
* Modified : 2020
* Modified : 2021
*/

using Scada.Comm.Devices.Modbus.Protocol;
Expand Down Expand Up @@ -231,7 +231,8 @@ private string GetCmdCaption(ModbusCmd modbusCmd)
{
return (string.IsNullOrEmpty(modbusCmd.Name) ? KpPhrases.DefCmdName : modbusCmd.Name) +
" (" + ModbusUtils.GetTableTypeName(modbusCmd.TableType) + ", " +
ModbusUtils.GetAddressRange(modbusCmd.Address, modbusCmd.ElemCnt,
ModbusUtils.GetAddressRange(modbusCmd.Address,
modbusCmd.ElemCnt * ModbusUtils.GetQuantity(modbusCmd.ElemType),
template.Sett.ZeroAddr, template.Sett.DecAddr) + ")";
}

Expand Down
2 changes: 1 addition & 1 deletion ScadaComm/OpenKPs/KpOpcUa/KpOpcUaView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class KpOpcUaView : KPView
/// <summary>
/// The driver version.
/// </summary>
internal const string KpVersion = "5.0.0.1";
internal const string KpVersion = "5.0.0.2";


/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions ScadaComm/OpenKPs/KpOpcUa/OpcUa/Config/ConnectionOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Mikhail Shiryaev
* Copyright 2021 Mikhail Shiryaev
* All rights reserved
*
* Product : Rapid SCADA
Expand All @@ -8,7 +8,7 @@
*
* Author : Mikhail Shiryaev
* Created : 2019
* Modified : 2019
* Modified : 2021
*/

using Opc.Ua;
Expand Down Expand Up @@ -80,7 +80,7 @@ public void LoadFromXml(XmlNode xmlNode)
SecurityMode = xmlNode.GetChildAsEnum("SecurityMode", MessageSecurityMode.None);
SecurityPolicy = xmlNode.GetChildAsEnum<SecurityPolicy>("SecurityPolicy");
AuthenticationMode = xmlNode.GetChildAsEnum<AuthenticationMode>("AuthenticationMode");
Username = xmlNode.GetChildAsString("User");
Username = xmlNode.GetChildAsString("Username");
Password = ScadaUtils.Decrypt(xmlNode.GetChildAsString("Password"));
}

Expand Down
2 changes: 1 addition & 1 deletion ScadaComm/OpenKPs/KpOpcUa/OpcUa/UI/FrmSecurityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Scada.Comm.Devices.OpcUa.UI
/// </summary>
public partial class FrmSecurityOptions : Form
{
private ConnectionOptions connectionOptions; // the OPC server connection options
private readonly ConnectionOptions connectionOptions; // the OPC server connection options


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2>Configuring</h2>
<p class="sd-article-image"><img src="app-auto-report-files/auto_report_users_en.png" alt="Users" /></p>

<p>The settings of Automatic Control Module (item 4) are shown below:</p>
<p class="sd-article-image"><img src="auto-report-files/auto_report_module_en.png" alt="Automatic control module" /></p>
<p class="sd-article-image"><img src="app-auto-report-files/auto_report_module_en.png" alt="Automatic control module" /></p>

<p>An example of Communicator settings for sending emails (item 5) is contained in the DemoProject.en-GB.rsproj project. The following figure shows the device properties:</p>
<p class="sd-article-image"><img src="app-auto-report-files/auto_report_email_en.png" alt="Email settings" /></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ <h2>HTTP Notifications</h2>
</pre>

<h2>Modbus</h2>
<pre class="sd-article-history">KpModbus 5.1.3.0 (May 17, 2021)
<pre class="sd-article-history">KpModbus 5.1.3.1 (November 15, 2021)
- Fixed data packet format for multiple commands
Warning: no backward compatibility for multiple commands having elements of 4 bytes or more

KpModbus 5.1.3.0 (May 17, 2021)
- Improved the flexibility of classes that implement the communication protocol

KpModbus 5.1.2.0 (January 28, 2020)
Expand All @@ -68,7 +72,10 @@ <h2>Modbus</h2>
</pre>

<h2>Modbus Slave</h2>
<pre class="sd-article-history">KpModbusSlave 5.0.0.0 (June 23, 2020)
<pre class="sd-article-history">KpModbusSlave 5.0.0.1 (November 15, 2021)
- Update due to changes in KpModbus

KpModbusSlave 5.0.0.0 (June 23, 2020)
- Initial development of the driver
</pre>

Expand All @@ -82,7 +89,10 @@ <h2>OPC</h2>
</pre>

<h2>OPC UA</h2>
<pre class="sd-article-history">KpOpcUa 5.0.0.1 (May 17, 2021)
<pre class="sd-article-history">KpOpcUa 5.0.0.2 (November 15, 2021)
- Fixed saving security options

KpOpcUa 5.0.0.1 (May 17, 2021)
- Fixed a bug when browsing OPC server nodes

KpOpcUa 5.0.0.0 (January 28, 2020)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,26 @@
</head>
<body>
<h1>Rapid SCADA History</h1>
<pre class="sd-article-history">Rapid SCADA 5.8.3 (May 17, 2021)
<pre class="sd-article-history">Rapid SCADA 5.8.4 (November 15, 2021)
Server 5.1.4.2
DB Export Module 5.1.0.1
Communicator 5.2.1.2
Modbus Driver 5.1.3.1
OPC UA Driver 5.0.0.2
Webstation 5.1.3.0
Agent 5.0.2.0
Administrator 5.5.2.2
Table Editor 5.1.0.1
Scheme Editor 5.3.1.1

Rapid SCADA 5.8.3 (May 17, 2021)
Server 5.1.4.2
DB Export Module 5.0.1.3
Communicator 5.2.1.2
DB Import Driver 5.0.3.0
Email Driver 5.0.4.0
Enron Modbus Driver 5.0.0.0
HTTP Notifications Driver 5.0.1.0
Modbus Driver 5.1.3.0
OPC UA Driver 5.0.0.1
Webstation 5.1.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ <h2>Active DirectoryModule </h2>
</pre>

<h2>Automatic Control Module</h2>
<pre class="sd-article-history">ModAutoControl 5.2.5.2 (May 17, 2021)
<pre class="sd-article-history">ModAutoControl 5.2.5.3 (May 31, 2021)
- Channel value is checked only if status is positive

ModAutoControl 5.2.5.2 (May 17, 2021)
- Fixed saving state if module is not configured

ModAutoControl 5.2.5.1 (December 14, 2020)
Expand All @@ -46,7 +49,10 @@ <h2>Automatic Control Module</h2>
</pre>

<h2>DB Export</h2>
<pre class="sd-article-history">ModDBExport 5.0.1.3 (May 17, 2021)
<pre class="sd-article-history">ModDbExport 5.1.0.1 (November 15, 2021)
- The module is completely redesigned

ModDBExport 5.0.1.3 (May 17, 2021)
- Updated DB connectors

ModDBExport 5.0.1.2 (January 13, 2021)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ <h2>Dashboard</h2>
- Build due to changes in the base libraries</pre>

<h2>Elastic Report</h2>
<pre class="sd-article-history">PlgElasticReport 5.0.5.1 (May 17, 2021)
- Fixed a bug when using the BeginEnd detalization
<pre class="sd-article-history">PlgElasticReport 5.0.5.2 (November 15, 2021)
- Fixed a bug when a page format cannot be set

PlgElasticReport 5.0.5.1 (May 17, 2021)
- Fixed a bug when using the BeginEnd detalization

PlgElasticReport 5.0.5.0 (December 14, 2020)
- Calculate minimum and maximum values by columns and rows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ <h2>HTTP уведомления</h2>
</pre>

<h2>Modbus</h2>
<pre class="sd-article-history">KpModbus 5.1.3.0 (17.05.2021)
<pre class="sd-article-history">KpModbus 5.1.3.1 (15.11.2021)
- Исправлен формат пакета данных для множественных команд
Внимание: отсутствует обратная совместимость множественных команд для элементов от 4 байт

KpModbus 5.1.3.0 (17.05.2021)
- Улучшена гибкость классов, реализующих протокол обмена данными

KpModbus 5.1.2.0 (28.01.2020)
Expand Down Expand Up @@ -93,7 +97,10 @@ <h2>Modbus</h2>
</pre>

<h2>Modbus Slave</h2>
<pre class="sd-article-history">KpModbusSlave 5.0.0.0 (23.06.2020)
<pre class="sd-article-history">KpModbusSlave 5.0.0.1 (15.11.2021)
- Обновление в связи с изменениями в KpModbus

KpModbusSlave 5.0.0.0 (23.06.2020)
- Первоначальная разработка драйвера
</pre>

Expand All @@ -116,7 +123,10 @@ <h2>OPC</h2>
</pre>

<h2>OPC UA</h2>
<pre class="sd-article-history">KpOpcUa 5.0.0.1 (17.05.2021)
<pre class="sd-article-history">KpOpcUa 5.0.0.2 (15.11.2021)
- Исправлено сохранение параметров безопасности

KpOpcUa 5.0.0.1 (17.05.2021)
- Исправлена ошибка обзора узлов OPC-сервера

KpOpcUa 5.0.0.0 (28.01.2020)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@
<body>
<h1>История Rapid SCADA</h1>

<pre class="sd-article-history">Rapid SCADA 5.8.3 (17.05.2021)
<pre class="sd-article-history">Rapid SCADA 5.8.4 (15.11.2021)
Сервер 5.1.4.2
Модуль Экпорт в БД 5.1.0.1
Коммуникатор 5.2.1.2
Драйвер Modbus 5.1.3.1
Драйвер OPC UA 5.0.0.2
Вебстанция 5.1.3.0
Агент 5.0.2.0
Администратор 5.5.2.2
Редактор таблиц 5.1.0.1
Редактор схем 5.3.1.1

Rapid SCADA 5.8.3 (17.05.2021)
Сервер 5.1.4.2
Модуль Экпорт в БД 5.0.1.3
Коммуникатор 5.2.1.2
Драйвер Импорт из БД 5.0.3.0
Драйвер 5.0.4.0
Драйвер Email 5.0.4.0
Драйвер Enron Modbus 5.0.0.0
Драйвер HTTP уведомления 5.0.1.0
Драйвер Modbus 5.1.3.0
Драйвер OPC UA 5.0.0.1
Вебстанция 5.1.3.0
Expand Down
Loading

0 comments on commit f5a9f96

Please sign in to comment.