Guys, I'm struggling here. First job with Ignition, potentially more to come, but it just falls flat on it's face with animation which is big in the industry I'm in.
I have a coil (red circle) as it grows, I want the line to follow it.
I've already written my own python routine to normalize data coming in and scaling it to pixels. (Feature request btw, every other HMI lets you set the range on an animation)
I have created custom properties that scale my coil diameter and translate it to the line. It adjusts x, y, height, width, and angle.
Y, actually does not need adjusted. All my math seems to check out. If I enter my max diameter, my red circle grows to it's max, and the line, IF it would stay in the proper position in the Y, would actually work. Instead I get this
Mind you, my Y position, is actually tied to a custom property which is giving me the value the line needs to be at
StripYPos is calculated to be 405, which is what Y SHOULD be displaying. Instead Its at 430
It just gets ignored by Vision.
Any ideas? Customer isn't going to be happy if we can't figure this one out.
Instead of trying to manually align lines (which is only going to end in frustration), considering using a Paintable Canvas component to draw your lines, circles, etc:
This is basically your best bet in terms of animation specifically within Vision.
What is happening to the y position as the diameter approaches max? Does it look ok all the way up until the max is reached, and then suddenly jumps down to the wrong spot?
This is what I ended up doing:
Inside the coil template I calculate the difference between the max coil diameter and the current coil diameter whenever the diameter changes. I added a custom property to the floating line to define its default height, which is the height of the line when the coil is at its max size. Then I linked the height of the floating line to that difference variable from the coil template. The link runs an expression where I set the floating line height = (the default height + the coil difference) / 2
We don't allow resolution changes and I should not have to manually draw simple things like this. Might as well use a real HMI at that point, or visual studio for that matter.
This is a valid point. I too get frustrated with shapes sometimes because their x, y, width, and height are all zero and getting their relative bounds to play nice with conventional components can get convoluted. It would be awesome if we could get both absolute and relative bounds on the shape components, even if the absolute bounds were not bindable.
That said, my favorite component, by a lor, is the paintable canvas. I love using them as glass panes to add unlimited functionality to any window, and while I have no doubt that what you've done works fine, I can say that I wouldn't hesitate to use a canvas for something like this instead of dynamic shapes.
I don't have the project in front of me but, basically, i setup custom properties in the base of the page that computed the numbers i needed for x, y, height, width. Then tied those expressions to my objects.
I also had python scripts that would scale from physical numbers to screen pixels and the proper ratio.
It was alot of work to be honest. Something that normally took me about a minute in other HMI's turned into a whole project in itself. Then I had to show the customer why so many hours were spent and yeah. Nobody was happy.
Unfortunately given the nature of ignition, its communications, and having to constantly compute these numbers, updates were painfully slow compared to FactoryTalk, Citect, Wonderware, etc...There was some noticeable lag, even after getting support involved.