In this video we cover many of the most common ways to animate objects in Ignition!
Ignition is an incredibly powerful and popular SCADA software with tons of cool features, and one of the most common things you want to do is animate objects using tags!
TIMESTAMPS: 00:00 Introduction and Background 00:51 Boolean Color and Visibility Animations in Ignition! 07:13 Changing Text and Label Animations in Ignition 11:45 PCBWay Sponsorship 12:24 Adding Custom Tag Properties for Ignition Animations 15:52 Enumeration Animations for Text Transforms in Ignition 20:39 Outro and Thank you!
hello and welcome back to the Master
Tech and in today's video I'm going to
walk you through animations in the skada
software called Ignition we're going to
cover several types of animations you
can do including Boolean color and
visibility transforms text transforms
including color text strings and
integers and then enumeration as well
where you can take integer values and do
text based transforms with it so this is
many of the most common types of
animations you'd need to do an ignition
and then more importantly it'll show you
how tag bindings and animations work so
that you can go and build whatever sorts
of animations you need into your
[Music]
projects all right so we are going to
try to cover a lot of content in this
video so let's dive right into it to
start let's go ahead and make a new tag
called a memory tag because I don't have
a PLC hooked up right now I'm doing that
just to show you that this doesn't
really matter what platform you're using
as soon as you get a tag to ignition
they're all kind of the same so I'm just
going to make a Boolean tag and call it
color Bo to start all right now I'm
going to go to the prospective
components window and I'm going to grab
an icon um this is just something
ignition includes they have a number of
icons uh that you can kind of Select and
play around with and actually I'm going
to make two one to act sort of as a
button for us so I'm going to go to the
path and I'm going to type in button and
I'm just going to grab this one that
looks like a button and then the second
one is what we're actually going to
animate okay so I'm going to write a
very basic script here with you um that
is going to uh I'm going to go to the
icon that's our button I'm going to go
to configure events Mouse events onclick
plus add a script and what I'm going to
do is I'm going to read the Tag system.
tag. Read blocking
and then I'm going to read the value of
that tag do value there we go and then
if my value is high I'm going to
basically write uh to that tag so
system.
tag. WR blocking there we go and then
the same tag path contrl C and what
we're checking here is if it's high we
want to write false and then else would
be it's low so in that case we will
write
true all right and honestly that tag
path had to be typed out three times
should probably put that in a variable
but we're not here to optimize my
scripting abilities we're here to make
sure that this tag um works for toggling
so I'm going to go ahead and quickly
just go into this uh run mode and I can
see that it's toggling in the lower
window all right now let's talk about
the actual animation that is the subject
of the video I'm going to copy that tag
path preemptively because I know we want
it and I'm going to go to the
prospective property editor window by
default it's usually tabbed in the right
when you open up the designer um but if
you go to views and panels and toolbars
you have a lot of configurability over
that and you just need the prospective
property editor uh toolbar active Okay
so in props you can see color is already
there but if it wasn't there you're
always able to add a property um and
then you can add in color if you need to
uh in this case it won't let me because
it would be a duplicate um but you
should have color already if you're
using the icons and then for binding
type we're going to go to tag we're
going to paste in that color Boolean and
now if we were to do just this right now
it's going to give us an error because
uh it can't convert true and false to a
different color so what we need to do is
hit this add transform button and we're
going to do a map and it should open up
this window for you and we're just going
to hit two pluses the input type is
going to be a value and specifically
it's going to either read true or false
and you can see in the bottom it's also
telling you what the tag is currently
reading which is nice and then the
output type we want you can see they
have a number of uh options but value
and color are by far the two most common
ones and so when it's true let's go
ahead and make it green and when it's
false let's make it red and then
fallback would be like like Hey we're
having an error like this is a Boolean
tag and we don't have true or false so
fallback will make this yellow just in
case there's an error okay and as soon
as I hit apply you can see that it goes
green now if I hit run and I click this
button you can see it turns red so the
button is changing color bu between zero
and one but then the animation on the
tag is reading that back and determining
which color it should go to all right so
color is one of the most common
animations you're going to want to do if
you're in a factory setting or in a home
setting it's a really easy way to
quickly tell you the stats of something
as either okay or not okay um so let's
go ahead and delete color and take a
look at what I think is kind of the next
most common one um which would be let's
take that same tag color Boolean and we
already have a button set up for it and
let's take a look at doing a visibility
animation so I'm going to use the I'm
going to use the same tag which is
colorb copy path um I'm going to use the
same tag but what's nice is because
visibility is a true or false you don't
actually need any expression or any
transform here if you want it to change
true and false with the tag so if I go
into uh run mode and I toggle the bit
you can see that second smiley face
appearing and disappearing on the
Boolean um again I know I went through
that one pretty quick but down in meta
there's this visible option you can
toggle it true or false just from the
designer but if you want it to be tied
to a tag you do it just like this um now
I know in the beginning I had like a sun
and a moon uh toggling back and forth so
it also kind of makes it look like it's
doing a transform if you have two icons
and that their visibility toggles uh
inversely of each other so let's do that
pretty
quick um I don't want to spend too much
of the tutorial looking for the Moon
icon but I found it quick last time
typing in Moon didn't work so um yeah
there we go there's one um so if I have
these copies and I have them both set to
visible then you do need a uh you do
need a transform to get you the opposite
and the easiest one is just add a script
transform and return not value that way
the output is going to be the opposite
of whatever Boolean you're reading so if
I hit apply now and I save to runtime
you can see my sun and my moon are
toggling as the color here toggles so
that's a basic animation um for
visibility and for color based on a
Boolean tag now let's go ahead and take
a look at two cool things which is
dynamically changing color and text
based on a non- Boolean condition so an
integer or a float um heck a string if
you really wanted to but I don't so
memory tag I'm going to call this one uh
color integer and then I'll start it out
as a zero and it'll be a memory tag um
now I'm going to go back to perspective
components and I'm going to grab a label
for this one uh I'm going to just drop
in a label here in the middle and so
that it's a little easier to see on the
tutorial come
on that was weird okay so it's a little
easier to see on the tutorial I am going
to just preemptively make the font size
uh pretty big and and then we're
actually going to mess with the font
size in a second um but I'll make it
what's big 32 yeah we'll start there
okay so it is basically just what we
already saw at a very basic point if I
copy the path of my integer and I go to
text now the text property of a label
and I go to tag for binding and then I
just drop in the color integer then I
hit okay it is that value and if I go
into this value and I write it to a 10
instead it immediately changes to a 10
so that is actually a basic style of
Animation um it's animating the text but
all you're really doing is uh you know
changing the text on a label you
probably found that one out with just
forums so let's look at something a
little more interesting which would be
like the color of the text changing with
that value as well right so let's say we
have the label and the color and I don't
know we'll make it red initially if if
we go into the same spot before that we
had that color animation and tag and we
drop in the same tag and we add a
transform and we go to map uh now what's
going to be kind of annoying is if you
go in here and you do value and you just
add a bunch and you make your output
color what's annoying is if you just do
mapping value to color then you would
have to go integer by integer or value
by value that that integer could be and
you have to choose what color you want
it to be so what's easier is this
numeric range option where we say okay
between 0 and
50 the level is good let's say so level
is going to be green between 50 and 75
let's say we're talking about
percentages on a on a tank um it's
getting too high so we maybe want to
make it yellow and then between
75 and 100 we are at high level so we're
going to make it red to warn people and
then the fallback will be like uh yeah
fallback will be black to basically say
like Hey we're getting unexpected values
here okay so with this numeric range to
color mapping I'm going to hit okay and
what you can see is it's green right now
because we're at that 0 to 50 range if I
go to 60 it turns yellow which is
actually not super easy to see because
the background color is white I spelled
background wrong
background color is white but if we make
it a dark gray I think all of these
colors will show up so 10 it's green
it's healthy yellow uh it's it's you
know hey you're getting up there and
then 80 there's red and let's say this
went to 105 it turns black uh because
the value is out of range so that's kind
of a cool way to take a look at doing um
Dynamic animation so I'm going to go
back I had pre-written a Gateway script
that was going to take that color
integer and just keep sending it up
until it hits 100 so that we can do um
some testing and I don't have to like
manually um I don't have to manually go
in and toggle uh come on Pete talking
right at the same time so I don't have
to manually go in and toggle that value
I can
just I can just automate it away but
that only works if you keep consistent
name standard so I called it color tag
before all right so with that script you
can now see every 100 milliseconds I
have the Gateway going through and
adding one to that value it's just so
that we can kind of see our animation
working and I don't have to keep typing
in a value he and just before we get to
the last section I think now is a great
time to tell you about the sponsor of
today's video PCB way PCB way is an
incredibly cool company that
manufactures printed circuit boards and
printed circuit board assemblies for
hobbyists and makers on top of that they
have high quality 3D printing and metal
prototyping Services they have super
helpful and friendly staff including an
engineering team that reviews every
order before sending it to production
fair pricing and great turnaround times
so thank you to PCB way for sponsoring
the video be sure to check them out in
the link in the description below now
back to the tutorial the next thing I
want to do is show let's say you also
wanted to animate uh something else now
we have two animations based on the same
tag already so if I want to go in and
also have the font size change based on
the same tag um one that's a pretty
enormous changing value and it starts
pretty small so let's also add a
transform um and a little script here to
say um return let's just return the
value / 2 + 10 so it'll change a little
bit slower like this um now what I
wanted to show you is you can animate
multiple Properties by using a custom
property that you pass in once so
obviously we now have three animations
based on this one color integer tag if I
were to go into custom and add a tag
property and put in the mapping of that
tag this gets way easier because I can
come into each of these spots and rather
than this being um it directly linked to
a tag whoops uh you can go to indirect
tag binding and you can give it the
property of this this thing and then
custom parameters and then we called the
tag this custom tag so you can go and do
this for all three and you may be saying
it doesn't actually save you time
because you have to go back and uh do
this part uh three times which is true
but what I'm going to show next is this
is what you really want to do if there
is any chance that you're going to use
this thing again for similar animations
for a different tag so um what do I mean
by that just give me a second to finish
tying all three of these to the tag
indirect
property um and let's hit okay and apply
now that took just as long as manually
tying it uh in all three places but
let's say I have a second one of the
same object and I want to make sure that
all of the animations that it was doing
for this first integer it does again for
what I'll call color
integer color int two uh I'm going to
call it slow cuz I'm going to have it
change slower than the first
one all righty so what I'm going to do
then is I'm going to say everywhere that
I was using Color int for that first one
I want to use color in slow for that
second one and initially cuz we don't
have the value changing it's just
looking at 29 but if I go into Gateway
events and I make a same I make another
script color int slow color int slow and
this one runs once per second rather
than uh every 100 milliseconds okay
apply okay and then we go back to our
home screen you can see I have this on
the right changing much slower than the
first one but the font size is updating
the color is updating and the text is
updating just by changing that custom
tag property so that's a cool little
thing to make it replicatable even with
buttons and things like this if you're
going to generate a lot of toggle
buttons you want to write that script to
look at custom tag parameters so that
all you have to do is pass in what tag
you're looking at and all of the rest of
it is extrapolate Away by using those
shared parameters so that's kind of one
step past an animation tutorial but I
think we have the time to make this
useful so let's go ahead and do one
additional thing which is going to be
transforming text based on an integer
uh and I think this is super useful
because it's kind of the basis of like
enumeration which is why I'm going to
call it an enum tag and it's going to be
an integer and I'm going to initially
set it to zero and the thing about
enumeration is it's embedding detailed
text status or some meaningful thing in
an integer value because plc's don't
always want to store Long strings of
text when they could just store it as an
integer so the most common thing I'm
thinking of is for a sequence or a
vessel like a tank in a tank farm is
tank status would just tell you zero 1 2
3 four or five but to make that useful
to an operator you'd want to transform
that to say running idle starting
stopped whatever status the tank is in
um so let's go ahead and go to
perspective components and let's grab a
new label and I'll show you in a little
more detail what I'm talking about I
accidentally made a second label that's
okay I'm going to grab this enum tag and
I'm going to uh have the tag tied to the
enumeration tag and now I'm going to add
another transform just like before and
we're going to take input values and
output values you don't have to change
this to string or anything like that
it'll know you want a string by default
so I'm going to say let's say 0 one two
3 and four are our statuses that we
could get and let's say zero means idle
for a tank one means it's starting two
means it's running three means it's
paused and four means it is aboring or
stopping let's just say
stopping booring always means like
something's wrong okay fallback will be
error uh error bad status okay that's
what it'll say now because the value is
initially set to zero oh let me make it
a bigger font size too font size 40 heck
yeah um because it's initially zero uh
it says idle let's go ahead and make a
new button and let's change the script
on this one to uh I'm eating my earlier
words I should have just made it look at
a tag let's look at the enumeration tag
in this
script and let's say the tag path is
equal to this and then let's read the
tag here in the
beginning and then caps lock is case
sensitive and then we'll say if value is
less than four let's just go ahead and
add one to the tag which will be value +
one and then we'll say else let's write
to the tag and have it be equal to zero
okay so this is just giving me a button
that is going to let me increment the
status so there you go it goes to one it
says starting two it says running three
it says paused four it says stopping and
then zero it says idle and if I were to
go in and manually make it a five you
can see it says error bad status if you
don't like it on multiple lines like
that just make your object a little
wider all right and then what's cool is
you can also transform these values and
then you can add another transform if
you want and so you can give a little
Clarity around what this is like if this
is tank status you can say tank status
and then the value all in one tag in one
object and you can say okay the tank
status is Idle now if you have a bunch
of text strings on a screen you're able
to show a lot of information just by
adding a label to this and you could
also go in that same expression and if
it was you know a a pressure reading
let's say you could then add units to
the end so if it wasn't tank status if
it was tank pressure you could all in
one expression you could say tank
pressure then the value and then the
units all in one string and you would
get this object that is just one
cohesive object you don't have to deal
with formatting like three different
strings all in one um and actually think
that that's pretty darn cool and pretty
darn uh easy so obviously the tank
status uh being PSI doesn't make much
sense so I'll delete that PSI part
because that's my OCD acting up apply
okay all right but right there we have
covered so many of the basic animations
that you can use in ignition in a fairly
short period of time if you have
specifics about how to do more advanced
uh animations or if I missed an obvious
one and you guys let me know about in
the comments below I will make sure to
do a follow-up video uh to address the
most sought after tutorials in ignition
that people have so be sure to let me
know in the comments below what you want
to see more of thank you so much for
checking out the channel I appreciate
your time I hope this video was useful
for you please consider leaving a a like
on the video subscribing to the channel
it helps me out a ton and if you want to
become a super supporter of the channel
consider checking out my patreon Link at
uh the description of this video as well
it helps me out so much and I could not
have gotten the channel to where it was
without my patreon supporters so thank
you all for watching watching and we'll
see you next time thanks bye