Ответы в темах
-
АвторСообщения
-
OlegУчастникЯсно, спасибо большое!
OlegУчастникМихаил, спасибо — заработало, то что не работало, и не сломалось, то что работало 🙂
А в чем проблема была (DateTime did not have the Kind property set correctly) ?
OlegУчастникМихаил, а на первом?
OlegУчастник
OlegУчастникбанальный вопрос — какое время установлено на вашем сервере ?
Не в настройках Scada а именно на сервере?UTC+3, Москва
OlegУчастникМихаил, на рабочих серверах ОС Windows 10 и 11. На обоих не работает месячный период.
OlegУчастникМихаил, отчет из дистрибутива плагина тоже не работает. Ошибка такая же, купленный плагин выполняет не все функции
OlegУчастникЗдравствуйте. Увидел, что обсуждение сюда переехало. Прошу помощи в устранении ошибки необработанного исключения.
Отчет с периодом в дни отображается, с периодом месяцы — ошибка. Пробовали и +3, и 0 и -3 смещения в конфиге — не помогает. Куда копать?Ошибка:
System.ArgumentException: The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. (Parameter ‘sourceTimeZone’)
at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData)
at System.TimeZoneInfo.ConvertTimeToUtc(DateTime dateTime, TimeZoneInfo sourceTimeZone)
at Scada.Report.ReportUtils.GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, PeriodUnit unit)
at lambda_method18(Closure, Object, Object[])
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)Ссылка:
ElasticReport/Print/PrintReport2?reportID=2&unit=Month&period=1&archive=Hour&format=Html
Отчет:
<?xml version=»1.0″ encoding=»utf-8″ ?>
<ElasticReport>
<!— Input form options —>
<InputOptions>
<!— User can select report period —>
<SelectPeriod>true</SelectPeriod>
<!— User can select archive —>
<SelectArchive>true</SelectArchive>
<!— User can select channels —>
<SelectChannels>false</SelectChannels>
<!— User can select output format —>
<SelectFormat>true</SelectFormat>
<!— Defines how the period is entered. Possible values: SingleDate, SingleMonth, DatePeriod, DateTimePeriod, MonthPeriod —>
<PeriodControl>MonthPeriod</PeriodControl>
<!— Maximum report period in days —>
<MaxPeriod>12</MaxPeriod>
<!— Default archive code —>
<DefaultArchive>Hour</DefaultArchive>
<!— Default output format: Pdf, Xlsx, Html —>
<DefaultFormat>Pdf</DefaultFormat>
</InputOptions><!— Output options. Page format and orientation only work for PDF —>
<OutputOptions>
<!— Page format: A0, A1, A2, A3, A4, A5, A6, B5, Letter, Legal, Ledger or P11x17 —>
<PageFormat>A4</PageFormat>
<!— Page orientation: Portrait or Landscape —>
<Orientation>Landscape</Orientation>
<!— Specifies custom report styles —>
<StyleSheet></StyleSheet>
</OutputOptions><!—
Report document consists of sections. Section is a separate block of displayed data.
Section contains elements such as a table, columns, rows, and cells.
Section working period is based on the specified report period and shifted according to the section data options.Element attributes are inherited from an element to its children and applied to suitable elements.
The following element attributes are supported:
* cnlNum — channel number,
* cnlIdx — channel index if channels are specified as input parameters,
* calcType — calculation type,
* calcSum — whether to calculate a sum of a column or row,
* calcAvg — whether to calculate an average of a column or row,
* calcMin — whether to calculate a minimum value of a column or row,
* calcMax — whether to calculate a maximum value of a column or row,
* colStyle — column style,
* rowStyle — row style,
* cellStyle — cell style.Table attributes:
* border — whether to display table border.The possible values of the calcType attribute:
* Val — the value of the bound channel at the processed timestamp,
* FirstVal — the value at the first timestamp of the working period,
* LastVal — the value at the last timestamp of the working period,
* Diff — the difference between the values at the processed and previous timestamps,
* DiffNext — the difference between the values at the next and processed timestamps,
* Const — the constant value to insert in the corresponding cell,
* Formula — the formula to insert in the corresponding cell, supported only by Excel.Style names follow the rules:
Column style name must be in the form «col-*».
Row style name must be in the form «row-*».
Cell style name must be in the form «cell-*».Variables can be used inside an element name and inside a constant value.
The following variables are supported:
{CnlNum} — channel number,
{CnlName} — channel name.
—><Document>
<DocumentOptions>
<!— Heading of the report —>
<Heading>Отчет о климате</Heading>
<!— Show or hide heading —>
<HeadingVisible>true</HeadingVisible>
<!— Set text color depending on channel status —>
<UseStatusColor>true</UseStatusColor>
</DocumentOptions><!—
Section of TimeData type.
Supported calculation types: Val, Diff, DiffNext, Const, Formula.
—>
<Section type=»TimeData»>
<SectionOptions>
<!— Unique section ID. Use Latin characters without spaces —>
<ID>Section1</ID>
<!— Subheading of the section —>
<Subheading>TimeData Section</Subheading>
<!— Show or hide subheading —>
<SubheadingVisible>false</SubheadingVisible>
<!— Start the section on a new page —>
<PrependPageBreak>false</PrependPageBreak>
</SectionOptions><DataOptions>
<!— Prepend additional time before the report start time —>
<PrependTime>0:00:00</PrependTime>
<!— Append additional time after the report end time —>
<AppendTime>0:00:00</AppendTime>
<!— Skip the first timestamp from output —>
<SkipFirst>false</SkipFirst>
<!— Skip the last timestamp from output —>
<SkipLast>false</SkipLast>
<!— Defines how timestamps are enumerated. Possible values: All, Step, Hour, Day, Month, Exact, BeginEnd —>
<TimeDetailing>Hour</TimeDetailing>
<!— Time step —>
<TimeStep>1:00:00</TimeStep>
<!— Times of day separated by commas —>
<ExactTimes>0:00, 12:00</ExactTimes>
<!— Defines how the date and time column is displayed —>
<ShowDatesOnly>false</ShowDatesOnly>
</DataOptions><Table border=»true»>
<ColumnGroup name=»Показания датчиков:»>
<Column name=»{CnlName}» cnlNum=»900000″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900002″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900001″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900003″ calcType=»Val» />
</ColumnGroup>
</Table></Section>
</Document>
</ElasticReport>
OlegУчастникДобрый вечер. У нас такая же проблема. Отчет с периодом в дни отображается, с периодом месяцы — ошибка. Пробовали и +3, и 0 и -3 смещения в конфиге — не помогает. Куда копать?
Ошибка:
System.ArgumentException: The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. (Parameter ‘sourceTimeZone’)
at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData)
at System.TimeZoneInfo.ConvertTimeToUtc(DateTime dateTime, TimeZoneInfo sourceTimeZone)
at Scada.Report.ReportUtils.GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, PeriodUnit unit)
at lambda_method18(Closure, Object, Object[])
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)Ссылка:
ElasticReport/Print/PrintReport2?reportID=2&unit=Month&period=1&archive=Hour&format=Html
Отчет:
<?xml version=»1.0″ encoding=»utf-8″ ?>
<ElasticReport>
<!— Input form options —>
<InputOptions>
<!— User can select report period —>
<SelectPeriod>true</SelectPeriod>
<!— User can select archive —>
<SelectArchive>true</SelectArchive>
<!— User can select channels —>
<SelectChannels>false</SelectChannels>
<!— User can select output format —>
<SelectFormat>true</SelectFormat>
<!— Defines how the period is entered. Possible values: SingleDate, SingleMonth, DatePeriod, DateTimePeriod, MonthPeriod —>
<PeriodControl>MonthPeriod</PeriodControl>
<!— Maximum report period in days —>
<MaxPeriod>12</MaxPeriod>
<!— Default archive code —>
<DefaultArchive>Hour</DefaultArchive>
<!— Default output format: Pdf, Xlsx, Html —>
<DefaultFormat>Pdf</DefaultFormat>
</InputOptions><!— Output options. Page format and orientation only work for PDF —>
<OutputOptions>
<!— Page format: A0, A1, A2, A3, A4, A5, A6, B5, Letter, Legal, Ledger or P11x17 —>
<PageFormat>A4</PageFormat>
<!— Page orientation: Portrait or Landscape —>
<Orientation>Landscape</Orientation>
<!— Specifies custom report styles —>
<StyleSheet></StyleSheet>
</OutputOptions><!—
Report document consists of sections. Section is a separate block of displayed data.
Section contains elements such as a table, columns, rows, and cells.
Section working period is based on the specified report period and shifted according to the section data options.Element attributes are inherited from an element to its children and applied to suitable elements.
The following element attributes are supported:
* cnlNum — channel number,
* cnlIdx — channel index if channels are specified as input parameters,
* calcType — calculation type,
* calcSum — whether to calculate a sum of a column or row,
* calcAvg — whether to calculate an average of a column or row,
* calcMin — whether to calculate a minimum value of a column or row,
* calcMax — whether to calculate a maximum value of a column or row,
* colStyle — column style,
* rowStyle — row style,
* cellStyle — cell style.Table attributes:
* border — whether to display table border.The possible values of the calcType attribute:
* Val — the value of the bound channel at the processed timestamp,
* FirstVal — the value at the first timestamp of the working period,
* LastVal — the value at the last timestamp of the working period,
* Diff — the difference between the values at the processed and previous timestamps,
* DiffNext — the difference between the values at the next and processed timestamps,
* Const — the constant value to insert in the corresponding cell,
* Formula — the formula to insert in the corresponding cell, supported only by Excel.Style names follow the rules:
Column style name must be in the form «col-*».
Row style name must be in the form «row-*».
Cell style name must be in the form «cell-*».Variables can be used inside an element name and inside a constant value.
The following variables are supported:
{CnlNum} — channel number,
{CnlName} — channel name.
—><Document>
<DocumentOptions>
<!— Heading of the report —>
<Heading>Отчет о климате</Heading>
<!— Show or hide heading —>
<HeadingVisible>true</HeadingVisible>
<!— Set text color depending on channel status —>
<UseStatusColor>true</UseStatusColor>
</DocumentOptions><!—
Section of TimeData type.
Supported calculation types: Val, Diff, DiffNext, Const, Formula.
—>
<Section type=»TimeData»>
<SectionOptions>
<!— Unique section ID. Use Latin characters without spaces —>
<ID>Section1</ID>
<!— Subheading of the section —>
<Subheading>TimeData Section</Subheading>
<!— Show or hide subheading —>
<SubheadingVisible>false</SubheadingVisible>
<!— Start the section on a new page —>
<PrependPageBreak>false</PrependPageBreak>
</SectionOptions><DataOptions>
<!— Prepend additional time before the report start time —>
<PrependTime>0:00:00</PrependTime>
<!— Append additional time after the report end time —>
<AppendTime>0:00:00</AppendTime>
<!— Skip the first timestamp from output —>
<SkipFirst>false</SkipFirst>
<!— Skip the last timestamp from output —>
<SkipLast>false</SkipLast>
<!— Defines how timestamps are enumerated. Possible values: All, Step, Hour, Day, Month, Exact, BeginEnd —>
<TimeDetailing>Hour</TimeDetailing>
<!— Time step —>
<TimeStep>1:00:00</TimeStep>
<!— Times of day separated by commas —>
<ExactTimes>0:00, 12:00</ExactTimes>
<!— Defines how the date and time column is displayed —>
<ShowDatesOnly>false</ShowDatesOnly>
</DataOptions><Table border=»true»>
<ColumnGroup name=»Показания датчиков:»>
<Column name=»{CnlName}» cnlNum=»900000″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900002″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900001″ calcType=»Val» />
<Column name=»{CnlName}» cnlNum=»900003″ calcType=»Val» />
</ColumnGroup>
</Table></Section>
</Document>
</ElasticReport>
OlegУчастникНаконец попробовал — спасибо!
Теперь с чтением проблемы определенные.
Драйвер зачем-то создает лишние каналы, по фото более наглядно)
OlegУчастникДа, получается пока никак. Может в новых версиях появится возможность..
Ну ничего, все равно OPC оптимизирует связь, и если в подписку добавить не массив в 1500 единиц, а 1500 переменных — сервер OPC все равно получает массив. Важно, чтобы адреса в PLC шли подряд.Там не только булевые, но и 500 INT, 500 DINT, 500 REAL (большая часть резерв).
1500 это с запасом (из них 1200 это ошибки с HMI). Можно конечно читать с OPC не побитно, а 4х8 (DWORD) сразу, но тогда в SCADA нужно формулами биты выделять. Особо нет разницы.
-
Ответ изменён 1 год, 3 месяца назад пользователем
Oleg.
OlegУчастникМихаил, здравствуйте.
Как можно дать другие имена для отдельных элементов массива для отображения/подписи на Графикам Про?
В Таблицах можно дать любое название канала для отображения на веб странице.
OlegУчастникКанал 210000 имеет длину 4, поэтому каналы 210001…210003 игнорируются Сервером. То есть их нет в базе практически.
Это уже ясно конечно, только получается, что если мы по OPC получаем массив, но свои имена каналам массива не дать для графиков? Только если создавать дублирующие каналы типа расчётный с копией значений оригинальных каналов?
OlegУчастникПохоже тут надо делать дубли и уже называть как вам надо.
Просто это лишняя работа и лишняя нагрузка на сервер, копировать значения входных каналов в рассчетные. Если их 50 — ладно, а если 5000…
Графики не берут имена из таблиц представлений похоже.
В этом и проблема
Я пробовал задать код тега в качестве привязки к данным коммуникатора вместо Real_array_4 и длины данных = 4 использовать каналы с тегами Real_array_4[0], Real_array_4[1], … и длиной данных 1. Тогда теряется привязка у коммуникатора.
-
Ответ изменён 1 год, 3 месяца назад пользователем
-
АвторСообщения

