Send/Import data with timestamps from a driver

Forum Home Forums Development and Integration Send/Import data with timestamps from a driver

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9005
    M.Biagooi
    Participant

    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?

    #9006
    Mikhail
    Moderator

    Hi,

    The KPLogic class contains AddArcSrez method. The example is here

    Do you use some library that implements IEC60870 or implement the protocol from scratch?

    #9009
    M.Biagooi
    Participant

    Thanks 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.

    #9012
    Mikhail
    Moderator

    Interesting. 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.

    #9018
    M.Biagooi
    Participant

    It is fully written in C#.

    So there’s no problem with GPL. That’s good.

    #10108
    VylegzhaninD
    Participant

    Did 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.

    #10112
    M.Biagooi
    Participant

    Dear VylegzhaninD.
    Thanks for your interest. Unfortunately No, it’s not published because it is not finished yet. I can’t understand Rapidcada structure yet.

    #10114
    Mikhail
    Moderator

    Hello,

    I can’t understand Rapidcada structure yet

    Ready to help if you ask more questions.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.