• I
    iperry

    Hi Phil,

    I increased the default cache size to 6 as you suggested and the data points appear to be all created. Thanks! I will continue to monitor the data for any issues.

    @phildunlap said in Inconsistent values between MQTT and meta points:

    It could perhaps be solved by a faster machine

    This Mango instance is currently running on a 2 core Linode VM so I don't believe that the machine is really a factor here. Perhaps the amount of memory could be increased but the VM looks to be running ok. I will likely review the amount of memory needed once I implement the default cache change on all the necessary points.

    As an aside: as above, I am currently passing only the value I need to the global function, instead of the entire point (or context). Is there any downside to passing the whole object to the function and let it get the data it needs? Is there a preferred pattern to use?

    i.e. return calcTemperatureWithOffset('L1-CS02-02', p3452, 0);

    I am thinking ideally that since I have to update the function call to all the necessary points, passing the object would be better. Then any future changes would be limited to only the global function.

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi @phildunlap

    The solution you proposed works... most of the time. After I implemented the solution, the data was changing as I expected over the hour time period:
    0_1562193334677_754c5ee0-2f20-42dd-9342-fb5de077ec08-image.png

    However, as I continued to monitor the data, I was seeing gaps:
    0_1562193421306_221dce86-339c-4c5c-99b1-afbae3677693-image.png

    The gaps appear to match errors that I was seeing in the events table:
    0_1562193541388_2f3b421c-11f5-4c61-9604-a252bf3fa460-image.png

    Global function call in meta point:
    return calcTemperatureWithOffset('L1-CS02-02', p3452.pointValueAt(CONTEXT.getTimestamp(), true).doubleValue, 0);

    It seems like the context is not available when (sometimes) the function is called? It is odd/interesting that the correct value is returned most of the time.

    Any ideas?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi @MattFox

    1. Which point values are you referring to? The meta point values? They should be updated when the MQTT point changes, which in this case is 6 time in < 1 sec.
    2. Correct, the updates to the MQTT topics (and thus the MQTT points) occur within a span of a few milliseconds.
    3. Not quite (I think). To me it seems that the meta data point is not updating fast enough in response to its context point (the MQTT point). The meta point should be updating 6 times < 1 sec like the MQTT point.

    I noticed something in your response. Is there a difference between?
    return calcTemperature...
    versus
    myPoint.set(calcTemperature...)

    To me its odd/interesting that the timestamp of the meta point values are consistent with the MQTT point but the value isn't. To me this would seem the meta point is changing sorta right? heh

    Is there maybe a synchronization issue with using the global function?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi @Jared-Wiltshire

    I don't doubt that the removal has not been a secret but it was the first time I had seen that statement in a posting. It is great that the UI is improving.

    There is nothing that prevents me from using the new UI. When I started using Mango, I think I found the old user more concise and seemed to provide more information at a view. Since then, it has just been habit to use it. I like the white background when using applications as opposed to the black/grey of the newer layouts (not just Mango) but that is just my preference.

    I will be making a more cognizant effort to use the new UI.

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Heh good to know the legacy pages will be removed. I have been using them much more than the newer UI. This might be something to make a more "loud" announcement about so we can adjust a head of time. ;)

    posted in User help read more
  • I
    iperry

    Heya,

    Mango version: 3.5.6

    I am trying to resolve an issue with differences between values recorded by a MQTT data point and its associated meta data point.

    Data flow:

    • Device transmits messages on an hourly basis, which contains sensor values for each 10 minute interval during that previous hour (thus 6 packets of values)
    • MQTT service receives these messages, parses them, and posts the values to the topics. The date/time for each packet is set to the appropriate 10 minute interval it occurred on. All 6 values are published to the topic in < 1 sec
    • (Mango) MQTT client receives these changes to the topic. The meta point is changed based on the context change

    The values recorded by the MQTT data point are:
    0_1561575146595_f592f382-b79b-489c-9031-2441c9e70030-image.png

    The value recorded by the meta data point are:
    0_1561575174176_b57c4e4f-b8b0-4f3f-9943-86ccb74e3dff-image.png

    The pattern is interesting: the first and last values in the hour are consistent. The middle 4 values are the same as the last value.

    The meta point currently calls a global function to process the raw value. However, for this value (temperature), no manipulation is occurring. The same value should be returned by the meta point.

    0_1561575567638_e2ac7d37-c324-4419-880b-0aad92dfc971-image.png

    The logging properties of the meta point is when timestamp changes.

    My belief is there is a timing issue as maybe the rapid changes to the topic are occurring too quickly. I have been using this process for other projects successfully but the updates to the topics have been > 30 secs.

    Are there considerations I need to make if changes to a data point occur at millisecond frequency? Any insights would be great.

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi Phil,

    Ahhh thanks! I figured it most have been something I missed.

    Setting "Script data point read permission" to "superadmin" worked!

    The /facepalm for me was that I was sure I had it working correctly before. I had created a script to create the handlers as they were going to be applied to a large number of data points (and event detectors). Likely I had missed this value in the script which has lead to some frustration. Whopps.

    This is the current version of Mango (3.5x).

    I haven't upgraded to the beta version yet as I usually shy away from these versions. ;) I also am trying to keep my version consistent with a few trials we have in progress until I can upgrade them all.

    Thanks again,
    Ian

    posted in User help read more
  • I
    iperry

    Heya,

    I am having some issues/confusion regarding the resources that are available in an (email) event handler.

    I have a test script data source that retrieves the point hierarchy and list of data points and prints their length:
    0_1558724609581_1afb94b6-18cd-43fa-baef-ceffde00e7c8-image.png

    When I copy the same code to an event handler script, the lengths are 0 (or undefined):
    0_1558724802490_e747b8b6-05ce-4205-9044-840408e422c9-image.png

    Is the configuration and data point query not available in the event handler?

    Aside: it's sometimes a challenge that the logging behaviour is not the same between a data source and event scripting. Unless logging is turned on in a data source script, log statements will not be displayed when validating the script. However, they will be displayed when validating an event handler script. This is kinda understandable considering there is no explicit switch for logging in the handler (which would be nice to have).

    This there something I am missing?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi @phildunlap

    Ahh, ok makes sense that meta point cannot trigger its own execution to avoid loops. I guess the way I read the overview in the pop-up help lead me to think that.

    Hitting the refresh button on a meta point triggers a script execution.

    Where is this button? This might have potential.

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Heya,

    I am trying to create a meta data point so that once the user updates its value, a script is executed to update other points. According to the point details help, I should be able to add itself to the context once the point has been initially saved.

    0_1558033082192_8559359a-d95a-45f2-b931-f64d42c449b1-image.png

    Once the point has been created and saved, I see the point in the script context droplist but when I try to select it, nothing happens. I can add other points without issue but not the current point. I have refreshed the data sources page just in case but that didn't help. I thought the point needed to be enabled but that didn't help.

    I'm I missing something?

    Thanks
    Ian

    PS: the help window is a bit out-of-date as it refers to clicking a plus sign to add a point to the context.

    posted in User help read more
  • I
    iperry

    Hi @MattFox,

    Still here chugging along. Got about 3 different streams of development going for stuff, which seem to merge at times. heh

    Thanks for the clarification. After reading Jared's posting and bit of testing, it looks like I had been setting them incorrectly. It wasn't until I tried to use the variable name that I realized the issue. Whopps. At least updating the existing meta points I have isn't that big of a hassle, i.e. export > text replace > import.

    In the end the point data wasn't going to help me as I was hoping to get its hierarchical info. Guess I will need to query for that data.

    (The intention was if the setpoint associated to the alarm was set to -1, get the setpoint of the group it's in instead)

    Thanks again,
    Ian

    posted in User help read more
  • I
    iperry

    Heya,

    Can you clarify the use of the "variable name" on a meta data point please? Is the use of it limited to the context of the point?

    https://forum.infiniteautomation.com/topic/3033/using-json-store-for-data-point-tagging-can-it-be-done

    I reread Jared's posting (as I planned to use metadata of the meta point itself) and it dawned on me that I may have been setting it with a "bad" name. I had thought the variable name should be unique and had been using the same as the point name, i.e. name/variable name = "Temp 1 High Alarm".

    Is there any reason to change the default value of "my" for the variable name? Is there a naming convention I should use, i.e. camel case?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Heya,

    I have a modal pop-up which displays the latest data for a sensor (in this case temperature) but when there is no data, points are manufactured for the first and last dates in the range.

    0_1555540640661_ed5d4a99-3fae-405b-a97b-04523d43fcf4-image.png

    Is there a way to configure the chart to be empty if there is no data in the selected range?

    Note: I had thought this had been inquired about in another topic but could not find it to reference.

    My work-around is to have ng-if="pointsTemp.length > 2" in ma-serial-chart tag. I have a span which displays "No data in the selected range" if <= 2.

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Heya,

    I am trying to determine the necessity for a property template on a Mango Persistent TCP data point. I noticed that when I export the json for a persistent point, there is no element for the template id. Other point types will at least have this element set to an empty string if not defined.

    The lack of the template id element would lead me to believe that the property template is not required. The data history will be the same as the point to which it is linked; the logging type of "All Data" will ensure this.

    Is this correct?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Thanks Matt, Phil... I will check out the swagger API interface. I will dive into the SQL queries too as I haven't looked at how the data is organized/stored yet.

    posted in User help read more
  • I
    iperry

    Heya,

    I am starting to build up a long list of property templates that I have made and now I am looking to delete some of the obsolete templates. Is there any facility for deleting templates? I have poked around the app and have yet been able to find any method for deleting templates.

    Is there a way to delete elements (templates, points, data sources, etc) using JsonEmport that I may have missed?

    Thanks
    Ian

    posted in User help read more
  • I
    iperry

    Hi Phil,

    I am hoping I am missing something very basic here. When I try to log the message string from evt, I still get an exception that the object is not defined.

    LOG.info(evt.getMessageString());

    return CANCEL;

    Failure: ReferenceError: "evt" is not defined in <eval> at line number 2 in <eval> at line number 2

    I had tried using evt before as I saw it being referenced in the ftl markup (and pop-up help) and appeared to be set to the model in EmailHandlerRT but had no success then.

    It appears that the evt object is available in the model (and thus the ftl) but not to the script.

    Thanks
    Ian

    posted in Scripting general Discussion read more
  • I
    iperry

    Hi Phil,

    I decided to use the data point id at this time as it was easy to use and meant I didn't need to construct my own unique id process. I tend to avoid using internal id values like that for external references but it works well enough for now.

    My process currently creates points for a "device" which includes 9 MQTT, 4 virtual and 12 meta points. I have created a basic template for each of the 3 types of points, which the process then populates based on the a list of points required. Works quite nicely.

    Now that I am trying to connect the process to email event handler (or set point handler) I am stuck with a simple problem: what is the correct event object? My handler script is:

    LOG.info('Unknown topic handler executed...');
    topicTest(event.getMessage());

    return CANCEL;

    Where topicTest is a global function that logs the message.

    If I validate the script, the log messages appear in the page.
    Success, email sending cancelled
    INFO 2019-03-12 14:55:11,950 - Unknown topic handler executed...
    INFO 2019-03-12 14:55:11,952 - Unknown topic received from MQTT server:Test

    When I trigger the handler for the first time, I get an error in the log that "event" is not defined. Any further triggers of the handler appear to be ok (the original warning message is logged).

    However, I only see the original warning in the ma.log file but not the 2 info messages. Is there something else I need to do?

    Thanks
    Ian

    posted in Scripting general Discussion read more
  • I
    iperry

    Hi Phil,

    I am circling back to this task and have been successful in creating MQTT and virtual data points. Creating meta data points doesn't seem to be that much different but I am stuck on how to set the var(iable) names for context points.

    I see that when I create meta points with context via the UI, the variable name will be automatically populated, such as "p500". How/where is this var name determined? When I create multiple meta points using the same data point in context, the same var name is used so I figured it must be maintained somewhere. However, I have yet been able to find the method that constructs it. I figure I could use my own var names but ideally I would like to use existing methods for creating/using these names for consistency.

    Any suggestions would be great.

    Thanks
    Ian

    posted in Scripting general Discussion read more
  • I
    iperry

    Whew! Glad that you were able to reproduce it. heh

    Edit: I see that having the space after the "<" prevents the chopping. Very odd... As I mentioned above, I have only seen this behaviour in the scripting data source editor.

    posted in User help read more