Menu

UnitIdentifier 0, broadcast mode

2020-04-10
2020-04-10
  • Jens Vanhoof

    Jens Vanhoof - 2020-04-10

    Hi,

    I have been using the .NET library for a few days now and have had no problems with it until now, I hope you can help me out.

    I'm writing in C# and I have 2 slaves (ID 1 and ID 2) connected on the bus. Until now I changed the parameter .UnitIdentifier before writing to a register, writing the data in order to the 2 slaves but I have now realised that, in my application, I could actually write the same data to the 2 slaves at the same time. This would free up the bus sooner since no response is happening when in broadcast mode.

    Rather then executing the same code twice (with a change in UnitIdentifier in between), I have now set the UnitIdentifier to zero in the beginning and deleted the second block of code.

    Unfortunately this doesn't work. The slaves do not seem to get their data and the program freezes without an exception or error code.

    It seems that the program gets stuck in a loop. When I replace my actual slaves with a simulator via a virtual port, I see that my program keeps repeating the command. The problem immediately goes away when I change UnitIdentifier to 1 again.

    Could this be a bug in the library or am I missing something else?

     OrientalMotor.UnitIdentifier = 0;
                OrientalMotor.WriteMultipleRegisters(1026, new int[2] { azimuthSign, AzimuthValue });
    

    Sends out the following on repeat (doesn't seem to end):

    0x00 0x10 0x04 0x02 0x00 0x02 0x04 0x00 0x00 0x00 0x00 0x44 0x4A
    

    And if I revert to OrientalMotor.Unitidentifier = 1; it correctly sends out just once:

    0x01 0x10 0x04 0x02 0x00 0x02 0x04 0x00 0x00 0x00 0x00 0x40 0xB6
    

    Any help would be greatly appreciated!
    Thanks!
    Jens

     
    • Anonymous

      Anonymous - 2020-06-01
      Post awaiting moderation.

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.