Menu

Cannot WriteMultipleCoils - EasyModBus.Exceptions.QuantityInvalidException

Anonymous
2016-07-29
2016-08-02
  • Anonymous

    Anonymous - 2016-07-29

    I'm working on EasyModBus to use a MURR ModBus, model CUBE20S.
    It works fine, except for use the command WriteMultipleCoils.

    I have a stack of 2 Output Modules, each of 8 signals (8 bit).

    I got an array of Signals in Boolean, and I send to it with WriteMultipleCoils, starting from Bit 0.

    Dim BB as Boolean() = {True, False, False, True, False, False, False, True}
    myMURR.WriteMultipleCoils(0, BB)
    

    In this way, I got the error:

    Exception "EasyModBus.Exceptions.QuantityInvalidException"
    

    If I try with an iteration writing single coil like this:

    Dim BB as Boolean() = {True, False, False, True, False, False, False, True}
    For i as Integer = 0 to (BB.Length - 1)
        myMURR.WriteSingleCoil( i, BB(i) )
    Next
    

    ... I don't have any exception and it Works like a charm.

    So, writing multiple coils is much easy for my project.

     
    • Rossmann Engineering

      Hi,

      this exception is thrown, if the Server (You Murr Cube Device) answers with an exception code.

      Of course it is much better to write multiple Coils instead of 8 request for single coils.

      I just tried it, and the Request to the Server is correct.

      Stefan

       
  • Anonymous

    Anonymous - 2016-08-02

    I see, but the previous version, May 2015, works better on write multiple coils, mith the same device.

     
    • Rossmann Engineering

      Could be the "unitIdentifier". Try to set the properyt "UnitIdentifier" to "0".

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.