After spending 2 days on this, looking at the scripting demo, figuring out how to dig into the objects provided in WebIQ designer, and trying a ton of different methods I am condifent when I say the itemManager does not contain a method that will do what I need. The function I am after comes down to being able to monitor an external data source for a value change. I am defining "item2" as a integer, I have gone as far as making sure I can define it as such in the UI properties (learned a lot there, pretty cool how I can manipulate the WebIQ UI), I have defined the type in my JS and I even considered doing it in my json but I don't think that would matter. There is no problem in interacting with external values as Integers at the UI level, my button press and release work exactly how I want them to. I am not saying I cannot read tag values at all, I just can't seem to do so in inside the js. The issue is that internal to the js code, there is no way to access the .value of an item and read that as an integer. I can subscribe to "item" in my code, and I can console output the name of "item" with just "self.config.item". The result of this is the TAG or PLC address I have assinged to this property in WebIQ. If I try to access any other property of that item inside my code the console output is "undefined". it does not matter what I try to access, the value, the name, anything, it's "undefined". so again, there is not a method in itemManager that allows this interaction. But then I go back to the fact that I can use .SetValue to write a value to my external tag based on a press and release action; it seems odd that this is able to get the data to the property of the Item it needs to with no additional information. And, ok, .setValue works so based on my reading the common opposite of that would be .getValue. NOPE, not a support function/method. So, there is some magic going on in the background becuase we can infact manipulate the value of an item in some manner. Another example is the iq-input-field, which I pulled some useful code from; this widget updates it's displayed value live, but i cannot find anything in it's js that does this. Magic... Now, I don't actually need to know the Value inside my code, i just need to know that the value changed. But again there does not appear to be any methods for this operation. .onChange, .onValue, .valueChange. nothing in the common venacular that I can find online works. Furthermore, I have scowered the supplied documentation in WebIQ Visual and there is absolutly NO discussion of any such similar behaviors; at least not that i can find. I am 3 weeks into this and honeslty, this should have been a functional widget last friday; everything since then has been focused on this one behavior I am after. Trigger an svg change based of the value of a external tag. and i cannot sit here and believe that I am the only who has or will want to do. to be prefectly honest, i don't understand why this does not already exist on the standard widgets. Why? We use this behavior now as a diagnostic (not to mention that FacotyrTalk View studio has been able to do this since the days it was called RSview), we do not condition our indicators from the HMI itself, we condition them from the PLC and ONLY if the required logic completes. We are an OEM and we have found this to be a huge benefit for anyone trying to diagnose a problem. "the arm didn't move" "when you pushed the button, did it light up?" "Uh, no..." "then the logic never functioned, there is a condition not met." SO, Either my lack of knowledge in this area is preventing me from finding the methods I need to complete the task I am after.... not unlikely. OR. The itemManager API, supplied by smart-HMI, does not contain common methods that Bing and ChatGTP are both confused about not being present. and yes, I am using AI to work through this. I have accomplished more in the last 3 weeks using AI to check code and provide alternatives than using anything in this forum has. That is not to say that this forum is not helpful, but the benefit to a non-human interaction is the speed at which it can provide answers. Way Faster than any Forum ever could. There is no way i could have accomplished much as a i have with this project without the use of AI. That does not mean I said "write me code for this" though i have purposed concepts to it to see if the code was helpful in anyway (most wasn't). No, for the most part i have used it as a validator that I can talk to directly to explain the task i am trying to accomplish. Anyways. How do I read the properties of an Item and how can I monitor an item for a value change? Is there another API I can use? Can i add to this one? ( that sounds terrifying) I am again including my project. I am going to take the rest of the week to step away from this as it has consumed me, but i will check responses here. Line 231 will error when compling becuase the method .onValueChange is invalid.
... View more