ModbusRTU: SP12 -> SP16

2023-07-18
2023-07-19
  • lostcontrol - 2023-07-18

    Hi,
    I have had an application running on V3.5 SP12 that have since upgraded to V3.5 SP16 ( hardware supported version )

    I had a function block that had an input parameter:

    slave : IoDrvModbus.ModbusSlaveComPort;
    

    This implementation worked as I expected.

    When I have upgraded to SP16/19, the same assignment does not compile & gives error C0328 : Assignment not allowed for type ModbusSlaveComPort_Diag
    We are at a loss as to why this worked for SP12, but no longer for SP16.

    Ive managed a workaround for now which is not ideal.

    The reason for using this method vs the in-built scan list is to control the polling of the slaves and order.

    any takers?

     
  • TimvH

    TimvH - 2023-07-19

    I'm not sure, but I guess it has the attribute 'no_assign'. Probably it is better to use a reference:

    VAR_INPUT
        slave : REFERENCE TO IoDrvModbus.ModbusSlaveComPort;
    END_VAR
    
     
    πŸ‘
    1
    • lostcontrol - 2023-07-19

      Nope, the attribute no_assign did not make a difference neither did the no_assign_warning.

      But, that change to reference declaration was the solution!!
      Thanks for taking the time to reply!

       

Log in to post a comment.