>>Message imported from previous forum - Category:Scripts and Tips<< User: mchartrand, originally posted: 2018-10-25 18:47:33 Id:271 This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.
**_tresleiv: Is there a way to use indirect addressing by eg. point to a parameter string (or similar) from mimic expression where the parameter string contains the path of the actual point and returns current value of this point?_**
AWoodland: Yes, use indirect variables. Check the help but make sure you understand the details in the help on the performance impact of indirect variables.
What are you trying to do? There may be better, simpler and more efficient ways to do whatever you're trying to achieve. For example passing parameters into the mimic.
**_tresleiv: We are trying to access a common parameter outside the template. This parameter is used widely internal in the template and it generates a lot of work if the name or path for the mentioned parameter changes. It is therfore much more convenient for us to use indirect adressing as we only have one point to change instead of editing 10 mimic expressions in the template. Do you have an example code for an indirect addressing in mimic expression where it returns the actual value of target. You mentioned something about passing parameters into the mimic, can you please elaborate? Once again, thanks!_**
AWoodland: The help in ViewX will explain how to use parameters, and provide a number of examples, as it is basic mimic functionality. If you attend a mimic training course they'll also go through how to use them.
Even if you 'hardcode' the reference to the object outside the mimic it should still update if you move or rename it. It sounds like you're basically trying to create an object (I assume in a static location) to reference a potentially dynamic location for the template to then reference. If so you're making this much more complex than you need and the database should handle any changes to the referenced object for you (different if you delete and add as the link is lost).
You might also look at using formulas in property overrides in your templates, that may also achieve what you may be trying to do.
The easiest way to achieve this by using logic (ST, FBD, etc.)
Sometimes I use function block (Create New Logic Function Block Diagram) to do this.
So first assume you have physical / generic analog point, then you can create internal analog point (Create New Internal Analog Point).
You only need to drag this two points and put that on the Direct tag of FBD, then you drag the generic analog point as input variabel, internal analog point as output variable, and last just connect them with line. That will do the trick.
If you want the point to be fast updated, just change the execution interval like less than 0.5S (500 miliseconds)