Function to Send Command

Forum Home Forums Communicating with Devices Modbus Function to Send Command

Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2313
    raazsi
    Participant

    Hi ..

    I used SetVal function and it worked well with input channels. Then, within a function, I tried to write Modbus register through a code by assigning values to the output channel. I could not find any inbuilt function for output channels. So I tried to define one in the formula.

    public void Sendcmd(int cnlval,double cnldata)
    { double cmdVal;
    try
    { cmdVal = Convert.ToDouble(cnldata);
    BeginCalcCmdData(cnlval, cmdVal, null);
    }
    finally { EndCalcCmdData(); }}

    It compiled successfully but its values are not getting sent when I call this function for an output channel.

    Sendcmd(3099,80);

    Whenever I execute this channel in my scheme, Value of ‘1’ is sent to the holding register. I guess this is the default value sent for standard type command.

    The configured output channel is of ‘Standard Type’ & Command Values is ‘Execute’.

    #2314
    manjey73
    Participant

    To be able to send commands to the device after executing the formulas in the input channels required Automatic Control Module

    Automatic Control Module

    #2760
    ayyub.energi
    Participant

    Hi…

    I am trying to send command to plc dse860 from this instruction.

    ====================================
    Typical Requests (Using Pseudo Code)

    ===>>> WriteRegister(10,1008,2,35701, 65535-35701): Puts the module into AUTO mode by writing to (hex) register 1008, the values 35701 (auto mode) and register 1009 the value 65535-35701 (the bitwise opposite of auto mode)

    * One of the system control keys from the table below must be written into register 8 and its ones-compliment written into register 9 with a single function 16 (write multiple registers) to perform the specified system control function.
    * Writing any other value or using a function that is not available will return extended exception code 7 (Illegal value written to register) and have no affect.
    * Function codes 0 to 31 perform exactly the same function as pressing the equivalent button on the control unit.

    ======================================

    Can u help me please?

    #2761
    Mikhail
    Moderator

    Hi,
    First of all, you should create a Modbus template in the Communicator application.
    If you already create the template, please provide a screenshot. Otherwise, create a template and try to send a command using the UI of Communicator.

    #2762
    ayyub.energi
    Participant
    #2767
    Mikhail
    Moderator

    This link requires authorization. Can you share it for all?

    #2769
    ayyub.energi
    Participant
    #2770
    ayyub.energi
    Participant

    i want to send an integer value like 2450455 to command button

    #2773
    Mikhail
    Moderator

    Because we arranged a training, we will test the template and configure command together very soon.

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