Send Setpoint value (float number)

Forum Home Forums Understanding the Software Send Setpoint value (float number)

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
  • #2399

    Hi everyone,
    I have a trouble when I want to send setpoint value to Device (connecting to OPC). I use dynamic text to send desired values but in the scheme received values are different.
    The command values are created in the attached pictures (1).
    I set in command values 10;50.5;101.5
    Results of command are different 0,1,2. (can see in the pictures)
    Anybody can help me.
    the pictures are here.


    When transferring 10;50.5;101.5 are values, this is the text for the buttons.
    The value is precisely 0 , 1 and 2
    Need for a control channel to write a formula that will check the value 0,1 or 2 and substitute these values instead of the required 10, 50.5 или101.5
    And may also have the formula of permutation bytes, if you work directly with the device. With OPC has faced, may not require.


    That’s right.
    Note: in English control channels are named “output channels”.


    I also tested with the simple formulas ( Cnl*100) but the commands returned only 0.00. Without formula results are 0.00 1.00 and 2.00. I dont know data type of the results. Is int or real or string?


    All formulas return a double, but to enumerate the possible integer values only.
    On; Off; Reset values 0, 1 and 2
    ; Off; Reset values 1 and 2 appear to have two buttons Off and Reset

    In the output channel to be used in the formula Cmd*100 (example)
    Or write more complex formula in the database of formulas, call it for example Out_real, and to apply the output channel Out_real(Cmd)

    Where is Cmd will get the values 0, 1 or 2 and depending on them you will return the desired value.

    Using Formulas

    • This reply was modified 3 years, 3 months ago by Avatarmanjey73.

    I’ve writen a formula
    double SPFloat()
    if(Cnl==0) return 10.5;
    if(Cnl==1) return 50.0
    if(Cnl==2) return 101.5
    it’s correct.


    Talking about commands, you should use Cmd instead of Cnl.
    Anyway this formula causes compilation error because a function must return a value from all logical branches.


    If you can use Visual Studio, the Formula Tester project helps you to debug your formulas.


    Thank so much Mikhail.



    I have tried to do exactly what has been proposed, but it doesn’t work. I want to send a setpoint to an address (in my case a pH setpoint to the address 2109 in a modbus device). In the Communicator I’ve created a command, and tried to send a new setpoint from the “Commands tab”. The message “The command has been sent successfully” appeared, but the setpoint has not been changed. In the log file there is no trace from the command and in the “Devices data” of the communicator no command is shown.

    All input channels work perfectly. I still haven’t create any output channel.

    H E L P ! ;-)))

    Thank you in advance



    In the log file there is no trace from the command

    You need to find info in a communication line log. The name of the file is C:\SCADA\ScadaComm\Log\lineXXX.log
    I think this will clarify the cause.


    The command has been sent successfully

    This message means sending command from the shell to the service.


    Hi All

    I have similar problem and I did not find ansver there.
    I have output chanel and it working corectly when I send command directly what mean to on/off I send 256/512 value.
    To simplifiy I trying to convert to 0/1 by Formula “(Cmd*256)+256”.
    What ever I did allways I get:
    2018-12-18 20:53:32 Command to the Device 10 “Bufor_4_chanel”, type: KpModbus, address: 4
    Command “Chanel_1_cmd”
    Send (8): 04 06 00 01 00 01 19 9F
    Receive (5/5): 04 06 00 01 00
    Receive (3/3): 01 19 9F
    what mean it sending 1 instead 512(calculated formula)?

    Can You help with it,please?


    Hi Again
    OK. I found something.
    It not working when I send command from communicator.
    When I created table with commands formulas started convert values as it should.

    Question, what it difference when I send command from Communicator and WebInterface?
    In Communicator I send Standard command?



    When you send a command from Webstation, it goes to Server and can be modified by formula. Server passes the command to Communicator. When you send a command from Communicator, there is no calculations.

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