Reading event log from modbus device

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

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #16689
    oley
    Participant

    Hi,

    I have got some information from the manufacturer of the device.
    Address 0x0501 contains count of the new events since last reading.
    Address 0x0502 contains total count of the events, max 1024.

    Address range 0x1000-0x13FF contains events from the most recent and it is locked until the register 0x0501 or 0x0502 is read again.

    What if I create group of channels from 0x1000 to 0x13FF and every channel will have formula:

    channel 0x1000 -> if (channel0x0501 > 0 and channel0x0502 > 0)
    channel 0x1001 -> if (channel0x0501 > 1 and channel0x0502 > 1)

    and so on?

    If I activate the events for each channel, so they will appear in the event log.
    Is this possible?

    Best regards

    #16695
    Mikhail
    Moderator

    Hi,
    Probably, you can read the most recent event from the fixed Modbus address. Then you will get it as channel values. How will you process those channel values?

    #16696
    oley
    Participant

    Hi,

    it would be good to generate SCADA events based on those events, so I have it in standard event list.

    #16697
    oley
    Participant

    This is a bit complicated, so I’ll try to explain again.
    I read 0x0501 and can get:
    – 0, that is, no new event has occurred since the last reading of 0x0501
    – a value greater than 0, such as 5, and then I have to read addresses 0x1000 to 0x1005 to get 5 events

    #16700
    manjey73
    Participant

    and if the value is 5 but you read 10, will there be an error or just zeros? and how are the events arranged? are these consistent occurrences? how will you identify them?

    #16701
    oley
    Participant

    Next registers contains events from the previous reading.
    0x0006 will be the 0x0000 from the previous reading of 0x0501 because 5 new events have been created in the meantime and have been placed at the top of the list.
    Next ones are historical data up to the value of 0x0502 (max 1024).
    After restart of the device the list is empty and both 0x0501 and 0x0502 contains 0. After first event created both 0x0501 and 0x0502 contains 1, but if we read 0x0501 or 0x0502 and no event occurred 0x0501 is 0 and 0x0502 is 1.

    #16702
    oley
    Participant

    Since I am familiar with the .net framework and the C# programming language, I would most like to program the handling of these events as a driver.
    From such a driver, would I be able to read any ModBus device registers and generate SCADA events based on them?
    I understand that I need to create the device logic by creating a class inherited from DeviceLogic, access the data via class inherited from DeviceData and creating events using a class derived from DeviceEvent.
    The question is, is there a minimal example of a ModBus device driver available that I could follow?

    #16707
    Mikhail
    Moderator

    a value greater than 0, such as 5, and then I have to read addresses 0x1000 to 0x1005 to get 5 events

    You can send a command to poll the device using Automatic Control Module. Then try to generate events with the same module. Before developing a new driver, it’s worth trying.

    From such a driver, would I be able to read any ModBus device registers and generate SCADA events based on them?

    Yes.

    is there a minimal example of a ModBus device driver available that I could follow?

    Check the existing drivers, especially DrvModbus, DrvEnronModbus and DrvSimulator.

    • This reply was modified 1 month ago by Mikhail.
    #16716
    oley
    Participant

    Thank you. To clarify: you mean to define 2 device pollings, first for data and second for this log events. Second one should poll only for command?

    #16718
    manjey73
    Participant

    Another example of event generation from the driver

    You probably need to make a derived driver for events from the device. Connect the DrvModbus driver as required. As a channel, make something like an indicator of the presence of an event to save the time of occurrence in the database. Maybe an event counter.
    If the events that have occurred are sequentially arranged in the event buffer, and their sequence may be different, this is probably the best option. Creating a list of events should probably be done through for(foreach) and selecting them from the list of possible ones.

    #16719
    oley
    Participant

    Thank you.
    Yes, the events are sequentially arranged in the buffer.
    The new ones are written at the top of the buffer.
    I have to read as many, as value of 0x0501 register, which stores the count of the events written to the buffer since last read.

    #16732
    Mikhail
    Moderator

    To clarify: you mean to define 2 device pollings, first for data and second for this log events. Second one should poll only for command?

    That’s right.

Viewing 12 posts - 16 through 27 (of 27 total)
  • You must be logged in to reply to this topic.