EncodeAscii

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9066
    Jure
    Participant

    I would like to encode value to ASCII. I know that for 2 values you can use EncodeAscii(Val(1) < 1 ? “Off” : “On”). How could I do this for 3 values?

    #9070
    manjey73
    Participant

    A formula in the reference list with an enumeration for example

    #9071
    Mikhail
    Moderator

    Please explain why do you need it? May be we can find the better solution.

    #9076
    Jure
    Participant

    Variable can represent 3 different strings:
    0=OFF 1=TČ 2=zemlja

    #9077
    Jure
    Participant

    I made formula:
    String M8ToString(double val)
    {
    if(val == 0.0)return “OFF”;
    if(val == 1.0)return “TČ”;
    if(val == 2.0)return “zemlja”;
    return “error”;
    }

    Then in input channels I called it like this:
    M8ToString(Cnl)

    but it is still display basic value 0,1,2.

    #9079
    Mikhail
    Moderator

    You should add strings into a unit table. See “Off-On” for example. String conversion is not needed.

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