Writing output coil registers

Forum Home Forums Understanding the Software Writing output coil registers

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5807
    dineshkumargowd
    Participant

    Dear Mikahil,

    I have a modbus I/O device in which i would like to write the output registers (Function – 05) as 16bit unsigned Int as per the manufacturer recommendations. If i send the command as 02 05 00 00 00 01 CRC, then the device will turn ON (Device address is 02).

    I am able to write the output register with the same format mentioned above using another modbus software.

    How can i achieve the above said command using rapid scada. Kindly help me.

    #5811
    Mikhail
    Moderator

    Hello,

    You should specify a command in your Modbus template. If you share a screenshot of your template after you do this, I can validate it.

    #5815
    dineshkumargowd
    Participant

    Dear Mikhail,

    Please find the link for the image in which i have assigned command. But element type was disabled and was not unable to modify it.

    https://drive.google.com/file/d/10D32r2JbHoJez86cXPoWSUop4cU3izzd/view?usp=sharing

    I would like to set the element type or data type as Unsigned Int (2 bytes). Kindly help how can i set that.

    Trailing image in which i have written output coil by assigning coil as 16bit unsigned int. Kindly verify this too.

    https://drive.google.com/file/d/1Trssa6pOLDKR0WlwAFXqxBx_pKfp4QGN/view?usp=sharing

    #5817
    Mikhail
    Moderator

    Hello,

    It’s a good idea to create a one command while testing.
    To set 2 bytes register, choose Holding Registers in command properties.
    Watch the new video about it.

    #5818
    dineshkumargowd
    Participant

    Dear Mikhail,

    I have followed the entire procedure same. I succeed in reading and writing holding registers which are specified in register map. I also able to read the status of digital inputs and digital outputs. I can force the multiple digital outputs from available holding register provided in manual by sending the command 1 to turn on output 1 or 4 to turn on input 5, but this is not feasible for me. So i would like to TURN ON one coil at at time just by sending decimal 01 to the register.

    But the problem is that in order to force on one digital input at a time, i have to declare the coil type as unsigned int instead of bool and have to send 00 01 command instead of FF 00 to TURN ON.

    If i declare as holding register in command properties then the communicator will send the command the as 02 06 00 00 00 01 48 39 (since device address is 02 and function code of write holding register is 06)

    I would like to send the command with function code – 05 and want to declare the register as 02 bytes uint. Kindly help how can i achieve this.

    Trailing image for your reference, i have declared command as holding register and it is sending command as function code 06. I have clearly shown you the image in the previous post that i would like to send the command as 02 05 00 00 00 01 along with CRC.

    https://drive.google.com/file/d/1iLE-62Xdc-4m-RXnwR_MNZLIv2sjo1Tc/view?usp=sharing

    Waiting for your help.

    #5822
    Mikhail
    Moderator

    Hello,

    I would like to send the command with function code – 05 and want to declare the register as 02 bytes uint.

    According to the Modbus specification, function 05 is used to set a coil. Coil is a one bit, so you can’t set uint by function 05.
    To set holding registers, function 06 is used.

    #5825
    dineshkumargowd
    Participant

    Dear Mikhail,

    I understand that coil is only one bit. But the device which i bought was using two register for coil. I have already sent you image in the first post that i have turned ON a coil by assigning it as UINT.

    This device modbus request is not as per standard modbus commands(Only for output coil).

    How can i do this in Rapidscada ??

    #5828
    Mikhail
    Moderator

    Hello,
    If a device provide flags as uint, likely you need to set them as holding register by a function 06. Isn’t it?

    In case you need to mix functions 05 and 06 that is out of Modbus standard, you should modify the driver source code.

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