Send Setpoint value (float number)

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

This topic contains 14 replies, has 5 voices, and was last updated by Mikhail Mikhail 2 months ago.

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

    trauden
    Participant

    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.
    https://photos.app.goo.gl/nkdT9QJJJywbMaUy1

    #2400

    manjey73
    Participant

    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.

    #2402
    Mikhail
    Mikhail
    Moderator

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

    #2405

    trauden
    Participant

    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?

    #2406

    manjey73
    Participant

    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 1 year, 7 months ago by  manjey73.
    #2408

    trauden
    Participant

    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.

    #2418
    Mikhail
    Mikhail
    Moderator

    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.

    #2419
    Mikhail
    Mikhail
    Moderator

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

    #2420

    trauden
    Participant

    Thank so much Mikhail.

    #3868

    tom040264
    Participant

    Hi,

    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

    T.

    #3878
    Mikhail
    Mikhail
    Moderator

    In the log file there is no trace from the command

    Hi,
    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.

    #3879
    Mikhail
    Mikhail
    Moderator

    The command has been sent successfully

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

    #4750

    MarCus0
    Participant

    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
    OK!
    what mean it sending 1 instead 512(calculated formula)?
    SCADA-Admin

    Can You help with it,please?

    #4751

    MarCus0
    Participant

    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?

    Regards

    #4754
    Mikhail
    Mikhail
    Moderator

    Hi,
    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.