Forum Home › Forums › Understanding the Software › Map code
Tagged: Map
- This topic has 15 replies, 2 voices, and was last updated 1 year, 4 months ago by Mikhail.
-
AuthorPosts
-
November 24, 2022 at 1:12 am #11676dannytanParticipant
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.
November 24, 2022 at 2:57 am #11678dannytanParticipantI 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
November 24, 2022 at 3:07 am #11679dannytanParticipantHi 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
November 24, 2022 at 9:10 am #11682MikhailModeratorHi,
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
November 24, 2022 at 9:11 am #11683MikhailModeratorProbably, 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 numberNovember 25, 2022 at 9:28 am #11686dannytanParticipantHi 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/98331dNovember 25, 2022 at 11:02 am #11687MikhailModeratorHi,
Unfortunately, wetransfer.com does not work in Russia, so I can’t check the file.
Please upload the file to another file hosting.November 28, 2022 at 2:49 am #11689dannytanParticipantHi 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”Thanks
November 28, 2022 at 3:05 am #11690dannytanParticipantHi 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 greyHow to turn the map pin to green if >0 and turns red if 0”
Thanks
November 28, 2022 at 8:54 am #11691MikhailModeratorHi,
How to turn the map pin to green if >0 and turns red if 0”
Use a channel formula mentioned above or similar.
November 29, 2022 at 1:06 am #11693dannytanParticipantHi Mikhail,
Yeah i understand, problem is that what is the input so that the pin is red? or grey or blue?
Thanks
November 29, 2022 at 9:58 am #11696MikhailModeratorHi,
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.
December 7, 2022 at 5:52 am #11727dannytanParticipantHi 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.
December 7, 2022 at 10:24 am #11730MikhailModeratorHi,
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.December 9, 2022 at 6:43 am #11740dannytanParticipantHi 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 REDQuestion 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
-
AuthorPosts
- You must be logged in to reply to this topic.