Reading event log from modbus device

Forum Home Forums Understanding the Software Reading event log from modbus device

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #16545
    oley
    Participant

    Hello,

    I have a modbus device connected that has an event log.
    Before reading events, I have to read the register of the number of new events.
    This freezes the current event list so that new events occurring during the readout will not cause the buffer to move.
    It is possible to read both registers independently, or read both registers at once.

    Register 0x0501 -Number of new events
    Register 0x0502 -Number of all events

    Reading events can be freely divided (reading events in portions).
    I should specify the number of the initial event as the address from under which you want to read, while the number of registers to be read should be the number of events to be read * 8.
    The number of registers to be read must be divisible by 8.
    The event address must be in the range 0x1000 <= Register <= 0x13FF, where register 0x1000 contains the most recent event
    For an Ethernet link, a maximum of 60 events (60*8 registers) can be read in one packet.

    I would like to retrieve these events and present them in the view and save them in the database.

    Please give me a hint on how such functionality can be implemented.

    Best regards

    #16550
    Mikhail
    Moderator

    Hello,

    Likely, it’s possible to send the required requests using the existing Modbus Driver. But the driver parses the received packets as current data. Do you think, it can be OK for your task? If so, you could try, and I can help. Otherwise, a custom driver (based on the existing one) may be needed.

    • This reply was modified 1 week, 2 days ago by Mikhail.
    #16552
    Mikhail
    Moderator

    Events in terms of Rapid SCADA can be generated with Automatic Control Module.

    #16553
    Mikhail
    Moderator

    The event address must be in the range 0x1000 <= Register <= 0x13FF, where register 0x1000 contains the most recent even

    Is it possible to read only the most recent event as many times as it exists instead of polling different addresses?

    #16559
    oley
    Participant

    Hello,

    Thank you for your advice.
    I will check if reading from one address is enough.
    I will also try the Automatic Control Module and come back with any further questions.

    #16563
    Mikhail
    Moderator

    Automatic Control Module sends commands to a device. Commands can be for writing a register, and for polling a device.

    #16565
    oley
    Participant

    I’m not sure if I can make it with Automatic Control Module.
    This device has a register range for events, which is a circular buffer.

    One event is written in 8 registers:
    0 Event code
    1 Value: Lo(Int1), Hi(Int2)
    2,3 Value float
    4 Lo(month), Hi(end of year)
    5 Lo(hour), Hi(day)
    6 Lo(second), Hi(minute)
    7 milliseconds

    The last event is under 0x1000, the pass under 0x1008, and so on.

    I would like to save all events in the database and present them in a view already from the database. I think this is the easiest way. The complicated part is reading from the device and storing them in the database.

    #16566
    manjey73
    Participant

    If the registers go sequentially, you can form the command in binary form, for example, an array of bytes. And send it to the device using multiple recordings. In the template, you can additionally create the necessary commands, separate from reading the registers.
    The bigger question here is that reading the main registers is current data, and you may need data from the archive, which is data from the past.

    #16567
    oley
    Participant

    During SCADA running, I can polling the counter for new events (separate register 0x0500) and read as many as occurred.
    After a restart, I would have to read all the events that I did not save in the database to archive the full history.

    #16568
    manjey73
    Participant

    The question is, what is this event, and how many are there?
    And I take it they have a past tense? then it’s writing a driver that decomposes these events in the database exactly by time.
    Similar to how the driver works with archives. Modbus cannot work with device archives.
    You can save them only to the current data.

    #16569
    oley
    Participant

    I’m familiar with .NET so driver that decomposes events is a good option.
    Should it be a class derived from DevModbusLogic?

    #16570
    manjey73
    Participant

    Yes, Mikhail wrote that you can use the driver as a dependency and write something of your own.

    You will have to work with Slice from your part of the new driver. To record data in the channels’ past.

    • This reply was modified 1 week, 1 day ago by manjey73.
    #16575
    Mikhail
    Moderator

    > The last event is under 0x1000, the pass under 0x1008, and so on.
    After the last event is read by the driver, is the previous event moved to the address 0x1000?
    If so, it’s possible to use the existing driver.
    If not, you need to develop a driver based on the existing. For example, I had to develop a driver (named S2000-PP) in similar situation.

    #16576
    oley
    Participant

    I am in contact with the manufacturer of the device, because the documentation does not specify this.
    Is the code of this S2000-PP driver available for review?

    #16580
    Mikhail
    Moderator

    Is the code of this S2000-PP driver available for review?

    It’s proprietary. If you decide to develop you own driver, I will copy some parts of the source code that can help.

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