BInary commands for Modbus

Forum Home Forums Communicating with Devices Modbus BInary commands for Modbus

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3269
    heliodor
    Participant

    Hi,

    I am trying to connect Communicator to our special PLC using Modbus.
    I was able to get it to work with Standard commands (where it asks user to enter the parameter and sends appropriate command).

    Now I want to have a command, that would not require user to enter any parameter, but would send the command with predefined constant parameters.

    Example:
    PLC supports a “set color” command where we send (using 0x10 Modbus function, registry address 0x240 a binary command of 3 bytes <red><green><blue>).
    I want to create a control in the schema, where user presses a button “Set to blue” and the command would be sent with 255 0 0. Then there would be a button “Set to red”… you get the point.

    How shall I configure that? Found no doc on Command values.

    #3271
    Mikhail
    Moderator

    Hi,
    For the row of the output channel in the Administrator app set “Command values” to “Execute” and define a formula for the row. If you just need a constant, a formula can be, for example: 1

    #3275
    heliodor
    Participant

    Thanks, but if I want to send a longer binary string, what should be the syntax?

    Example: it works fine if I use binary Hexadecimal command in the Communicator, command being “00000002000000FF00FE”. How can I put such a long constant to a formula?

    #3277
    heliodor
    Participant

    I found the answer by try-and-error:
    For binary commands the data type expected is byte[], so for the example I needed this C# Formula is good:

    new byte[] {0, 0, 0, 2, 0, 0, 0, 0xFF, 0, 0xFE }

    #3280
    Mikhail
    Moderator

    This a one possible method.
    Other option is Automatic Control Module that can trigger on simple command and send any custom command.

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