manjey73

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 534 total)
  • Author
    Posts
  • in reply to: Convert decimal to hexadecimal from web browser #13155
    manjey73
    Participant

    It seems there were publications on the Russian forum. As far as I understand, there is a difficulty only in transferring the database

    in reply to: Convert decimal to hexadecimal from web browser #13153
    manjey73
    Participant

    Tip: upgrade to version 6, it is somewhat more flexible

    in reply to: Convert decimal to hexadecimal from web browser #13152
    manjey73
    Participant

    On the 5th version, there is no channel display as a HEX number, as in the 6th version. Most likely only using ASCII String with the corresponding transformations using formulas.

    in reply to: Convert decimal to hexadecimal from web browser #13149
    manjey73
    Participant

    Then you probably need a trigger to change the channel and specify “Send command” in the command.

    And if necessary, use the formula in the command to check the value for the range 0-100 and, if it goes beyond the range, return Double.NaN to cancel the command

    in reply to: Convert decimal to hexadecimal from web browser #13147
    manjey73
    Participant

    Trigger parameters check Value. Edit Value = 15
    Command Value = 15

    in reply to: Convert decimal to hexadecimal from web browser #13144
    manjey73
    Participant
    public byte[] NewFreq1()
    {
    string tes = Encoding.UTF8.GetString(CmdData);
    uint teu = uint.Parse(tes)*100;
    byte[] teb = BitConverter.GetBytes(teu);
    return new byte[] { 0x00, 0x01, teb[1], teb[0]};
    }

    We use the Binary command type and enter 30 and so on in string mode (not Hex)

    in reply to: Convert decimal to hexadecimal from web browser #13141
    manjey73
    Participant

    test

    test script

    public byte[] NewFreq1()
    {
    return new byte[] { 0x00, 0x01, CmdData[0], CmdData[1]};
    }

    Using string input, with the Binary command type, you can accurately convert the entered digits to uint and add them to the block of data being sent.

    • This reply was modified 8 months, 3 weeks ago by manjey73.
    • This reply was modified 8 months, 3 weeks ago by manjey73.
    in reply to: Convert decimal to hexadecimal from web browser #13140
    manjey73
    Participant

    So it’s strange to me that when sending a Cmd command, it is a double, and in theory, returning a double formed from the required bytes, we should send something other than say 30, which we enter. But for some reason nothing happens.

    However, if we use Binary, we can send anything in a byte array, but then we need to somehow convert the received value first into a string, then again into the required bytes, etc.

    I don’t know if it is available for formulas in the 5th version of the ScadaUtils function to do this.
    Via string here (not Hex) I haven’t tried it yet, there you can use the language to form an array according to the idea.

    in reply to: Convert decimal to hexadecimal from web browser #13138
    manjey73
    Participant

    The formula does not cause an error on the 5th version, but always sends 0 for some reason

    in reply to: Convert decimal to hexadecimal from web browser #13137
    manjey73
    Participant
    public double NewFreq()
    {
    byte[] freq = BitConverter.GetBytes((uint)Cmd*100);
    byte[] res = new byte[] { 0x00, 0x01, freq[1], freq[0], 0x00, 0x00, 0x00, 0x00 };
    return BitConverter.ToDouble(res, 0);
    }

    Return the command type to Standard and try the following formula

    It may be necessary to play with the location of bytes in the array

    byte[] res = new byte[] {0x00, 0x00, 0x00, 0x00, 0x00, 0x01, freq[1], freq[0] };
    But in theory, the first option in the formula should work

    in reply to: Convert decimal to hexadecimal from web browser #13123
    manjey73
    Participant

    You would change version 5 to version 6, some things are much simpler there

    If I’m not mistaken, on the 5th version in Binary mode, when entering HEX, a byte array is returned, and this should be taken into account in the formula.

    in reply to: Convert decimal to hexadecimal from web browser #13118
    manjey73
    Participant

    When entering the value 30 in binary form, it is entered as a string and BitConverter cannot be applied here.

    in reply to: Convert decimal to hexadecimal from web browser #13117
    manjey73
    Participant

    For the 5th version, the formula is likely to be different, since you are forced to enter a HEX value.

    The 6th version is somewhat more flexible in terms of formula implementations

    in reply to: Convert decimal to hexadecimal from web browser #13112
    manjey73
    Participant

    Oops, do you have Scada version 5? I don’t know if it’s possible to do this on the 5th version, I haven’t tried it before.

    in reply to: Convert decimal to hexadecimal from web browser #13110
    manjey73
    Participant

    Mikhail, a person wants to drive just a frequency number, but at the same time he needs a command to be added to the byte array that allows changing this frequency. The formula that I have given is working, it is simply necessary to provide a command in the device template to get it. We did this with recording time in several registers.

Viewing 15 posts - 31 through 45 (of 534 total)