Is it possible to display the hexadecimal characters of the input value?

Forum Home Forums Understanding the Software Using Formulas Is it possible to display the hexadecimal characters of the input value?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12819
    myscada
    Participant

    I’m using V5.8.4. I have defined an array of characters in the formula (like ‘fixed char buffer[3];’), but got an error “CS0214: Pointers and fixed size buffers may only be used in an unsafe context”.

    • This topic was modified 1 year, 4 months ago by myscada.
    #12821
    myscada
    Participant

    The following formular doesn’t work.

    public double HextoASCII(double decimal)
    {
      string test;
      test = String.Format("{0:X}", decimal);
      return ScadaUtils.EncodeAscii(test);
    }
    • This reply was modified 1 year, 4 months ago by myscada.
    #12823
    myscada
    Participant

    it works now.

    test = String.Format("{0:X}", (int)decimal);

    • This reply was modified 1 year, 4 months ago by myscada.
    #12827
    Mikhail
    Moderator

    Thank you for the info.
    Decimal is a data type in C#. I suggest using another variable name.

    #12830
    myscada
    Participant

    THX. I got the same error when uploading configuration.

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