Map code

Tagged: 

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #11676
    dannytan
    Participant

    I have 2 questions regarding the map.

    I have already put my input from my modbus (decimal) into 101 channel.

    Now i would like to show

    Status : Normal if 1; Fire 1 if 2 ; Fire 2 if 3

    How can i write this function inside the map

    Second questions,

    I would like to put my map’s pin became green if Normal (1) and Red (if not 1)

    Thanks

    • This topic was modified 1 year, 5 months ago by dannytan.
    #11678
    dannytan
    Participant

    I make a new unit called State (ID 38) Normal;Fire1;Fire2
    No matter what decimal i got from the input (0,1 or 2); the state stucked on Normal state.

    Thanks

    #11679
    dannytan
    Participant

    Hi again,

    The first question settled ; i have changed input into enum text, everything is fine now. Can you help me with the color state of the pin on the map plugin ?

    Thanks

    #11682
    Mikhail
    Moderator

    Hi,

    According to the manual: “0 – channel not specified; positive channel value means the location is normal, otherwise the location needs attention”.
    So channel formula might be: Cnl <= 1 ? 1 : -1

    #11683
    Mikhail
    Moderator

    Probably, you should create a new channel of the calculated type with the formula
    Val(101) <= 1 ? 1 : -1; Stat(101)
    where 101 is the source channel number

    #11686
    dannytan
    Participant

    Hi Mikhail,

    Thanks for your promp reply. I checked .map file. But it doesnt specify on how to associate my chanel input into the pin on the map.
    I would like my 101 input to be associate with the map pin and show let say green on 0 and red on 1 . How am i supposed to do it?
    https://wetransfer.com/downloads/b6a93d6b165f9e061f15618f6bbb84b320221125092743/94674ccc32b4f7537b413c7a48d12e3520221125092803/98331d

    #11687
    Mikhail
    Moderator

    Hi,
    Unfortunately, wetransfer.com does not work in Russia, so I can’t check the file.
    Please upload the file to another file hosting.

    #11689
    dannytan
    Participant

    Hi Mikhail,

    I know the problem now, it is on <StatusCnlNum>, problem is that if my decimal input = 0 ; My map pin turns green and if it is positive ; my pin turns grey

    How to turn the map pin to green if >0 and turns red if 0

    Secondly,

    For the link details as for now <link viewID = “2”/>
    How to change this link into my power BI link? let say “https://powerbi.com&#8221;

    Thanks

    #11690
    dannytan
    Participant

    Hi Mikhail,

    Sorry again, i have found the solution by simply copy paste the website link into the interface and it works.

    Now , my question will be
    “problem is that if my decimal input = 0 ; My map pin turns green and if it is positive ; my pin turns grey

    How to turn the map pin to green if >0 and turns red if 0”

    Thanks

    #11691
    Mikhail
    Moderator

    Hi,

    How to turn the map pin to green if >0 and turns red if 0”

    Use a channel formula mentioned above or similar.

    #11693
    dannytan
    Participant

    Hi Mikhail,

    Yeah i understand, problem is that what is the input so that the pin is red? or grey or blue?

    Thanks

    #11696
    Mikhail
    Moderator

    Hi,

    what is the input so that the pin is red?

    It should be a channel that displays location status. For example, some tag of a device mounted on the site.

    #11727
    dannytan
    Participant

    Hi Mikhail,

    Sorry i am having difficulty in this map.
    So my input channels is 125 with signal 25 (from modbus with value of 0)

    I make another input 101 with channel type real ; object enterprise; device state ; signal (blank) ; formula used (check) ; Formula Val (125) <=1 ? 1 : -1 ; Stat (125)

    Then in .map file i put “<StatusCnlNum> 101 </StatusCnlNum>”

    The pin won’t turn red.

    I want the map pin to turn red if 125 with signal 25 (modbus is 0) , green (otherwise).

    Thanks a lot.

    #11730
    Mikhail
    Moderator

    Hi,
    Before binding the channels to a map, I suggest to display the channels on a table view to check their values.
    Please provide screenshots of the channel properties and a screenshot of a table view containing channel values.

    #11740
    dannytan
    Participant

    Hi Mikhail,

    It works now with this Cnl <= 1 ? 1 : -1
    So my channel input is 101 (with data value of 0) , when i put this formula, it became 1 and pin map turns RED

    Question now is how to make the pin map turns green if data value is bigger than 0?

    I wrote a formula in my dictionaries

    ID 11 :
    if (Cnl<1)
    { return 1; }
    else
    {return 0;}

    Another question is how to put this formula ID into my formula table in the input channels?

    Thanks

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