How to Use Expression Tags In Ignition!

LeMaster Tech
183 followers
2 Video Views·Apr 20, 2025
Thank you to PCBWay.com for sponsoring this video, be sure to check them out for all your PCB and prototyping needs. https://pcbway.com/g/2Zlh7L
Ignition is an incredibly powerful SCADA software, and their expression tags allow you to define tags with outcomes based on a programmed expression based on the value of other tags in your system!
Thank you for watching and let me know with any comments, questions or suggestions for future videos in the comments below! Don't forget to leave a like on the video and subscribe to the channel!
Thank you so much to my patreon supporters for making all the growth on the channel possible!! https://www.patreon.com/LeMasterTech
hello and welcome back to the channel in
today's video I going to walk you
through how to use expression tags in
[Music]
ignition all right so this is obviously
a continuation in the ignition tutorial
series uh We've recently started on the
channel if you do have any questions
about how to download ignition for
makers what ignition is why you need it
what an expression tag is be sure to
check out the playlist on the channel I
will be adding all ignition tutorials to
that playlist and hopefully building a
pretty deep uh backlog of how to get
start and how to use ignition and
eventually doing some pretty cool and
in-depth automation slm makers uh
projects with it so um as always if you
have any questions feel free to drop
them in the comments below but I'll be
assuming for this video that you at
least have downloaded ignition know how
to get into the designer and want to
know how to use expression tags so I've
already built out a little bit of a
frame framework here that has a Boolean
meaning a bit meaning on or off true or
false and you can see I have a toggle
checkbox for it on the screen that I've
built and you can see the tag value
itself in this browser on the lower left
also changing when I change the bit then
I built out a little just plus uh minus
two buttons on either side of a counter
and these are just letting me change the
value of my integer tag and then I have
a text entry box
here uh just where I can enter values
and change the value of a string tag so
the reason I built out these three
different types of tag is because I want
to obviously new tag um new standard tag
expression tag I want to show you how to
use expression tags and I want to show
you how to interact with three different
types of tags in your expression so
that's why I did that and let's just
call this expression tag one it's a nice
descriptive name we'll make it an
expression and we will make it a Boolean
because what this expression is going to
be doing is evaluating multiple other
tags and making a decision whether those
conditions are true or whether those
conditions are false so we'll come down
to expression and we'll hit the pencil
so now we are in the expression editor
uh if you ever get like super duper lost
and confused um these uh fields in the
top right there's a little plus and an
equal sign and these are some of the
most common fields that you'll be using
in expression tags so I find them pretty
useful if you ever forget that like or
or and or less than or equal to is uh is
this specific symbol it's nice to have a
little refresh available to you right
there but to be honest uh expression
tags fill a pretty tight niche in
ignition because when things get really
complicated you don't necessarily want
to be using expression tags you want to
be using like python scripting which
we'll talk about in future videos but
the purpose of expression tags is to
sort of evaluate a few things in a field
uh you could think of a tank right that
could have multiple alarm issues it
could be at high high level it could be
at high high pressure it could be at uh
high high temperature and if any of
those things are true you want to turn
an alarm on uh maybe it's a strobe light
maybe it's an alert maybe it's an email
that gets sent out to like maintenance
or something so that is kind of the
perfect time to use an expression tag
and uh to use an expression tag we're
basically saying we want to look at the
value of other tags and let that
determine the outcome of this tag uh
it's
basically like let me read values about
other tags and make decisions what about
what I should do I said that already all
right so let's copy the path of our
Boolean tag and I went kind of fast
there but if you want to look at the
value of another tag inside of your
expression one easy way to do that is go
to the tag that you want to look at the
value of and rightclick and go down to
copy path that will give you uh text
which when if you paste it into curly
brackets will look like this and this is
going to give you uh that tag and it's
telling this expression tag explicitly
where to go and look at the value so
first thing let's say we want the
outcome of this tag to be determined uh
by whether or not that Boolean tag is
true so when this thing is checked it'll
say enabled and that means it's true and
so this will become true now we're going
to use the expression and which is two
ampersands and now we're going to look
at the integer tag so I could do it
exactly the same uh way I could copy the
path just like I just did and I could
paste it in here but uh one additional
pretty cool little thing you can do
inside the expression browser is this
insert tag button which is a little tag
icon over on the right you hit insert
tag and uh it'll open up a tag browser
so I can go to my folder for tutorial
tags my expression tag tutorial and I
can click on that integer tag and I can
hit okay
and I can say uh so now integer tag and
I want it greater than two and what you
guys notice is kind of interesting is
rather than all this first gobbledygook
what I get is square bracket period
square bracket and that is because it's
telling this expression you don't have
to go look through the entire tag
browser to find this tag it's in the
same host folder and location as you are
so this dot is just a way to get uh your
expression opt optimized to look at a
closer location so really we could go
back and we could control C this into
here because the boan tag is obviously
in the same location as well but for now
let's do just those two things let's say
if the Boolean tag is true and if the
integer tag is greater than two then we
want uh that to determine the outcome of
our expression tag okay and I'm
intentionally not using the string yet
because there's one thing we're going to
talk about when we get to that but let's
go ahead and make the expression tag and
uh just so it's a little bit more useful
for us let's go ahead and change our H
yeah I left it in run mode Let's go
ahead and change the text on this uh to
look at the expression tag so it's still
looking at my first tag let's look at
the expression tag which is just going
to say true or false and let's real
quick let's just transform it to tell us
explicitly that false will
mean conditions not me
and I'm not really focusing on stuff
like uh how to transform uh and what I'm
doing right now conditions all met okay
all I'm doing is taking the true false
outcome of the expression tag we just
made and saying whether or not the
conditions are met in a little uh label
up top okay so if you remember we said
the integer has to be greater than two
and we said this bit has to be enabled
so the bit is enabled but the integer is
exactly two let's go and add one to the
integer and now it says three and now
the expression tag says conditions all
met now if I were to disable the bit it
says conditions not met again and what's
really interesting is we didn't set up
our expression tag to be like cyclical
or anything we left it on the default
which was event driven and event driven
is really interesting because event
driven means it's looking at changes of
any of the tags that it is addressing in
its expression so it knows that when
this bit changes it needs to do a new
evaluation because the values that it's
comparing to are uh changing underneath
it so it's a really cool function of
ignition expression tags if we were to
take this integer back down under two we
would get an issue um oh it would just
say conditions not met not an issue now
let's take a look at how to incorporate
a string because it's a little bit
tricky and I left one thing out of this
expression on purpose to show you the
difference I think now is a perfect time
to take a quick pause and talk to you
about the sponsor today's video PCB way
PCB way is a long-term supporter of the
lamaster tech Channel and I love working
with them because their products and
services are all about empowering makers
as their name suggests the core of their
business is manufacturing pcbs or
printed circuit boards this is such a
cool way for hobbyists and makers to
turn their electronic designs into Super
highquality and professional grade
circuit boards beyond that they also
have the ability to support all your
prototyping needs with highquality 3D
printing and metal fabric if as well be
sure to check them out at the
description below this video and thank
you so much to PCB way for sponsoring
the video all right now let's get right
back to the tutorial okay now let's take
a look at how to take that expression
tag one step further and incorporate our
string tag here all right so let's go
ahead and say we also want to keep an
eye on the string and make sure that uh
it doesn't equal a certain code right
like you might have a status for a tank
uh and it says like filling heating
mixing idle um and you want to make sure
that tag is not idle so we could say uh
and we want to make sure the string tag
is not equal to and not equal to is
exclamation mark equal sign and let's
just pick uh Pete because that's my name
and that's something that is easy for me
to remember while I type it all right
and let's go hit apply and let's hit
save and now I'm going to say uh all
right this is greater than three and my
string tag is not equal to repeat which
is great um but if I hit enter you'll
see conditions not met so it's still
working like that which is really cool
um but one weird Nuance that you just
should be aware of is if you want to do
something different like and uh length
of the string tag is not equal to zero
so you're just basically saying I don't
want to have an empty string if we hit
apply and we hit apply and we hit okay
um it says conditions all met right now
and when we hit uh delete it out it
seems to be working properly because the
string goes to nothing it might seem
like an unnecessary step because
everything was working fine without it
but just to show you kind of How It's
interchangeable but still important to
know about I'm going to add value to the
end of all of them and what you'll see
is they still all individually work like
I can still turn off uh enabled disabled
I can still make the integer go below
three and I can still make this uh go uh
empty I hope the outcome of this video
is crystal clear this is a really neat
powerful way that you can get one tag
that tells you the status of multiple
things in your process and you can use
that to do uh all sorts of useful stuff
Downstream so it's like doing
programming uh inside of ignition which
is nice because a lot of old skada
software you Main wanted to do as much
programming as you could inside like the
PLC or the devices that were coming into
your SC and you wanted to minimize
developing like code and uh different
formulas and stuff inside of the skate
inside of the HMI itself but ignition
really changes that in my opinion
bringing raw tags in and doing math and
calculations on them inside of a project
absolutely makes logical sense uh using
ignition so I think this is a super cool
topic and uh I use these tags all the
time so be sure to let me know in the
comments below if you have any questions
if you have any questions about this
stuff I kind of did on the side to set
up this example let me know as well and
be sure to let me know what you want to
see next on the channel I do a lot of
development in ignition so if you have
questions about how to do any sort of
specifics with that just let me know as
always thank you so much for watching
and we'll see you next time
