Forum Home › Forums › Development and Integration › Send/Import data with timestamps from a driver
Tagged: time-stamp, timestamp
- This topic has 7 replies, 3 voices, and was last updated 2 years ago by Mikhail.
-
AuthorPosts
-
May 31, 2021 at 8:37 am #9005M.BiagooiParticipant
Hi there.
I’m trying to develop IEC60870-5-104 driver. I have somehow developed it to the point of getting current data. But IEC104 protocol has some datatypes with timestamp. How can I import the timestamped data into the correct time of Rapid SCADA archive?
I had some idea but it doesn’t look efficient to me. For example, we have IMPORTED_IEC104_TIMESTAMP, IMPORTED_IEC104_VALUE and the input channel index as CNL_INDEX.
DateTime dtRaw = DateTime.Parse(IMPORTED_IEC104_TIMESTAMP); string dtRawString = dtRaw.Date.ToString(); string filedate = dtRaw.ToString("yyyy-MM-dd HH:mm"); string archFileName = "m" + filedate.Substring(2, 2) + filedate.Substring(5, 2) + filedate.Substring(8, 2) + ".dat"; SrezAdapter adapter = new SrezAdapter(); adapter.FileName = archFileName ; adapter.Directory = "C:\\SCADA\\ArchiveDAT\\Min\\"; SrezTable table = new SrezTable(); adapter.Fill(table); string fileDateMinCurrent = filedate.Substring(0, 16) + ":00"; DateTime dateTime = DateTime.Parse(fileDateMinCurrent); SrezTable.Srez old_srez = table.GetSrez(dateTime); old_srez.CnlData[CNL_INDEX].Val = IMPORTED_IEC104_VALUE; old_srez.CnlData[CNL_INDEX].Stat = 2; table.MarkSrezAsModified(old_srez); adapter.Update(table);
Is there a simple function similar to ‘Scada.Comm.Devices.KPLogic.SetCurData()’ which presents such a capability?
May 31, 2021 at 11:53 am #9006MikhailModeratorHi,
The KPLogic class contains AddArcSrez method. The example is here
Do you use some library that implements IEC60870 or implement the protocol from scratch?
May 31, 2021 at 5:17 pm #9009M.BiagooiParticipantThanks for the link. It will be very helpful.
I have used https://github.com/mz-automation libraries. It is the best library I have found in both C++ and C#. It has GPL-3.0 license. Not sure how it should be used alongside Apache-2.0.
June 1, 2021 at 2:06 pm #9012MikhailModeratorInteresting. Is the C# library is fully written in C# or just a wrapper for C library?
GPL requires you to provide the source code of your driver. If you do this, I suppose it’s compatible with Apache-2.0.
June 2, 2021 at 9:02 am #9018M.BiagooiParticipantIt is fully written in C#.
So there’s no problem with GPL. That’s good.
March 18, 2022 at 8:33 pm #10108VylegzhaninDParticipantDid you successfully implement the driver?
If, according to the license, the driver code must be published, is the driver published and where exactly is it published?
I’m more interested in the compiled driver.March 23, 2022 at 5:54 am #10112M.BiagooiParticipantDear VylegzhaninD.
Thanks for your interest. Unfortunately No, it’s not published because it is not finished yet. I can’t understand Rapidcada structure yet.March 23, 2022 at 10:56 am #10114MikhailModeratorHello,
I can’t understand Rapidcada structure yet
Ready to help if you ask more questions.
-
AuthorPosts
- You must be logged in to reply to this topic.