4-20mA Current Signal? Wiring, Scaling, Programming, Troubleshooting

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is tim and welcome to talks with tim improvised uh so the power went out and then we found out there was a pole on fire and then it had set all the trees around on fire so the fire department is there and it looked like it would be quite a while uh we're going to take a little more time getting this one started michael do i have sound do i have all the fun things yes yes oh my goodness michael is amazing here i mean every you're there you know a couple things for anybody that thinks that my videos are scripted yeah watch me now because yeah they're not usually scripted we kind of have a rough idea what we're going to do and yeah michael just managed to race back here in what how long has it been 30 minutes maybe and it is completely set up at a different location and everything seems to be working so yes jeff kuiper is back and man i really hate that because um london we got a lot we like we got a lot of good answer plan now you're gonna hear a lot of shuffling a lot of moving around because really we just started dumping things into a bag and getting going uh but the cool thing for everybody that is in there is we are going to be giving away a plc tools sim aob2 analog simulator to someone who is participating in the chat and just like last time participation in the chat doesn't mean hi it means you ask a question about milliamps or you provide some type of input about it or feedback but uh this is an older demo model and we just pulled it off of something but i mean it works perfectly fine just get a little bit older firmware in it so we're going to be giving that away and yeah we are going to start a little slower here because one i need to catch my breath really we just raced in we managed to get this set up i think we got it where you can hopefully see most of it it's not going to be as good of a view because the camera's a little further away and there's just no way to really move this stuff in sunil very nice to see you hi to you all right michael everything looks good all right we're going to wait until 12 to start this so does anybody have any questions in the chat or yeah feel free now to say hi in the chat yeah okay hey scott from texas glad you could get on yeah and just um yeah put any questions you have i said i did say 12 so and i just sent out a notice and i think michael just made it where you get a notification on youtube so i want to give everybody a little bit of time to get back on a little bit about what we will be talking about hey jack good to see you hey see butler from colorado oh my goodness jeff what's modbus i do actually i have my best videos coming up i've roughed them out i did try them actually i recorded them one time i didn't quite like the view it was a little uh my drive was a little too far away but i am doing modbus um over ethernet and modbus over serial hey riggs from fiji very nice to see you but yeah so we do have some modbus videos coming up and jeff you know more about modbus than i do but yeah we're going to talk about when your data doesn't you know when it looks like it's garbled how to figure out whether you need to swap bites or swap words or all those things that's yeah yeah well i've worked on modicon one time i mean and it was very robust but um yeah i don't want to work on my bus again also i apologize but everything's in the wrong place i'm looking over here but my camera is actually up here for no good reason except for yeah that's where you could see this and this is what we really want to be this and see matthew change the bald rate are you talking about modbus now or yeah what horribly can happen when you change it um yeah jack you know i've worked with some prosoft cards they can do some amazing things but yeah they can be a bear to configure mainly i worked with um we had some profibus networks that we needed to uh take from an s7 400 controller and move over to control logics and so the prosoft modules were the best way to do that and once you get them going they're bulletproof but um i think they could work a little on the configuration of that yeah but um you know figuring out baud rates and parodies and all those fun things are really a bear that you know that wouldn't be a bad video that's one thing i think um rslinx does an awesome job at is that auto configure button and i think um i think everything needs an auto configure button really yes scott um yeah i am going to sit here and catch my brother that's another reason i'm gonna wait until 12. let everybody else get back on and yeah just give me a chance to catch my breath because yeah um yeah we just ran all this stuff in there but hey dean glad you like automation so we're going to learn yeah because we're going to learn hopefully a lot today about analog signals which is probably the jeff kuiper you can jump in here on this because i consider jeff kuiper a very a very confident competitor i guess we could call him we're great friends he uh he built outstanding equipment but even him you know if he gets an analog application hell you know he'll ask you like hey i want to make sure i'm doing this right i think analog's one of those that just trips us up and actually i'm going to start all over i know i winged a little bit of a two-wire versus four-wire thing there but we're going to go through it again and let's see uh say hello tim have you tried software integration with other vendors plc or point i o to compactlogix yeah um i've done that um over ethernet ip and actually i've done that um with some other networks so yeah i've done some of that i haven't done any videos on it that that wouldn't be a bad thing either i have a really cool i got nothing to point at but if you notice um i have i have a yamaha robot that we're getting ready to play with and that's one yeah we're getting ready to integrate it with the compact logix and it is insanely easy like i was going to do a lot of prep work on that because i you know really was like oh this is a robot it's going to be real intimidating but then i i played with a few hours and i'm like man i think i'm going to just do this one and walk through it with you so we're getting ready to do some robot videos and show how to integrate it with the compact logics and yeah those guys yamaha just made that really easy oh yeah yeah well you know yeah yeah reset yeah that's the first thing everyone wants to do is reboot that can help sometimes a lot of times it doesn't yes yes and i'll haul her out of him chris elston's who jeff's talking about uh he is insanely smart at this and he what i love about chris and and why i really just think this this robot is the thing and it's going to be a great series is he is a plc program so this thing is written by a plc programmer for plc programmers so it's not you know not writing a lot of coordinates not doing a lot of math he has made some alis that make that thing insanely easy so that is going to be really good all right we're going to give it a couple more minutes here to get going so everybody can get back on and michael how are all the frame things and all those things here compared to the training center are we better here or is here um i will not say oh apparently we are worse so uh yeah we were just we're getting real creative here and uh yeah we're gonna we're just going to we're just going to wing all this all right you know um sunil sorry if i pronounce your name wrong i am going to do some 232 videos about the micro 850 i don't you know i don't think i have any good hardware for 485 videos it's probably the biggest thing gene hello to you nice to see you from peru all right you got the spreadsheet things open and all that stuff yeah okay yep yep we're looking good you've got all that going oh boy got all types of crazy things going on there just trying to get all my tabs straight now i guess i don't need to know what the power company's doing now so i can close all this back out see if i can get all my tabs reorganized here and i have three screens just as i did before but now they're actually swapped so i have to look the opposite way on everything so we'll just see how everything goes high impedance oh do we have a delay do i have a bad delay is that what you're saying coaster bp well we're doing the best we can and yeah we pulled this off and really by the time we ran in here when we pulled up i think we had we were back live in seven minutes so by the time we set all the equipment up and managed to get power to it and everything else so we're all doing the best we can now all right well we are about i think we are good here michael how do you feel i like where i think you got everything ready yeah okay so first let's just talk really quickly about what the difference between discrete and analog are and so when you think discrete that is like something that is on or off only or a one or a zero so this push button here we push it and it's gonna be on we let off of it's gonna be off or if it was a normally closed button it's on and we push it it's off but it's it's binary it's a one or a zero it can be no in between and same with these lights here you know let's switch to switch it over to that with this light here it is on or off or you know if we open let's see we'll save it about so you can see some movement this right here this is either on or off so those are discrete inputs compared to binary man okay and the camera angle just isn't that good so but right here we have a potentiometer and so i can switch that and so we can see now the ball's kind of up this high and if i turn it a little bit it's going to speed up and it's going to go a little higher or i can turn it back down and it's gonna go a little a little lower so this is analog so just like the dimmer switch you know on you know an old school radio or you know a light switch dimmer you know you can turn it and you can vary it so that is an analog signal and so we can take analog signals either by reading the height of this ball and by controlling that fan output and we can instead of just saying this ball being just wide open or off we can make it do different things and i think i got enough angle there oh yeah this could be i think the ball is probably going to disappear but so we can take and start this and it's going to use a pid now oops that and it's going to control the ball at a specific position so it's going to get feedback and try to attain it by adjusting the speed of the drive so then you'd use a p id for that and let me just drop a link because we do have a pid series going just in case somebody's curious let me just see here and my chat's not labeled now michael i can't find everything's in the wrong place but okay so here is a pid series if anybody is curious all right let me just catch up here yeah all right so we are um we are gonna do how to um okay how to change four to twenty to zero to ten all right so i think what you're saying there is you have a 4 to 20 milliamp input or i'm sorry sensor and you only have a 0 to 10 volts plc input and what you would use for that is a load resistor and let me see if really quickly i can find you a link to that because i did a video on that right here is talking about how you can put a 250 ohm resistor across your plc your zero to ten volt input and read a four to twenty so read a ford 20 sensor with a 0 to 10 c plc input and yes sorry guys when i get frazzled i have to talk to type so you're going to hear me typing talking everything that we're typing but okay so yeah that would be bad hello kevin glad you could get on and okay sean um i probably won't get into calibration in this one that's something we could touch on i gotta be honest i don't do calibration you know we put it out and maybe somebody else calibrates it but usually we're doing more troubleshooting so we're doing more of simulation actually we're going to do some simulation today and i do draw a line there in other words i will simulate a 4 to 20 milliamp signal the calibration there's a lot of eyes that need to be dotted and t's crossed for calibration and so i don't know if i'll touch on that or not and yeah well we do have a bfd series and i'll drop that in a little bit let's say 40 20 questions i know it's normal 24 volt but i saw a sensor that outputs 4 to 20 at 10 volt i know compact logix 4 to 20 is a 4 to 20 as long as it can push it across the resistor we'll probably hit on that a little later you know and okay you know that's one thing um i figured it would come up a little later i'll go ahead and say i'm not going to discuss heart in this video and honestly there's no i mean you know we all end up at our narrow niches and mine just happens to be that i don't work with heart much i've worked with heart one time in the last like i guess i did my first analog application like i don't know 20 25 years ago i've ran into one hard application just just the lane i run in we i don't i don't get into a lot of heart heart is very popular in certain industries just not mine okay but let's go ahead and see if we can get started here i did not even try switching screens so let's figure out what happens when i try to switch screens look at there we've got rslogix that's looking good so we're going to start with a well one let me get the trainer up here because i wanted to show you that just so we can see on and off and yeah he had all this nicely planned but here it does kind of kind of move things around as needed good grief i'm glad we grabbed the right trainer and all that franticness because there's two of them sit side by side michael okay but yeah so we are going to be using a compact logix 1769 l16 er b1bb and it has four analog modules on it i went ahead and set this up with all just in case some questions came up so we have a zero to ten volt input module a zero to 10 volt output module a 4 to 20 input module and a 4 to 20 output module so the first thing i'm going to do is i'm going to create a program with all that in there so i am going to select our 1769 l16 er b1 our bb 1b and i'm just going to call this our oma stream and then the most important thing on these l16s is you got to make sure that you put your expansion i o modules and that's the number of modules we have over here to the right and that is going to be four modules and so we're gonna get that started and gordon's giving some good information there yeah because i wasn't even there i was like the dampening param but that sounds like something specific to a certain instrument i know heart is very good for you know calibrating things that are horribly in the wrong places to get to and that's about the extent of my heart knowledge that you can get some good diagnostics info okay but all right so we are going to look so we're still getting there sorry first thing i'm going to do is i'm going to configure these expansion modules so right here the expansion i o and i have four modules i'm going to add all of those so new module and one thing i do love is the search feature up here because there's you know gazillion modules you could do and right at the bottom of the 1734 modules it tells you what they are so this is 1734 ie 2v and so i'm just going to type ie2v and it's gonna be the only one there see that's a two channel analog voltage input and i'm just gonna call that voltage input and then my next module is an oe2v so we'll put an oe 2 v that's going to be our voltage output and then the next one is going to be the ie2c and this is well let me just put it in so you can see exactly what it is i d2c and okay talking about heart so there is actually a heart version of this module and that would be really neat um maybe i will play with heart one day but you know it's just one you know especially when it comes to custom hardware it you know we have a very limited budget for that usually most of the stuff is stuff we're picking up on jobs as they run through making videos but all right we're going to use this ie2c that's not the heart and this is the one main one we're going to work with though this is are going to be our current input and that means our 4 to 20 milliamp input and then our final module is going to be an oe 2c so o e 2 c and that's our current output that's what just to start with we're going to download this program right here hey uh yeah this is studio 5000 i'm using version 32 of it this is what you use to configure the control logics and compact logix plcs and i'm going to go ahead and download this program and if we're really lucky i have everything ready to go on this because honestly it's been a while since i did any of this here at the shop so let's see if any plcs show up getting a lot of red x's but hopefully there we go look at that so i'm going to go ahead and just download this program yes we are downloading pretty much a blank program because we're going to find these values and we're going to wire to them i'm going to try michael where's my bad guy oh it's on your desk it was on your chest i got it hey guys it's gonna be a little messy here because really i just grabbed everything i said really quickly all right and really we're gonna put that back in the run mode and hopefully yeah we're looking good but okay so the next thing we've got to do is we've got to figure out how to wire our analog input and so if we go to the point i o digital analog manual and i like this one because it has most of the modules it doesn't have all the modules but in this case i can hit control f and i'm going to be looking for i e 2 c and if we go down a little bit right there there is the wind diagram for it i'm going to click there and this is going to give us the user manuals wiring diagram and here is where the problem really starts with using 4 to 20s is if you look we have two different wiring diagrams my mouse is smaller on this computer but okay i'll just use highlight so this one on this side you see that we have an input and okay we have a chassis ground and then we have a voltage or a v terminal which we can assume is voltage actually right here v is 12 or 24 volts supply and then we're going back to the input but on this side see that we are getting an input same as we were and we have a chassis ground but in this case we're connecting to the common so right away people look at this and they're like i have no idea what to do because one of these says connect voltage and an analog input and the other says connect are common an analog input well if you look right here this is a four wire and this is a two wire and so in the four wires case you see they kind of show two more wires going over here and then they say ac or dc it's still not super clear but right here which let's see if i can smoothly do all these things you have no idea how hard this is yeah everything is backwards now because uh we'll figure out how ambidextrous i really am but so this is a four wire setup right here and so we have our power supply it could be 24 volt it could be 12 volt this could actually be 480 volt on a drive even but mainly it's going to be some external power supply that is really not in any way related to our milliamp circuit and in this case the analog signal what this device is going to do is it's just going to regulate the current coming through so we're going to hit we're going to connect plus to the analog plus or usually sometimes it'll say m a plus or milliamp plus and then analog minus is going to go to the minus or in our case the common and that's what you're seeing here on this left side so we have an input our analog input we have one wire and it doesn't even distinguish here this one i wish they would be a little more specific but it can actually be confusing i can see why they don't is this wire right here is the plus on a four wire system now note that on a four wire system this is a plus wire because that's going to matter in a second and then the minus wire is going to be this common and then yeah we do have a shield wire or a chassis ground and depending on your device it may not have this i kind of wish they would dash that out or even i know you can't really say optional there but really a lot of times there's only two wires but anyway on this side this is a current two-wire device now one thing i need to did miss saying on this is this right here is what we call an actively powered device so this is actively powered from somewhere else also you have a three wire device and on a three wire device well my marking isn't working on a three wire device the analog minus and the power supply minus will be internally jumpered so a three wire device will be wired typically like a four wire device yes john you're right that well it's studio and i did say studio 5000 boom rs logix 5000 is the older version of it i think um jeff kuiper if you're still on you probably told me exactly i think what was it version 2022 they changed the name from rs logics 5000 to studio 5000 or studio 5000 logic spew designer or something i can't even think of the full name of it but okay this is a four-wire device and now let's look at a two-wire device though because this is where the confusion really starts to come in whoops wrong one we get to the right one here and so this is a two-wire device and so same deal we have an analog plus and a minus or two wires mainly on our sensor and we're going to send 24 volt from our power supply plus to the plus of the sensor and here's where it gets confusing to people is we're going to take the minus of that sensor and we're going to go to the plus or our analog input and then we're going to take the minus or the common and we're going to go back to our power supply and this is what we call passively powered so this thing doesn't actually get power and it really confuses a lot of people because they're like well i mean where is it actually getting it well it's going to consume a little bit of power out of this 4 to 20 milliamp signal to power it and here is where understanding that current and power are two different things comes into play and i i had some neat things to show that but um unless somebody asked um i'm probably not going to go try to hunt for those now but yeah okay jeff says he thinks it was version 24. but around yeah around version 24 they changed the name of rs logics 5000 to studio 5000 and and michael says i need to take a moment to drink some water so that i can calm stay calm and remind you to hit the like video on this live stream and to subscribe to our channel we we put out at least one automation video a week and yeah we usually put out a um live stream about once a month but okay so we need to figure out whether we're going to use a two wire or a four wire device first and we're actually gonna wire both of them here so i'm gonna go back if i can get there there we are so the first thing we're actually gonna do is we're gonna wire a four-wire device and so that means our analog input is gonna go to one of the wires and then we need the common or terminal four to go to the other now i gotta be honest i don't actually wire this this way and probably someone will disagree with me or tell me hey you're being over cautious for nothing is this goes through the back plane but it ends up being the same 24 voltage or power in this width in this case we're going to in this case i usually hook this directly to the zero volt of the power supply and i'm going to show you both ways just so we can see that it works and so we're going to look at our analog simulator here now and on it if we go agree if it's a long stretch to get up here if we go to current source because the four wire device is going to be a current source oh man even my video is backwards here so yeah this is a real struggle then at the bottom you're going to see that the red terminals are plc input and the black terminal is the common oh no just like i said we're improvising but okay so the red wires are plc input and the black wires are common so i am going to turn the power off to the trainer and i'm going to grab a couple wires and hook them to the analog simulator and then if we go back to our manual we see that our plc input is going to be that top left terminal and the third one down is going to be our common and if i had not ran out so fast i had a terminal to show you but in this case you're just going to take my word for it because yeah you're going to struggle probably to see that and in this case the camera does not mount well michael need a terminal block your you run grab me one terminal box screw it over your grabbing one yeah i asked for a turbo black screwdriver hands me a phillips screwdriver come on bud i've been in here for a while yeah you haven't been here in a day you forgot where all the tools were but okay so that top left one there that's going to be our input and then the third one down is going to be our common we'll power this back up and we'll wait for the plc to power back up and now is where i would usually tell you to make sure you subscribe and like to our channel and yeah make sure that you throw any questions in the chat because remember we're giving away an analog simulator to someone in the chat so you can't say hi but you can ask a question or put some input in about our analog inputs all right we're waiting for for it to do its dance here not you to do your dance all right we're back on so let's go back online here okay why you're not showing up you're not sure just because i'm um live streaming this there it is that was probably just slightly impatient we're gonna go online okay now the next thing we got to do is figure out where is this analog input so i added them in these expansion modules here and if you notice that there is a number in front of these expansions so our embedded is one and that means that's local colon one so our first module is going to be two our second module is going to be three and our fourth module is going to be four so we need to go to local four input and we are looking at this channel data right here and so now i'm gonna run well let me turn off the power saver of this just so as i ran out without the analog simulator that we were using so we had to grab one really fast so sleep timer we're gonna turn off and our lcd timer we are going to turn off this so we can keep this as bright as possible all right that looks much better oops okay and now we'll find out who was actually paying attention because i yeah i said put these on the first slot but that's not right this is the voltage input let's see will you have will you have drawings on your website so we can watch and reference them well no you pay attention jeff but um actually i do have this in a lesson and i will try to find that lesson here in a little bit maybe while we're waiting on this compact logics to power up one of the times and it goes through the pluses and minuses all right so now i have it hooked to the right place i should have shown you that um one of the neat features of the analog simulator and the reason i knew that something was wrong was with this off you see this open wire banner and i apologize i can't especially now my wires are short and my camera is in the wrong position but it says open wire right here and they told me that something was wrong with my analog circuit that's one of the best features about this so if i hook the wire back up or in that case i just had it hooked to the wrong style of input then it's going to show something here and now we can go in to studio 5000 and we'll see all right i've got it at 1 milliamp right now and we're seeing a crazy value here 816 but this is a 4 to 20 milliamp signal so let's bring it up to four whoops went too far and at four milliamps it's showing right at 3270 and if we go up to 20 milliamps then we are showing 16 378. and so these are the rough values of this so we're at 20 milliamps now and yeah we're seeing 16 what 16 378. and that doesn't you know i see this all the time one i will see people that will put those values in they'll use the raw values and they'll figure out well i i need to kick a pump on it like 12 000 raw value well no we don't need to do that we need to figure out some scaling yeah we need to do some math and yeah thanks john this is a slick little simulator i probably ought to put a link to this while we're here let me just pop that link in but we need to do some math here we've gotta you know we can't we can't really guess and even then what is this 16 000 number here is the next thing that we need to figure out so i'm going to drop a link here to the analog simulator this is the plc tools sim alp2 and there is a link to it um yeah we can um yeah we can simulate a 0 to 10 volt and like i said it did set this up let me just pop a wire off of here so that i can show you yeah so if we just go to the main menu here then yeah oh i'm sorry guys my wires are like a little short but yeah we have we have a two wire which you're getting ready to use i mean a current sort a current two wire we have a current source then we have a voltage source and yeah the voltage source will do what you're asking for there but okay so now let's talk about how we can figure out exactly what this is actually even before they do that let's talk about two wire because realistically you're gonna see way more two-wire devices than you are four-wire devices and they're gonna give you the most trouble and it's not that they're not it's not how should i put this it's not that they're fragile they're more confusing and also they are put in much worse locations i guess that's the thing i can put usually you got a nice transmitter for a four wire signal and usually it'll be you know have some enumerating you know you got you got a level sensor drop down and some sludge pit it's gonna be a two-wire device so they just end up in grimy harsh locations sean glad you have one of these yeah they um yeah this is this is one of the devices that i almost never leave without uh what is the make that is plc tools that is the makeover the model is a sim alp2 and it's analog simulator and right above you there i've got a link to it okay but let's talk about two wires so if we go back to our manual here this was our four wire side and first you know in here i'm not super happy with how they do this manual but you know um everybody is a critic so i don't want to go too far down that i do have people that think that wire devices are for input one and four wire devices are for input zero that's not true you can use these on either side but let's look at the current let's look at the two wire device so in this case we need to send voltage to it and then we need our analog input so we're gonna do the exact opposite of what we have now one thing i didn't show is yeah now whether it's just me being kind of cautious or just being in usually horrific power environments that's kind of coincidental since we just had a tree catch on fire right by the training center but but um but i usually would not put the common or in the two wires case the voltage through the module and my thinking on that is if you do have something you cut your i say your wrist in half it's basically the voltage side and we go out and we power something and we short the conduit well all that current is going to have to go through here and i get they have protection and all those things but i usually would feed it from the plus 24 and one usually i might have a fuse on it so i'm usually going to have a 32 amp fue i'm sorry 32 amps 32 milliamp fuse on my milliamp signals that way if something does happen pops a fuse everything else gets the running and the first thing i can tell a technician when he's like hey my level since they weren't working and be like hey check the fuse and you know of course first thing you do what do you do you change the fuse again it pops again and you find out that your device is bad but okay in this case what we're going to do is first thing i'm going to do is i want to move this common in one let me go over here to our screen focus and let's go to you see right now it's 16 380 roughly as i'm going to take this common off of here and i'm going to move it over to the zero volts on my power supply just so you can see it's the same value so i i that's how i would actually work so i'd only end up with one wire over here on the analog signal also i think that makes it a little clearer when we um when we get a troubleshoot now when you have two wires coming out of a device that is foreign to you or you're like yeah i have no idea about four to twenty's i know how to wire a light switch when you see two wires coming out of it it's kind of magical but if i have 24 volt going to fuse going out to a device and coming back that's almost like any other circuit so i think it just removes a little bit of that's just me though so now what we're going to do is we're going to make this a two wire setup so if i go back right now i can go up and there is current two wire and i'm just gonna pop one of the wires off of here just so we don't have to deal with any shorts or anything and when i go to it we're gonna see that our plc input is still our red but see it told us now we need plus 24 here just like our drawing did so now this wire needs to go to our plus 24 but first let me do it exactly like they have it and so if we go and look at the wiring diagram they're showing it going out of the bottom terminal now again i'm using input 0 here but we're coming out of this voltage terminal here for our 2y device so i am going to take this wire loose and put it on that bottom terminal [Laughter] we left everything that wasn't essential to do this live stream at the training center so we are having some interesting things right now but okay let's see please save the streaming to watch it when we need it well you know if it turns up okay we will otherwise we may be doing another live stream but i think we're i think this is going to be okay so now we have plus voltage whoops didn't type that side post up enough so now we have plus voltage coming out of that bottom terminal going to the black and then our red is going back to our input so now let's go back over to our screen and let's look at that value and all right right now i'm at zero milliamps so i'm going to bring it up to four all right so four look we have almost the same value 3277. that was roughly what we had last time and we're going to bring it up to 20. and we've got roughly the same thing 16 384 so at 20 milliamps we're showing that same value of 16 384. now again i would not have this here especially on the voltage side because there's too many things i think that can happen in the field i would have this wire coming out of the plus 24 and again especially if i'm on a larger system where there's a lot of analog and you know one sensor going back and take down you know all those i will have 32 milliamp fuses on them that way i mean really this is one case you know people are like hey you know you shouldn't use fuses and these circuit breakers i don't think there's a 32 milliamp circuit breaker out there so this is one case that you do use fuses and same deal i move it over and we still have 16 384 now that's great and everything but one what is the 16 or 84 that's the next thing we need to figure out and rockwell has done so much of a better job let's see hold on i'm sorry jason yes you're correct uh the first one and we can look at that right here the first module is a voltage input uh the second module is a voltage output and then we have the current input that we're working with right now and a current output for four to twenty out but used to it was written in many of the plc's this is a knock and rockwell in many of them it is a guessing match to figure out what these values are but if we double click on this module here it's going to bring up the module properties and then right here we have the configuration tab and if we look at it here it is our low engineering is 32.77 and our high engineering is 16 383. now this is one of those that we need to do a little math on and i know a lot of times when i start saying math i get glazed over looks but really if we walk through this slightly then i think we can do it and hopefully i have enough of what we need down here to walk through this map because what we're going to use is what they call y equals mx plus b and when i say that everybody's heard of it everybody kind of remembers it but then it's like all right i really don't know what it is so if we look here's here it is y equals mx plus b and yeah i'm not even put this in the present mode we're just going to do this like this and so our y is our scaled value so in this case what i want to scale this to [Music] is i'm going to scale it to 4 to 20 milliamps so i want this to end up being 4 to 20 milliamps now yeah i know usually you wouldn't make it 4 to 20 usually it's going to be some real value but let's start there just so we can understand it and then we're going to have a slope here that's m and this is going to be the ratio between our scaled value and our raw value so we're going to figure out you know how many units of that 16 whatever 383 to 32 77 or the opposite way right right here it is 3277 to 16 383 is going to equal this four to twenty milliamp signal so we're gonna we're gonna need to figure that slope out there and then man the guys i'm sorry i'm really struggling with my screen spin backwards but but then we're gonna have an offset and the offset's really important on four to twenty because it's by far the most confusing thing when it comes to scaling things is we have what's called a live zero and what that means is zero is not our zero four is our zero so we have to account for that so let's talk first about what is m because usually everybody can follow pretty good so it's the milliamp full range divided by the raw full range and you know actually i have that backwards so let me let me correct that it is not oh yes we have something wrong here where did it go oh that's wrong this is wrong cut that out big grief i hope that's not wrong to the whole thing but hey like i said everybody keeps saying your videos are scripted uh no they're not but okay so that's gonna be our full milliamp range divided by this raw range and okay where did i get these numbers let's make sure we don't get confused here this 16 383 and this 3277 that is the range of our engineering units so our low value or the 4 million value is 32.77 our high engineering is 16 383. so then what is b well in the case of this b is whatever that offset's going to be and for us it's going to be 4 right now because we're going to scale this to 4 to 20 milliamps now later on we're going to change it i don't even know we're going to change it to now let's make it a level so we're going to change it to a level sensor and so typically a level sensor let's say it's a pressure type level sensor it's going to be 0 to 10 volt and i'm sorry 0 to 10 psi and in that case 1 psi is going to be 2.31 feet and so zero to ten psi equals zero to twenty one point three feet and we'll get to that in a little bit but right now we're just gonna use four for that b now this is the one that confuses most people is x and that's because x does not equal your analog input and that's what everybody always wants to do is you know they'd want to plug in their local colon 4 colon everything after that for analog input but it's not because we have a live zero and so our zero in this case is the analog input minus that raw milliamp four milliamp value and that means that x is going to leak equal our analog input minus the 3277 which is our low value so if we put that all together and okay i did it right here did i just yeah i typed that right i did something wrong earlier but okay we're right now we're talking with gas now so right here that means if we put it all together our y is still going to be our scaled milliamp value and that's what we're going for right now our slope or m is going to be 20 minus 4 divided by 16 383 raw 30 minus 32 77. now i'm leaving these units in here for a reason right now because while it's a small step i'm going to show you how you can figure out for sure that you have these numbers the right way and it's something i still have to do okay now the x is going to be the analog input minus 3277. now what is the analog input right here that's where this is going to come in our analog input is that local colon 4 colon i channel 0. let's make sure we see that is what we found our value going at right here so that is this right here okay so with all that that means that y equals the local colon 4 colon i channel 0 minus that 3277 to get rid of that live zero now i'm still leaving these raws in here there's a reason for that and then times 20 milliamps minus 4 milliamps divided by 16 383 minus 32 77 and then plus 4 because we do have that live zero now here's just a little bit of why that is and really i don't want to get too deep into this because yeah this is not a math class but this is how you can kind of keep track of it and one divided by or any number but divided by itself is one so one divided by one is one in fact you know as crazy as it sounds let's let's make sure we see that let me bring up a calculator here and just so we see yeah one divided by one obviously equals one and if we go and put two divided by two it's going to equal one and if we go 27 divided by 27 it's gonna equal one so any number divided by itself is going to be one now what we can do with that is also that means that raw divided by raw is going to be one or you know apples divided by apples is going to be one anything divided by itself is going to be one so using a little bit of math first we can get this out of here and i'm not even gonna see don't yeah yeah let's go ahead and get through this so mainly we're removing this and getting it down to right here and this set of values here this is 4 to 20 milliamp milliamp and milliamp and this is raw well then here we're dividing by raw minus raw so in this case if we just skip down raw divided by raw those two are going to cancel out and we end up with local colon 4 colon input channels 0 minus 32 077 and then just put that times 1 in there just to see that that goes out and then everything else is milliamps now somebody put it in chat if you really want me to go deeper into this because i kind of threw this slide in just uh just in case somebody really questioned or really wanted to know why hey daryl glad you could make it on we've had an interesting um stream already i'm glad you found us but okay in the end here's our equation so local colon 4 colon i channel 0 data minus 3277 times 20 minus 4 divided by 13 383 minus 3277 plus 4 that's going to be our 4 to 20 milliamp value and actually let's say but we'll save that for a little bit but okay now that's a lot of numbers and we did not come here to do math we came in here to figure out how to do analog inputs so what can we do with that is i'm going to highlight this now and i'm going to copy it and we are going to go to our plc program uh john you could change it and there are pros and cons to that because mainly what would you want to change it to would be the question because you notice that the data of type here is an integer so we are limited in the number so if i put a 4 and a 20 into these values and just said hey i want it to be 4 to 20 then we're not going to get much scaling so typically there are some that you could do it that way but typically i see people doing the scaling outside of them so what we're going to do is we're going to open up our main routine and then one we could go to our math tab compute math tab and we could do a bunch of ads and subtraction and a lot of the older ones you could or you would have to but we're going to use this compute instruction here now notice i copied and pasted that so now if i highlight this you get there man michael is that manuel now feels comfortable with everything and now he's trying to get his computer plugged in and get a little comfortable himself but yeah so i am just going to paste that equation right into our expression and then we need a destination and so i'm going to make this actually i'm going to show you how to do this in ladder function block and structured text so this is going to be our scaled ladder all right and notice we got question marks here that means that we do have to create this so i'm going to right click it or you can hit ctrl w and we're going to create a new and then oh actually this would be good to talk about is all right it's going to default to a double integer and yeah let's um all right first i'm going to create this as a real and then i'm going to copy this why do i have red x's um oh okay well let me hit the verify button so you can see this because i don't even know how this will show let's drag that up a little bit and okay compute a valid number of arguments and then we got opera and zealer we got balance parentheses and we got some craziness going on here because all our parentheses looked balanced but what i did is i made this i was trying to make it easy for you to see in our initial thing so i put the commas in here it's not liking those commas so we got to get those out of there so i'm just going to go up here and we'll go into that and we'll take that comma out and we'll take that comma out we've got all the commas up yes so now yeah our red x is gone we're looking good but also i am going to copy and paste this and i'm gonna make this scaled ladder dent whoops so i'm gonna make a second one of these so this would be d-i-n-t [Music] and i'm just going to create that and i'm going to leave this as the default in one of the dent we're going to create a dent for it and i'm going to put that into the program um okay matthew so in the slick fi in rslogix 500 there was an scp instruction scale with parameters and so in studio 5000 there isn't you do use the compute but stay tuned because in function block yes we do have a scale instruction and so that probably would typically be my preferred way to do it i was liking these to start off with ladder because most of the people watching are just a little more familiar with ladder and so i always try to in the end in these situations i try to show multiple ways that we can do it so we're going to show how yeah there's a scale instruction and function blocks work super easy but you're going to run into this you're going to see this and so that's why i like to do this that way you you'll get familiar with okay this number right here yeah all right i get it but okay let's see what we got now so first we're seeing a value look at there we got 20 milliamps so we have 20 milliamps in both of them and yeah if we look on our screen yeah we're showing 20 milliamps here and if we go and let's drop down this is where it's going to show a difference in fact let me get back to the screen is i'm going to drop down to 19.9 milliamp and notice that i dropped to 19.89 which pretty close 19.8986 milliamps here i dropped to 19 here and if i drop on down you can see that our real value it's following it pretty good i'm just gonna bring it down to 19.1 so now you can see on our analog simulator we're showing 19.1 and right here we're showing 19.00 something and yeah so we're really close but we're 19 here now i'm going to drop it down to 19 and notice that this one went to 18. so what's happening here is a double integer is a whole number and this is a real so it can have a decimal so we're having rounding because we're using the double integer now i was kind of waiting to see if anybody popping in chat but it doesn't look does anybody notice anything strange that at 18.99 would that be at 18 milliamps does that seem like some funny um rounding to anybody see if anybody's actually listening to chat because remember we're we're going to give away what i know michaels michael's over here told me we have a bad latency at the shop so you got to give everybody 10 seconds so yeah we'll take that 10 seconds to say hey don't forget participating in chat today will give you an opportunity to win this sim alp2 uh this is a demo model it's a little bit older version but still has all the same capabilities but yeah so we got some truncation but we got some weird truncation going on don't we because typically you would think it would round we would get at 19.9 or here's the math we're going for 18.899 milliamps you think that we would get 19. we'd have the value and so yeah we got a few people that are seeing truncation here this is actually rounding and you know the first time i saw this i was like what is going on could rockle really have forgotten how to round because really yeah above 18.5 you'd think it would go to 19. but what's happening is here is we're getting rounding in this compute statement and i'll show you how to fix this because sometimes you do need to go to an integer in these cases or a double integer if we're shooting across my bus now typically even then i would go to a real first and then i would go to it but watch this so you see right now we're showing a value of 18 here and mainly let's let's make sure you see that let me go back here and make sure you see haley if we go down to 18 and a half milliamp there's where we ought to see it bouncing we believe between 18 and 19. but if we go over here then yeah we're not we're a solid 18 yeah we're 18.49 here but okay yeah so jack you yeah it could be whatever operates but no this isn't so what it is is glenn is kind of onto this is yeah you notice when i entered this we put all whole numbers in here now watch this thing so now what i'm going to do is i'm going to go into this and oh man my screens are so messed up i tell you guys i'm really struggling because all my screens are backwards but okay if i go here and i change this to 32 77.00 and i change this one to 20.0 and i change this one to 4.0 and i change this one to 16 383.0 and i change this one to 3277.0 and finally i change this one to 4.0 this is the exact same equation and i'm still going to a double integer that cannot handle any decimals but watch this you see right now it's showing 18 right and we have not made any true changes in the values here now i'm going to put this in and okay it's showing 18 still so yeah at first you're like what it didn't really make any difference but watch this so right now i'm at that 18.5 and also if you look here we're actually at 18.49 and so our math would round down to 18. so now what i'm going to do is i'm going to go up to 18.5 and the moment i do that notice this went to 19. so now we are seeing rounding like you would expect right now we're at 18.49 and we're showing 18 and we go to 18.59 and we're going to be at 19. so that's just something to be aware of is that you have to watch out for the decimals even if you're going to a whole number and you're like oh well you know i'm um i'm using whole numbers here so i don't need to put any decimals in it does make that difference so that's just something to be real aware of on that all right so let's take a moment here in one if you will take a moment hit that like button subscribe to our channel don't forget we're giving one of these away so you know i get so many emails after these live streams saying hey i thought this would be a dumb question there are no dumb questions and hey here's the thing if you ask the question you're going to get in the running for a plc tools sim alp2 i'm going to drink a drink of water here because yeah i'm getting tongue twisted michael how are we looking over there and i will take a moment because you know i did say in the initial stream because um we were trying to fill it and hopefully the power would come back on but really we could not do these live streams about michael you know everybody's like will you figure well you start doing live streams so you know we can you know kind of have a little more immediate question response and like man i don't know how to do a live stream he figured out how to do all this he figured out how to make it where i could change screens and i could pop over to this and i could do all these things and you know i couldn't do this without him and this is actually his last live stream he's going back to school um so the summer is over and amber will be taking over so he is diligently training her and so it should be interesting we should have some good entertainment with amber probably a little more commentary than michael mike is a little quiet over there no allow me to speak i allow you to speak sometimes let's see jack um i work in that acquisition use your two-wire to use device as two-wire source not quite understand that jack um it's the it's gonna depend on the specific device and so in this case um you know this can simulate a two wire or four wire device and but it's going to be very dependent on the exact device that you are simulating that you're integrating with on the data acquisition there you go michael yeah you're not allowed to speak everybody who's ever been on one of these live streams know that you you have a quite of opinion sometimes but okay so we now have some scaled values here and oh hold on let me go back over here and sorry the next thing we need to talk about probably is what happens if we had trouble now what if like even now let's say we're looking at these values right here we see that one of these is 18 and a half and we see that one of these is 19 and we're like i don't know which one is right and we want to measure it measuring a 4 to 20 milliamp signal may be one of the most difficult things that you have to do if you're not familiar with it because one first of all people want to go and they want to get a current meter and we had a current meter sitting right there at the training facility to show you but you know they have the clamp meters and you stick them around a wire those do not work for measuring milliamps they work for measuring big amps so if we had a motor and we wanted you know its full load amps was 12.3 and we wanted to check it we would use a clamp meter to do that aside from some of the high end flukes they do have one and you can tell it's a small little clamp smaller than my pinky finger or probably probably the size of a pen those are clamps for milliamp signals they're expensive and they're actually unnecessary because we can do that with a typical sure i got the right meter with a typical 10 meter as long as we can break the loop so now we want to check the loop so if we go and man the screen lighting just isn't yeah our camera is just not as good on this and hold on let me see if i can find a picture of this really fast so i can explain yeah the lighting everything is better down at the plc lab it's just set up for that and honestly we set up you know everybody used to complain about the lighting here but you need to remember we're usually building control panels we just cleared this whole place out really fast so we can move this down here but if we go and look okay and actually yeah we're going to get real cheesy here here's a here's a video i did that had um had the meter in it and so we're going to zoom in on that there if you want to know how to use a milliamp meter here's um whoops here is how you can um oh there we go there we go then we got a picture of this meter and this is going to be your typical meter that you see and over on this side you see that we have these down oh you don't see anything i'm doing that michael are you paying attention to the chat are you playing with your phone right now okay you are yeah holy chat okay sometimes all right well there we go uh let's see john the rounding down seems like a bug that needs to be fixed uh no so you know the first time i saw that really i worked through it i'm like why is it doing that but if you work that on a calculator and round up and down like you're supposed to without decimals you'll come up with the exact same answer they do so they're rounding right it's just a matter of without those decimal points you specify a double integer on those numbers so that's what's going on there but okay right here is a typical meter let me get over here so yeah oh and since that popped up yeah don't forget to um subscribe to our channel can't get it to stay there but yeah hit that subscribe button like our channel and we put out at least one automation video a week and this is a typical meter right here so on this side you see that we have a v signal and then we have a line and a dashed line underneath it and this is going to be dc volts and then over here we have a v and then we have a squiggly line or a sine wave and that's going to be ac volts and dc stands for direct current ac stands for ac current so this would be the 24 volts and that is typically on our trainer and this would be you know our wall power or motor power things like that but okay and then over here we have ohms and those are the ones that most people are familiar with they can handle really we'll call it they can handle you know the you know 60 uh sorry on 200 degrees of the meter and then they ignore most of this other stuff over here because we got this transistor thing that honestly i would have to pull the manual out and figure out myself but yeah we can check transistors we can check pnp npn and i have no idea how to do it without a manual but then we have this amp side here and the amps right here first we have micro amps that's what that u thing is and then we have two milliamps we have 20 milliamps and we have 200 milliamps and then unfortunately in this picture it's not going to show the bottom here so let me switch to this and hopefully it'll come in clear enough and then i'll pop my leads off here we have three leads on this meter but obvio i mean sorry we have three man that is just horrible guys oh there we go and get a little glare on it that's close sorry about the lighting and everything um but we have three posts on this and so we have our common and then this one says volts ohms and milliamps and then this one says 10 amps so first is where do your leads need to go and this is different depending on your meter so in this case we still want to measure milliamps oh no i hate the a glenn well one man i'm you need to use your milliamp you need to use your meter more often or your analog signal world but you're right um yeah that would be bad if your um batteries start to leak so yeah you probably ought to take those out but okay so we're gonna we need to go to volts ohms milliamps here and then in this case this one needs to get a common now here's the trick to measuring a milliamp signal and this actually goes for both for our four wire and for our two wire is if we go and look at how we measure one is this right here is how we're so this minus this right here this is what we had before let me pop back over so we can just see this was our basic two wire whoops popped to the exact same one where'd it go up get over here my screens are backwards man everything left needs to go right everything right needs to go left but okay so this is our typical two-wire setup that we just made is now we want to measure this is what i see a lot of people do is they're going to put the plus here and they're going to put the minus here and try to measure this and there are a lot of pitfalls to doing that we'll talk more about that in a second i'm sorry they would actually do it here they want to measure this milliamp signal they're going to hit they're going to put their plus or their black lead here and their minus their their i'm sorry their plus or the red lead here and they're black or their minus lead here and that's not how you measure a current signal and that's what you got to think about is what are you measuring if we're measuring voltage that's what we do we would check between the points that we want to see the potential voltage of but in this case we want to measure the current that's moving through this wire and in that case we're going to need to break this somewhere and said to do that and unfortunately i don't have the right i had all this printed out if we left at the plc lab but this is almost it is we're going to need a second analog input and we're just going to cut right into it so right now we have that sensor which is our analog simulator and we're going to put it to the red terminal of our meter which is the plus of it and then the minus we're going to put to the plus of our next one so we're looking here is i have our 24 volts you know no matter what you do wires always end up tangling there we go so we have the plus 24 volt going to the black terminal here and then right now this one is going to our plc unplug so what i'm going to do is i'm going to remove first i'm going to put my meter on milliamp and we are going to take one this wire is actually we're going to connect to the red terminal of our meter now i'm going to get the black post here i don't know what you think they did back to our meter which one let me make sure you see that every time we take a wire loose we get i'm sorry this is not zooming well but we get this open wire banner here and that means the alp2 knows that something is wrong in this circuit and that's that's one of the best troubleshooting tools about it so now i'm going to put that back into there let's see wires untangled oops okay so we're gonna have a lesson a second because we have meter x that's for just a second i grabbed the wrong meter so let me pop this back out and let's grab the non-x meter and we're gonna do the same thing so there are red wires gonna end up on our red post and our black wire is gonna go to there so now this one to 20 milliamps and one just so you can see for the moment yeah i need like 10 hands for this but the moment that i touch this wire to complete our circuit that open wire message goes away so that moment it knows okay we're ready to go but okay now i can see that my signal says 18.51 amps just and i think the backlight does not work out whoops backlight there we go so you can see right there is 18.55 milliamps now again you got to remember this is a 10 meter but if we go and look that should be pretty close and yeah we're at 18.59 milliamps so when you want to measure a signal then you're going to want to take the loop loose and put your meter in between it now here is the issue and this happens and here is what the x meter is for is i'm going to take this back off and we're just going to substitute meters because i get tired of changing fuses and meters to show this is an example as now as i'm going to do i'm going to put this one back exactly where it was and let's say oh man i think um that's not the problem and now i want to check voltage and so without thinking i go over here and i'm going to check 24 volt so i'm going to put my black lead on the plus i'm sorry my red lead on the plus my black lead on the minus and i'm like oh well why don't i have any power and i'm like my plc is powered up and then i look i'm like oh man i forgot that i need to change the voltage so i switch it to voltage and now i test it and it reads fine but the moment that i touch the plus and minus to this on milliamp i believe the fuse in this meter and what i've done and i keep this i keep this set up just for this is inside this meter for that milliamp signal there's a little five millimeter by 20 millimeter fuse and if we look at it it says that it has a 500 yeah you're not gonna be able to see it let's show up on that um screen capture let me go up here because i'd love for you to see this this is important yeah so right here oops there we go you can see that it says it's a little fuzzy but this says 500 milliamp max fused also notice this one over here is unfused so you're going to blow the meter if you're on this one and you go over 10 amps but so 500 millimeters well my power supply is capable of putting out two and a half amps so the moment that i check that it's going to blow the fuse in our meter and this is one of the most difficult things to get people to understand is i just showed you yeah now i can check voltage we got 23 volts and i can also check amps works perfectly but it is not going to work on this milliamp scale and everything else will work perfect so the next thing people do is they're like they get there they go and let me plug this back in so you got the wire right and they are sure they have this thing wired right now put that back on mill amp and they touch i got it hands here and yeah we're showing almost perfect zero on our milliamp and yeah this is saying 18.6 and it's showing up in open wire and you know they call me and they're like hey something's wrong with my simulator it's showing open wire and we go through the schematic and their schematics perfect and i'm like check the fuse in your meter and well actually this is a funny here's a funny side note is you know somebody has somebody has this 10 meter here and i tell them hey your fuse is blowing in your meter they're like okay let me run down the hardware store and grab another one you're probably right somebody has a fluke meter those are the ones that always get me is there like i have a fluke meter and it has a 38 dollar fuse in it i i've read the manual front to back i know how this thing works and i'm like i'm glad you've read the manual go to the page that tells you how to change the views and change it you blend the piece in your meter and yeah 10 beater people there they're like yeah i probably did you know you got a fluke and i i promise you the fuses blow just as fast in a fluke because you know fluke is gonna they're gonna protect their equipment so it'll blow those fuses those 38 fuses as fast as it'll blow the 50 cent fuses now here's how you can check your meter and i don't know why it took me like 10 years to think of this and i don't know why no meter manufacturer does this but okay so i have this one on 20 milliamps now we know that the fuse is blown now and just like we would typically check a fuse we'd use ohms well if i put i have this one on milliamps and i take my other meter and i'm gonna put it on ohms and unfortunately if this one i think i grabbed oh no bit beeps too now i'm a touch so i need a ton of hands for this one but now i am going to touch these and we see it's open so you can take a second meter and ohm out the one that you think is bad because now i'm gonna do the opposite i'm going to switch this to 20 milliamp just like we want to measure and i'm going to um it with this one so now same thing if i can get this juggle knocked down shove that up there because this is the one we're concerned with because remember our bad meter will measure ohms i touched two leads good grief i touched two leads there i touch the other two leads here and this one's good so there's how you measure whether your fuse is blown in your meter without having to take the cover off of it but there okay so there's a little bit about how to measure a milliamp signal for that let me put this back just like it was because now yeah let's talk about you know we got we got this thing scaled what can we do with it so plug that back in there and last check and make sure this still works so we're showing 18.6 and mainly we're not showing our open wire banner now and if we go here then yeah we're showing 18.59 so we're looking good here okay let me catch up a little bit on chad here so let's see yeah jack you're right um you know and it did it took me forever to think of that i had no idea why it was like so obvious once i thought of it and yeah i couldn't um i just couldn't come up with before that let's see another problem john another problem that caused this well yeah and that's something we talked about at the beginning of this is you've got to know whether you need a four wire or a two wire and you know the manuals are not super clear on that you know when we go pop back to this manual here i mean this is really difficult i mean if you if you're not familiar with analog signals and you're like hey i bought an analog 4 to 20 milliamp sensor first of all you do not specify when you're purchasing one whether it's two wire four wire it's something you figure out later and so i mean there there are a lot of hoops to jump through that really are difficult when you haven't first done it but okay now that we have that and we figure out a little bit how to measure it we need to do some programming with it and okay we've got a pid series and i don't think i want to go there today what i want to do is what i find a lot of people first thing when they do analog is they're like okay if i have discrete inputs i have to use discrete outputs if i have analog inputs i have to use analog outputs that's not true i mean analog input is going to read something it's not anyway linked to something outside so we can use an analog input to make decisions to control discrete outputs or on off outputs and we can use discrete inputs to control analog outputs and i think i have a video on that if anybody's interested in that let me know i will find the link to it but okay so now we need to do something and do some programming and so we are going to use well since i left half of our setup down at the training center we need an indicator and yeah we're going to turn this green light around and there you go we have an indicator now so this is what we're going to control so oops i'm going to hook one wire to one side of this light this is just a regular light that has actually doesn't even have a plus and a minus it just has two um terminals and there is no polarity on this particular model so i'm going to take one of those wires and it's going to go to the minus of our power supply and i'm going to take the other wire and i'm going to put it to output zero now we're not i'm not really going to go through the wiring on this um because we have a lesson that talks about discrete learning on the compact logic so let me see if i can find that real quick just in case somebody has a question about it let's see reset okay so here if you have any questions this one is discreet wiring to a compact logix there you go just in case you have any questions about what i just did okay first thing we need to do is let's make sure since i did this on the fly let's make sure this green light works so i'm gonna open up my controller tags and we are going to go to local colon one because this is let's make sure we understand that we won't take about a second but yeah so this is the base of our plc so this is one and then we had two three and we found four already and we have five so i want local colon one colon outputs and then data of zero so we go here and we find local colon one colon o dot data and then i want zero here and i'm gonna put a one and that and a little small over there in the corner but okay yeah we have a light on and if i put a zero back oops good thing michael hadn't left yet because i just about shut the live stream down um i put a zero right there and you see it goes off one back on and let me just make sure just because you may not be familiar with that all i'm doing here is in our data box in the controller organizer i now have a one lights on zero lights off and i can go back and forth there i'll leave that off now so now first let's change our scaling a little bit because typically we would not program with 4 to 20 milliamps in other words we're going to have some type of real scaling in the end and so if we go back to here what we're going to do is we want to change our scaling so right now our milliamp equations right here this is what we're doing so if we want to change our units we need to substitute the 4 with our low value and the 20 with our high value and we are going to do a tank level here so again a tank level and this in this case we're doing a pressure sensor so tank level pressure sensor and this one for this one will be 0 to 10 psi and on all pressure sensors 1 psi equals 2.31 feet and so that's what this is going off of we're getting zero to ten psi we're going zero to twenty three point one feet so now everywhere that we have a four which is there and there we need to substitute a zero so that's there and there and then wherever we have the 20 which is only right there we need to substitute with this 23.1 and that's how you can change your scaling on really you can change it to anything that way so that's why i like starting with the live zero when we're doing this because okay let's say we had what's a good example like an orp sensor those are usually like minus 1000 to plus 2 000 something crazy so they do have these offsets that you've got to deal with they don't go from perfect zero so now you know how to do it without going from zero but yeah in this case we're going to go over here and one i'm just going to delete out this then that was just to show you why you need to use a reel and then right here oops oh and okay you notice that yeah um right here where is it right there we're going to move this to 23.1 because that's going to be our high and then we have the 4 right here that's going to get a 0 and this one is going to go to 0. so that's going to give us 0 to 23.1 let's go and put that in and make sure we see that make sure it's working okay norm yes norm's right only um for a specific gravity of one i only work with water but norm's right if you do that and you have molasses or something or you have something insanely light probably um probably even alcohol or something you know that's very under oil or anything then that does change so yes for water it is gonna be a specific gravity of one but okay so let's make sure this works and so i'm gonna go let's go back and look at the analog simulator and one just y'all don't even understand how crazy my screens look right now i am going to make a change to the analog simulator just so that i can kind of look at the screen is i'm gonna go up here to settings and first i'm gonna change my range because right now i have it on zero to twenty but we're actually only using four to twenty so i'm gonna change that to gosh my wires are short four to twenty and then i'm gonna go here and i'm going to change my eu scaling and i'm going to make my high engineering scaling i'm just going to make it 231 that'll get us to 23.1 just so i can look at the meter and not have to like look in a crazy spot for this while i'm trying to show you this so i guess it's the 23.1 and then our low four milliamps is going to be zero and mainly now if i go back to current two wire then you can see [Music] that at 20 milliamps we're showing 231 or 23.1 and we can drop down to four all right and it shows zero so four milliamps we're showing zero here and if we go to our screen then yeah we're bouncing between zero and some number that has that e and minus thing on there which means it's a super small number and that's all we're going to worry about in this video and now i'm going to bring this up to 20 milliamps and when we get there then we are going to show yeah 23.1 or right this thing's right on the money so that's how we're going to simulate our tank level let's see what hold on sean what's back to watch for on power supplies that have reliable readings from four to twenty million well i'm not sure if folly as long i mean really it's a four to twenty milliamps so the maximum consumption is going to be 20 milliamps on that now there now different voltages are going to be different um ranges i mean let's kick that can to the end here and we can um we could play with ohm's law a little bit and show mainly you're going to have a load resistor every you know every uh analog signal actually reads a voltage and i do have a video on that if anybody's interested let me put let me put the link to that video because um you know there are actually no true milliamp sensors out there everything reads voltage so let me see if i can find that one really fast it's been a while since i looked at it okay here we go now that's how to wire it well somewhere i had that well i may not be able to find that fast enough actually i guess i do talk about that i think i've already posted this one really it is the one about the load resistor that's probably the best one is your um is how is that yeah none of them actually read a milliamp signal so the same one of reading 4 to 20 milliamp that one right there kind of explains that's that because yeah okay you can actually um if you have as i watch this statement because unlike a potentiometer so if we had a potentiometer yeah we do have it maybe we'll wire that if it really comes to um a question if our power or our 24 this case if we had 24 volts if it dipped the 23.9 it is going to throw that whole scale off but this is one of the advantages of 4 to 20 milliamp is as long as it is capable of driving that current your voltage can go from probably 12 volt all the way to 28 ish volts and it will actually regulate the signal the exact same so that would be a neat video that's not going to be for this one but if i was to take yeah it's at the training center so like at most everything is that we need right now but um if i was to take a variable voltage power supply and connect it to the milliamp signal and send the anti-log simulator in two-wire mode then as i vary the signal i can probably go from 24 i can probably dip probably to 18 17 16 i don't know i don't want to throw any crazy numbers out there but i can dip that voltage it will not vary the signal that we're getting uh yeah matthew um you are right and in that video explain that um on a 250 ohm load resistor you are getting a one to five volt now also you'll see some of them use 125 ohms that's going to be a 2 to 10 volt so yeah matthew is right all any analog current input does is it reads a voltage across a very high precision load resistor and i kind of explain that through there let's see what could be the reason when a high level sensor tag value is reading negative and still end up showing zero and the tank is empty well it's probably scaling um and i mean even now if we just go to here and i just take the wire off of this look we're going to show minus 5.73 volts here so you're going to be negative there but now we put the wire back on because yeah we have the open wire lead that's pretty obvious but even in this case okay well actually i'm going to have to make a little change for this one as you remember i just i just changed this to the scale of four to twenty well before that we were on a zero to twenty two milliamp scale so if i go back to ranges current range and i'm gonna switch it back to zero to twenty two milliamps that's going to give us our full range and now i'm going to go here back to current 2 wire and all right we're at 20 milliamps let me bring it down to 4 milliamps and okay four milliamps we are showing right at zero i mean we're showing one point seven six to the negative three but okay let me just drop the three point nine okay now we're showing -14 and yeah let me bring it down actually a very common one is three point two that's going to be a minus one and a half and that actually does usually mean something is wrong with your transmitter two um ones that i don't talk about a lot is 3.2 milliamps and 21 milliamps those are two you know when you have a 4 to 20 milliamp that's your normal operating range but you can have 21 and almost that means something's wrong with something connected to the transmitter and then usually 3.2 is something's wrong with the transmitter so and yeah those you kind of have to look at the manual but okay we want to do something now with this thing we've got a green light wired up here and yeah okay as cool as it is to watch these values run up and down we we need to run a pump yeah that's we're going to do we're going to run a pump because we made this a level and we'll make it a sump pump and i see this a lot is the first thing somebody wants to do is okay they know they need to compare so they go to the greater tab and then we're going to bring down a grader let me bring down a new wrong and we're going to compare something at this pump if this sump is greater than oh let's just go for 12. just throwing a number at it if it's greater than 12 then we want to run our pump so we're going to look at our scaled ladder and our source b is going to be 12 and then go to our favorites tab we're going to bring down an output energize and we're going to energize local colon 1 colon o dot data dot zero oops oh zero and let's put a description on that of pop actually let's let's let's make this realistic um let's change that description let's make this our expensive pump just so we can have a little emphasis to this and so now we're going to put that in there all right and all right our mainly this is going to work exactly the same we've talked a lot through you know go look for one go look for zero this is going to look is the scaled ladder greater than 12 but it is it's going to pass true right now it is less than so it's going to pass false now false output energize is going to go right a 0. and so now i'm going to bring our analog simulator up and we see our value coming up so this is just like water filling and a sump and we get it close so yeah we're coming up six oh and i forgot hey um let me just show you what what i'm doing is yeah i forgot that i i just switched that scaling back i was like my numbers aren't lining up but okay so you can scale this 0 to 21 milliamps and that's what i switched to just to um show that i'm going to switch my range back to 4 to 20. that way now mainly i'm looking at this bottom value here and so we're at 12 million oh got to go back so yeah i'm going to change that back to 23.1 just so i can so i i can kind of look the right direction and still see this value which just comes in handy let's say that um let's say our sump pit wasn't right at our plc this kind of lets us know what value we're simulating and mainly now if i go back here okay so we're showing yeah 10.39 feet on this and if we look here then we're showing 10.39 feet so okay now we're going to bring up so we need to be close to 12 all right so we're coming up we're at 11.6 feet and let's just see how lucky we get because this is kind of difficult to simulate sometimes for 11.98 oh bring it up one more oh man guys you are not looking out for my mistakes uh this is local input zero so i am turning on an input here so let me change that it's like why is my light not coming on this should be local colon one colon o dot data dot zero so one let me take this description out yeah because this one is our inexpensive pump okay now we're looking good we have a green light on and i'm not going to get lucky enough to show you but okay let me adjust this value just slightly we're gonna actually here i'm gonna take this value we're gonna copy it and then we're gonna take this value and we're gonna paste it right here as you know honestly and honestly this is what i did on my first analog job it was for a heater and my heater lasted like a half a second before it was toast but okay you see what's happening our light is just blinking on and off and it's not doing that but yeah that's and that's what i see and that's what i did my first time i put that in there and yeah i mean that that heater was like done so what we've got to have is we've got to have a range and so in a pump slip situation typically you're going to have an on setting and you're going to have an off setting or a high setting and a low setting and so that's what we're going to do first here is we're going to change this is and actually let's go through some of the things i see done here because okay i want this to start let me put this back into honor let me get a drink of water here and yeah i haven't said it lately but yeah one don't forget we are giving away an analog simulator two participants in this chat or two excuse me two a participant in this chat so all you have to do is participate you can't say hi you can't say anything like that i mean please feel free to say hi to that doesn't qualify you for it but we're going to select somebody at the end of this for an analog simulator and don't forget to subscribe to our channel we put out at least one automation video a week and also we're trying to do these live streams once a month right now to see you know that way you can kind of get some immediate feedback you can ask your questions and normally we'd be at the training center and i can set up something really fast for you but right now we're we're making we're making lemonade out of lemons right michael okay so now i know i wanted this thing to pump when it's at 12 and then i want this thing to stop when it's at we're gonna say five feet and what i see people do and again make sure you're watching all this because this is not how to do this is i'll see people go here and they're like okay i wanted to stop at five so let me go and grab a less than instruction and i'll see less than five and they'll put that in there and yeah this is gonna do the exact same thing it's doing right now so is 12 less than five well pretty much never right now but this one right here is still going to cause this thing to flash on and off when you're never at a point oh now i did change that to 12. so it's not going to flash on and off i know vincent it is evaluating this so an analog signal is never going to stay exactly where it is and that's what i did let me put that back just so you see that um is let me copy this value and you can even see it it's occasionally changing and what i did was i pasted it right there so i did i put it right on that threshold and if we watch this then it occasionally is dropping down well now that we're done yeah and back here you're not even here should we go on this rabbit trail okay yeah let's let's let's talk about that vincent okay so we see this erratically changing but you're right right here we do not see this value changing well what you can do is let's right click it i'm sorry you can't right click it again you gotta right click the scaled ladder and then what we can do is we can trim the scaled ladder and this is going to give us a cl a faster sampling right now this is not real time i would not call this real time but now we see that we're getting some variation let's right click it and go to chart properties and if we look at our y-axis then we can change let's put some custom i'm sorry not custom units we're looking for decimal places i'm just going to put two let's put three decimals i think that's enough to show it and okay now we can see this is bouncing between 12 i should have changed my scaling out go back here let's go to the y-axis and let me bring this out to i don't know 30 seconds ought to be a 20. okay now we can see see this thing is not no analog signal sits perfectly so this is occasionally dropping below our threshold and occasionally going above our threshold so it's not really having to do a scan time as much as that analog signal i mean even the most perfect analog signal is going to drift some and so that's what's happening there and so all right but let's put this back because here's what i see people do is they want to fix this actually will you see it right now let me cancel out of this as they try to get this to work because they're like okay i just need this pump to stop so you know now we're going to be at the 12 though let me bump it up a little so now we're solid running our pump starts emptying and it drops back down now what people do is they're like oh well i must put that in the wrong place and they throw it up here and you know they put that in there and i mean i see that every training session we do we see almost the exact same thing every time then they do this and they're like okay well now it won't run well let's look at this this says if it's greater than this 12.4 and it's less than 5 well can the exact same number ever be greater than this in less than this actually i can do that that's for another video but in this case this can never be true so this is always going to be off and here's where you've got to begin to think about perspective that's the word i always use is you know what did i say i said i want this to be on at 12 and stop at five and that's what you know the engineer is going to tell you that's what you know the customer is going to tell you but we don't have a command okay well it actually um i wouldn't do that um so i wouldn't use a latch and unlatch in this case but okay no scott i would not use a latch unlatch but all right thank you for uh thank you for putting that in but okay the main thing michael are you still on over there you're starting to zone out michael is just staring at his phone now but that's okay we're running pretty good i think michael what are you doing i'm paying attention i'm glad you told me that um that scott and vincent had both put those questions in thanks so much but okay what so what i said is so what i said and what the customer says is gonna ah jeff no we um would not use a limit there and i will show you why let yeah we want to say it save that limit yeah because no that won't work either um we want it to start at 12 and we want it to stop at five now we do not have and now we could use lots and lots it is kind of a stop but we don't have a stop instruction we only have a run instructions our output energize that's what you got to think about is when do you want the expensive pump to run or in our case the green light so we know we want it to run if it's greater than 12. but what people do is they're like okay well i know that other one's got to be less than and they throw that last thing out there from the perspective of running the pump we never want the pump to run when it's less than five so there should be no instruction in there that has less than five making that output true so that when we know it needs to be greater than and if we flip back over here that means that okay if we always wanted to run when it's greater than we know this one needs to be greater and then yeah it kind of you know get most people get it to right here and then they're like i don't know what to do jeff we're going to come back to your limit because your limits going to do the exact same no we are not going to use a delay timer um that is absolutely the wrong way to do it and i do see it done that way and there's lots of issues with the delay time because mainly i want it to run between 12 and 5 period but okay they get it to here but here's the thing you gotta think about it is when do we want this pump to run we want it to run when it's greater than five i mean okay we said stop i'm sorry greater than 12 and we said stop less than five so we wanted to run this greater than five and if the pump's running continue to run until as long as it's greater than five let me put that in there just so we can see that so we've got this part you can change this back to 12. so 12.0 so we're going to run if it's greater than 12 that's going to get us starting to run and we want it to continue to run as long as it's greater than 5 and the pump is running all right well let's let's see if michael's delay thing works so i need to wait 10 seconds what how can we know that our pump is running does any can anybody tell me do we have any instruction to know that our pump's running you got to 10 for me keep him awake he's starting to die he's getting hungry had that 30 had a 30 minute delay oh my goodness he's leaving [Laughter] okay how can we know this pump's running well we've got instruction to do that we go over here to our favorites tab and we have this examinative on there we go scott got it yes i had an xrc that's it right there there we go there you go all right norms get it also so we're going to go here and we're going to put this here and so this is going to make us run in a range so now first notice our pump's not running so we started a good place right now we are let's see yeah absolutely vincent you're absolutely right but okay so right now our compliment we're at 11.8 you can see there it's for 12.2 milliamps and don't know if you can see it perfectly there but that is 11.8 feet and if we go over here we can see that just as well as right now we're our ladder scale is at 11.8 feet and it needs to be greater than 12. so right here this instruction is going to look if it's greater than 12. is this greater than 12 no this is false so this gets to right here and one thing we haven't talked about in a while is once it gets to this leg right here it does not move on depending on the condition so if this was true it would not move on it's still going to come back to right here now it's going to evaluate this is this scaled ladder greater than 5 yes it is so this is true and it gets here and okay is our expense of pump a 1 and we can mouse over just to make sure it has a value of zero so no so this is false now for this to be true we have to have a continuous half of trues from left to right and we don't so a false output energize is going to go right a zero to the green or expensive pump so now i'm going to bump it up and if we do actually you know this is where we were but okay we're at 11.98 bump it up one more and okay now we're at 12.1 and our expensive pump is running and we got this lower branch here and this is looking for this to be greater than 5. we know that was true before it's still true but now this has a value of one in it so it is true and so we have a continuous path of truth in the top statement and we have a continuous path of truth in the bottom and now but let's drop this down so i'm going to drop it down a few just so we don't get any bouncing and now we're back to that 11.8 so is the scaled ladder greater than 12 no so this is false and but it comes to here it's going to go to the next branch down is the scaled ladder greater than 5 yes so this is going to be true and then this instruction goes look for a 1 does it have one yes it does so this is true so now this bottom branch is true and it's going to keep our expensive pump running and so now it's going to start emptying our sump and yeah we're going to see it go down and we're going to get to let me get it close to five oh we're at come on there we go we're at 5.91 now let's just talk through this again and make sure that we still understand this so this instruction is going to look if the scaled ladder value is greater than 12. it is not so this is false we get here and it goes down to this branch and this is going to look for our scale value to be greater than 5 and it is so that is true this looks for one and yes it still has a one so this is true it says bottom branch is still true and it's going to write a one now when i drop this down just a little bit more it's going to make this go to 4.9 and so next one down 4.9 now this leo still it's looking forward to be greater than 12. it doesn't say this is false gets right here goes down this looks for it to be greater than 4.9 it is not so this is false and it gets here and it's going to look for it to be a 1. well it is not now and so since this is false it's going to go right a 0. so in this case all three of these conditions are false all right now here's the trick part to make sure we understand is now i'm going to bring the milliamp signal up back to 5 above 5. so again this is going to look for it to be greater than 12 it is not so this is false gets here it's going to go down and it's going to look for it to be greater than 5. well this is so this is true but now it's going to go to this and this goes and looks for a 1. well it doesn't it is false so this is going to be false and that means that this is going to be false and it's going to go right a 0. so at this point there is no way for this lower branch to ever be completely true until this is greater than 12 because we've got to have this top one to go and while we're at it just so we can see this a few times and i don't have to sit here and scroll up and down is while we're simulating a value i can hit the ok button and that's going to bring up a few options here and i'm going to go to this sweep cycle right here and we're going to go let me just make this really fast we have a sweep time and it's typically 20 seconds i'm going to bring that down to 5 just so we can quickly run through this and then we're gonna have a start value and okay i probably should have noted our value but i didn't so we're gonna just go from zero to 20 milliamps excellent well we know we're going to go from four so our start value is going to be four okay and actually let me look that up because yeah let's get this a little more accurate so we know that let's see we want to get a 4.9 just so that the pump kicks off right when we drop down that's 7.4 milliamps so i'm going to go back in here and we're going to go and our start value is going to be 7.4 that's our low value and then we're going to have a high value and so let's go back out and let's bring it up and i just want to see what's 12 milliamps i'm sorry what is 12 feet so 12.5 milliamps is roughly 12.2 feet so i'm gonna make our final value 12.2 milliamps and what this is going to do is it's going to simulate a sump now and so if it gets above it's going to just run between 12.2 and that just so we can watch this a few times and make sure so we're going to run this cycle and right away you can see that yeah our green light well hopefully i may need to pump that up yep i didn't get my scaling right oops yeah so my final value is too low uh it was i think it was 12.5 now let's run it there we go green light comes on we should see the green light go off okay now let's look in the program while we're doing that so we see it going down all right now it's climbing up that's a little fast so let me go in here and let's just change that scale that speed a little bit that's a little too fast to explain this i didn't want to bore you with it going up and down let's change that to about 12 seconds so that'll make it where it runs from top to bottom in 12 seconds and so now we filled up our pump kicked on it's gonna roll down it dropped below five now let's fill them back up kicks on and it keeps going back and forth hey scott um you know the vertical actually that would be like vertical you mean horizontal vertical tank capsule if it's round and it goes up then we're going to um use the same scale we have the horizontal one's the one that gets a little iffy but no this this scaling right here will work um as long as it's same shape up and down but you know it would be interesting to do one on different shapes and since uh norm brought it up i think it was norm a different specific gravities things like that um that would be a neat one i don't think we'll get to that one in this one okay has anybody got any questions on this part now what jeff kuiper brought up oh yeah okay gotcha yeah and that's what a yeah so yeah when it's not yeah that can get tricky all right jeff kuiper did bring up one thing and you know scott that would be a real i'm gonna make a video on that i don't think i can pull that off with the visuals i have right now i need to make some drawings and explain a couple of things but that's one that'll stump you now jeff kuiper brought up that we um what about a limit instruction let's do a limited instruction just so we can see how to do it too so let's just take our expensive pump out actually yeah yeah we're just going to test this one you're right vince this is exactly the same as a seal in and that's i think that's the thing to kick into people's heads here is this really is not that different than an xic as far as its evaluation it's going to be true or false and then the exact same thing we have that seal in here so whether this is an x ic of you know a float or we're looking at a level value yeah it's exactly the same all right so i'm going to take this out and we're going to change the structure which if you didn't know you can double click right here one you can right click and we can oops nope can't right click there you couldn't 500 you can't here you can double click right here and i can just type lim that's going to give us a limit instruction and we're going to put our test whoops i'm going to put our test at the scaled ladder and our low is going to be 5 and our high is going to be 12 and i see in this is something else you see people do when they're doing it but okay we're going to put that one in and we'll see how it operates differently oops i didn't want to finalize that because i want to go back to where we were as less change oh where was i let's just use the test button because i'm going to back this right back out so we're going to test that edit and okay the big difference you're going to see now is okay did you see that flicker let me um that's right right you've got it but let's make sure everyone else sees it as yeah did you see the balance there so now it's going to happen is the that time that it drops below 4.9 mainly it's going to kick off also with the limit instruction if the sump goes above 12 it's going to stop running so but that is something you see people program in so and that'll happen so the next thing you know they're at 12.1 and their output doesn't come on anymore and yeah they're their simulated sump just keeps going up now i made this one really limited for that so this works really well when someone wants to input a starting to stop now what i see happen though and you know some people you just have to deal with this on is especially on temperature somebody will say i want exactly 350 degrees well there's no such thing as exactly 350 degrees it's um it's gonna be a plus or minus something so yeah yes yes sean on that i think i i don't know why i haven't actually ever done that because i have some programs that deal with the round and the flat bottom and um and also the um oh my mind just went blank on the um tapered you know the the the cone style bottoms um but yeah that does change your level sensor and i've got some programs to deal with that would make a good video michael write that down okay but all right let's get this out of here so let's just cancel this edit and put it back like it was but okay let's say somebody says that and yeah it will be it'll be oh let's just make it a chiller actually um somebody has a chiller and they all and they want to regulate something to exactly 350. so just for the exercise let's make sure we understand how to change the scale in here so if we go back to the whoops pretty good i'm really struggling with my screens here they're the wrong direction okay so remember all we're going to do is change these to where these two values were to whatever we want so could you not use the pid you wouldn't need a pid for this fence and not for the um not to do the scaling we can do it with some calculate and that will that'd be a fun exercise i'm gonna do that one um because yeah we can get into some we need to do some fun math and i like doing some fun math occasionally not that often but occasionally but okay so mainly here let's change this a little bit because i just said we're gonna make a chiller so let's make our scale in 0 to 1 000. so mainly this 23.1 we're going to change to a thousand just to give us something else so we'll go over to our program we're going to go up here and where we have 23.1 right here we're gonna go to a thousand also this light flashing back and forth on me is kind of bugging me so let me show you actually let me show you a couple things on that i was getting ready to turn it off but while we're at it let's say that we're watching for something also we see it and that moment we see it we can hit the ok button we can freeze this or pause it right where it's at so it's at 11 milliamps now and it's not moving and then i can hit the ok button again and i can resume simulating so sometimes when you're trying to capture something really fast that's a very useful feature but okay for now i'm just going to hit the cancel button we're going to get out of all this just so that we don't see that thing going up and down but all right let's go back here whoops um where are we at there we go okay so that's going to give us 0 to 1 000. and okay we're doing a chiller right now so in the case of a chiller we're going to want to cool when our process variable is greater than something so same deal here it's going to be exactly the same as in this case i'm gonna the all right the customer said he wants 350 and that's what he wants now first and then here's where you know i got the here's my poor little heater application first time i ever mess with analog that's what the customer said it may have been 350 but he said we had to hold a precise value and so i threw that in there and as you've already learned let me get back in here and simulate a value as we're going to bring it up close to [Music] 350. and let's see if we can get lucky in about look at there and there you go here here is exactly my poor heater application is my light there it goes as every mine was flickering on and off like you know i have known many times but i've never seen um i've never seen a heater burn up so fast in my life um so what we've got to do is we've got to have something in there to to stop this chattering really and then what we're going to do is we're going to use a span but let's say the customer he only he wants to either he wants he thinks he needs us at 350 precisely or he only wants the operator to enter one number we'll have another hidden number in there so let's talk about how we can do that yes okay then we went through the limb instruction that's not gonna work uh yeah just uh later on you can back up a little bit here and yeah we went through that limb instruction and yeah that's gonna cause you all types of grip so here we're gonna use this what we call a span but we don't want the operator to enter the second value so first we need a we need a value here and um so let's make this our temperature [Music] set point oops where'd it go there went that point and we're gonna need to create that and we want this to be a real that we can enter a decimal if we wanted to but now what we want to do is we're gonna add something else because what we need to do is we need this heat or sorry in this case we're chilling make sure i get this i always get this backwards and okay um we wanted to yeah we're going to subtract we want it to cool a little further before we shut our chiller off now first uh let's go and change this it's no longer expensive pump this is our expensive chiller and now what we're gonna do is we're gonna go to our math tab and we're going to bring down a subtract instruction and we're going to take this temperature set point that the operator is entering and we're going to subtract it by our temperature span and we'll create that as a real number all right i think i got under control you want to go eat lunch all right get out of here all right thank you michael for all your help i think you as soon as he leaves things will go bad so keep your phone with you please but he's gonna go get launched all right and then we're gonna need in this case let's call it well this will be our let's call it our temperature kind of like off temperature off that's what's going to call it because i can't think of anything to call it right now and we're going to create that now same deal we're going to do that exact same ceiling that we just were using and now same thing make sure you don't throw there should not almost never should there be a posing here if you have a greater than in the top rung your bottom one's going to be greater than but now we have this temperature off setting which is our temperature turn off setting i probably didn't use a great description for that but that's going to be this bottom one and then yeah we're going to put our xsc back in just like we just had it and we're going to bring that down and okay so one let's put this in just like it is just so you see it's going to do the exact same thing right now because oh i made a mistake here anybody catch it actually in a crazy sense this actually would work but there's a problem here this is only going to do this subtract when one of these statements are true that's not good that can cause us some issues so either this needs to be around the whole thing or on its own wrong so i'm going to bring another rung down and i'm just going to drag the subtract come on my computer's choking up on me bring this subtract down to here that's what i should have done take that branch out that way our span is always calculated put that in there okay and now let's put our temperature set point in because we need a set point and our customer said 350 degrees so there we are and first if you can't see it anyone noticed it maybe you can see in the corner here our green lights on but occasionally this light's blinking and you're not seeing it up here remember that this is not perfectly real-time representation so if we go here we can see this is blinking and that's because we have our span at zero right now now so what we're going to do is we've got to figure out a span that one is going to be acceptable to the customer but also it's going to save our equipment because right now we're hammering this thing on and off and the less on and off transitions we can make the longer our equipment's going to last so we want to go here and for now i'm just going to throw 20 in here again just so we can kind of see that what's happening all right so now let's look at this so this is 350 we already saw this is occasionally dropping at 349. so this greater than is going 1 0 1 0 1 0 which is changing this beforehand but now we have our lower branch again and now if it's greater than 330 this bottom greater than is going to be true and if our expense of chiller is running it's going to continue to run so what this is going to do is when our temperature gets above 350 it's going to kick our chiller on and now we have this span here and that's going to keep us running until we drop down to 320. so we drop down we'll bump back up on 350. let's see if we can get kind of so there's 337 343 and there we go 350 pump comes on we drop to 343 again pump stays on our expensive chiller stays on and yeah 331 and they are 324 it kicks back off so that's going to keep us it's going to save our equipment and really you want to almost i hate to say it you want as much spam as possible and you can stay with intolerance that's going to make your equipment last longer now we could also use some solid state things here and some pids and we have a whole lesson series on that but right now we're just talking about some basic pumping now while we're here let's talk about what if we wanted to run a heater because it's going to be exactly the same but in the case of a heater instead of us trying to cool or us looking for attempts to be greater now we're just going to look for it to be less than so let's edit this round just so we can see it let's change that to a less than and then same deal whatever's in that top branch if you're doing some type of latch or a seal in here it's gonna be the same thing you want this bottom one and then let's change this description this will be now our expensive heater now the one thing you have to pay attention to is now the span in the next rung is typically you want now this would actually work this will work just fine but what you want to do is you want the set point that the operator to enters to be when he sees that on action it's going to keep him from asking questions so in this case i want to add now so what we're going to do is we're going to we're going to heat we're going to kick the heater on when we're below a temperature and now we're going to keep heating until we get above a certain temperature let's throw that in so you can see the values change on this because all right now our high is 370. now again this may be way too much range you only be like well who wants a oven that's between 350 and 370. i'm just making these values wide so you can see exactly what's going on but all right now our span is going to be we're going to start if it's greater than 350 and they're going to keep running until it's at 370. so we're at 324 right now our heater is running so our heater is running it's going to start raising our temperature and we're going to get there's 350 there's 356 we're still running now note at this point though 356 is greater than this temperature set point this is false this one is true and we're going to bump this on up and there you go when we hit 375 heater goes off now that's going to coast back down 349. and it's going to go back up and crack down lastly john pid is good if there is a delay between the input and output especially when things can never shoot like temperature yeah and you know so um you know that actually it's not on my list but so you can have we'll call it a pulsed output and you can actually have a solid-state relay that's kicking on a heater that's not that uncommon um as opposed to a four to twenty signal so i should add that to the pid series but okay um hold on a second somebody's coming they must be going the other way around okay but um all right so that covers the heater that covers chilling okay let's talk about a couple other things though so yeah one um early on and yeah it's been too long now i can't even remember who it was but uh somebody asked well where is the scale instruction there is no scale instruction in this in studio 5000's ladder logic typically you're going to see you could see some math things down there are many ways you could do it but what you can only see in a way i really usually if i'm doing something like that there's several reasons to need function blocks now nowhere in that statement did i say i would write 100 function block program but what i'll do is we're going to right click add a new routine and we're going to call this routine our function block and we're going to make that type a function block so now we've created a new routine open it up and this isn't an exercise in um program flow so i'm not going to go too far on this but mainly we see we have no green here we have no green here that means that there's no possibility of this being scanned and actually maybe can i verify this while we're online i think it's going to give me the warning again i didn't i didn't point out that warning warning function block routine cannot be reached by main routine and what that means we need a jsr up here in our main routine so i'm just going to go here i'm going to add another rung and we are going to put a jsr and we're going to go to that function block routine that's going to get that one scanning also just so we can go through the hit the basics i'm actually going to change our 4 and 20 we're gonna go back to four and twenty here so we're gonna have four and this will be four and then this one is going to be twenty and that'll us put it back at our four to twenty milliamp scaling and then yeah before we get it further let me test that so i go up to 20 milliamp and that is going to give us 20. can you believe it's starting to thunder here are we really going to have another power outage okay but we've only got a few more things to go here so hang with me i know the power goes out again guys i'm done for the day okay and i go down to four and yep we're showing four million so that's back like it was so let's talk about how we do this in a function block so we go here and i go to edit then if we go to our process tab right here and now we have a few different instructions than we typically would have and mainly the second one is going to be our scl instruction our scale instruction and you see we have an in and out so our n is what do we want to scale and that was our raw value now one you see how when i get near these they highlight green so i'm gonna drag that to there and that connects those and then we're gonna do the same thing on the other side we're gonna have an output and okay now if we go here we're gonna have local colon one oops knuckle colon four colon hi dot oops i haven't just used the drop down where wow there it is channel zero so that's that now one thing by default let me get through this part first yeah so our output is going to be scaled function block so it's gonna be a whole new tag we're gonna create that and it's gonna be a real and one thing i don't like is by default or did i no i didn't okay one thing to watch out for is let's say let me go and add a description here and we're just going to put actually put a description on this one because this is the one that's kind of confusing this is our analog input oops and click off by default it doesn't show the descriptions i don't know exactly why they did that in studio 5000 but if we go to options typically yours is going to look like this and you're not going to have these descriptions and i i'm not sure why or i don't know what the advantages will be but if you don't see your descriptions go to options and look for that show tag descriptions right there also another one that's important and don't get into in this video they don't have show alias information shown typically and i think that's another important one but we'll talk about that in another video but okay so this is going to take our analog input and it's going to scale our function block and if we look here we have block properties and we're going to click there and we see we have raw max we high for all men we have engineering units max we have engineering units men and so if we go back to our original thing here then we know that let me go where's the slope yeah we have a ratio here of our 4 to 20 equals thirty two seven to sixteen three eighty three well these are those numbers so our raw max is sixteen three eighty three our raw men's thirty two seventy seven our engineering max is twenty our engineering men is four so in this case and this is where you know people who are die hard ladder die hard function block or die hard structure text you know i can't agree with any of them because they all have some really key advantages so our max raw is going to be 16 383. our raw min is going to be 32.77 and then our engineering unit max is going to be 20 and our engineering unit min is going to be four and let's start by just throwing that in and we know we're at four milliamp right now we put that in and okay it's 3.998 well let's open up our controller tags just so we can see we go down where's the scale oh did i put the um i put the all right so i made a mistake i put my um no i didn't i'm just blind better do wrong i just i just created that it just needs to sort it now they're both side by side so notice these numbers the scaled function block number in the scale ladder identical am i running up to 20 milliamp and there you go we're right at 19.998 but mainly they're exactly the same so this equation right here all this craziness is done by this simple scale instruction so i would absolutely use the scale instruction normally i would never do this compute now there's a few exceptions to this though and that's why it's important to know this is if you have studio 5000 mini then you are not going to have access to function blocks or structured text you have to have at least light to get those features and yeah you can argue that they should but mainly mini is a super economical way to get into this i think it's 366 dollars a year you can be in studio 5000. everybody keeps telling me that's ten thousand dollars for studio 5000 no it's not it's like 350 bucks a little over that every year and you're good to go but it won't have that function block sue and you may see this some people prefer ladders but i would absolutely do this function block but while we're here let's look at a couple other things is right now we're at 19.998 is we have a full we have a few cool features i'm going to take this oops let me take my range back to 0 to 22 milliamps because that the analog simulator by default is not going to let you go out of range because sometimes you don't want to you remember i changed that range earlier so i just changed it back to 0 to 22 milliamps and i'm going back in here we're right at that 20 milliamp mark is i'm going to bump it up to 20.1 all right and first let's let's look here if we go to our controller tags then we're showing oh i keep having to scroll back down but okay they're identical numbers actually interestingly there is a rounding issue in the seventh decimal place that's kind of interesting that's all i can say about that let's say okay there's a slight difference but it's not enough difference for anybody to worry about and but let's go back here is we have this max alarm and min alarm notice our max alarm is now a one so we can use this an alarm if our sensor is above 20 but it's typically above 20 means something is wrong with your milliamp circuit and if we go down to 20 millimeters notice as soon as oops let me get off of that oh come on now okay all right so let me go back up so notice all right we're above we get a max alarm and also if we go below 4.096 i drop it one more and now we're at three point we get a minimum alarm so that's going to keep uh that's going to let us know that something's wrong if we go back to our controller tags you can see they're sticking right together now here's something cool you can do with a function block and let's say that for some reason and i can't i'm sorry guys i'm not remembering who said what who uh i wish i could scroll in i let michael go to launch that was um really bad somebody was asking what does it mean if your own value goes negative can't remember who it was now oh and yeah i can't find it fast enough but um if you have that problem and you're like i have no idea why but i just wish you quit doing it we had this limiting right here is we can change that to a one and i'm gonna hit the apply button here and notice now our value is four and if we go over here because now we can see our real value and our scale value our value is three point eight nine six but as a function box is going to limit it to four and now i bump it up now we're going to line up together but watch what happens when i get up to 20. all right we're at 19.9 they both look beautiful we hit 20 they're 19. all right they're actually 19.8 they're right at it so these are going to hit close but now i'm going to get a 20.1 notice this one fixed is fixed now at 20 and i can bring this on up so we can get all the way to 22 milliamps or 21.1 that's fine okay and that's the limit that's the range of this song module is 21. but okay we can do that and we're sticking at 20 here so that ah okay trex controls was one that i was asking so that's how you could limited trex controls if you're like i just don't know why it's happening you can use that to limit it um right there now i'm not going to limit it so i'm going to change that back whoops pretty good there it is i'm going to change that back to a 0. i'll plot that and that's going to throw it back up there just like the other one is now we also have structured text and this is one that kind of i kind of laugh a little bit when people complain that structured text has zero use next thing i ask them well what do you think of the compute statement oh the compute statement is the greatest thing there is well guess what guys the compute statement that we used here and you know somebody smart at rockwell may even would tell you is the way i see compute statement is it's a mini subroutine with one line in it and it comes right back here so we're going to right click new routine and this is our structured text and it's going to be a type of structured text and then we're going to hit this jsr here copy paste get ourselves a structured text and actually while i'm here now watch this all i'm going to do is i'm going to copy this ctrl a ctrl c actually make sure you saw that right click copy all right we're going to put those in there that's going to get our structured text routine running and mainly i didn't do anything to this one it's exact same as it was i just copied it now i'm going to go down here to structured text oops okay i was looking at this warning that kind of threw me for a second but we put this in after that so here's our structured text routine i'm going to hit that to edit it and we're going to put scaled now notice the function block of the ladder and that ladder dent we made her here i'm going to put structured text and then you put colon equals that's how we put an equals if you just put equals that's a compare statement colon equal means go write something somewhere so colon equals means whatever i put after this you're going to write to that structure of text and now i'm going to put paste or actually right click so you can see exactly what i'm doing i'm going to right click right here and i'm going to hit paste bam that is exactly what is in our compute statement and then here at the end of it the only thing and i forget this probably 50 actually i probably forget this 75 to 90 of the times you got to have a semicolon at the end of this now the only thing is i just typed this strip scale structure text so we need to right click it and it's new tag right there just like we normally do in all the rest of them again i'm going to make this one a real okay and now we're going to put that in there and now we go to our scale values and close that up close that one up so you don't scroll so much and whoops what did i do wrong oh again you gotta sort once you added it adds it to the bottom okay now we have a scaled function block we have a scaled ladder up okay that's still dense in the way we're not using anymore um so i'm just going to highlight it if you didn't know if you're not using something you can highlight right click delete bam it's gone make sure you know that there's no verify on that that's probably something we should do in a video is yeah with that delete button i just did that that thing is gone no more there's no undo on it either okay but now look all these values are identical and so yeah we'll drop it to 20 milliamps and yeah we're still 19.9998 which is pretty close and we're going to drop down to 4 milliamps and at four million there you go they're all identical right at 4.01 so here is how one here is a compute statement and yes a compute statement is a mini structured text routine so if you say you hate structured text and you think that the commute statement is awesome then you have a crisis on your hands because they're the same thing here it is in function block and i'll admit function block is the best way in studio 5000 to do the scaling in my opinion and you have structured text and honestly this i can't knock this now i do i do need to knock one thing because here's another thing that's not there by default is i'm going to right click where is it am i right clicking in the wrong place options uh dude john do i have a recommendation on where to learn structure text we're actually getting ready to do a structured text lesson series some basics they're going to be like this is they're going to be rosetta stone type things so we're going to show how to do something ladder we're going to show you how to do something in function blocking we're going to show how to do something in function and in structure text so we can see how they function exactly the same but there is an issue here with structured text and required and this is you know just saying i don't know why they do this except for maybe it does maybe i'm not sure why inline value display by default is do not show so by default you're looking at this and this is why people don't this is what gives structure types a bad rap i think in studio 5000 if i was looking at this and i want to know what my value is i can't figure it out i can mouse over it and get a quick snapshot i can mouse over this and get a quick snapshot but i can't see the actual value in fact let me make sure you see that right now we're 32.77 i just bumped this up to five it still shows 32.77 i'm going to move off of this and move back onto it and now we can see the new value and yeah over here we can see the new value but it does not live update when you mouse over this there's a couple things we could do though is one i can right click structure text right here and i can watch tax and now i can type scaled structured text and bam i can see the value there and then i can also i can go ahead while we're here let's throw local colon one colon oops not one um four colon i dot channel zero data and there there's your two values the watch window can be very useful in this but i personally like having this show at least showing monitoring maybe i'm sure always and here's where i think i think show with monitoring is probably the great compromise is so with monitoring for offline it keeps everything compact and your line numbers are really easy to see and it's easy to compare things and yeah i think this is just so valuable but you could do a watch one day but now we can see every value but all right we've got a little you know we're nearing the end of this um but okay while we're here let's talk about one other thing what do we have right now we have a heater going and this is back to four to twenty though so let's make this 12 and let's make this eight oops no we're using a span now let's make this two and gosh all right put that in i didn't need to edit that wrong okay there we go but okay now we're at five milliamp and we're looking for 12. oops actually we need to let's see yep let me go up now because we're heating so we're bringing this up and bring it up to 14 milliamps there kicks off so this works exactly the same only now we are in milliamps instead of the value you know the over kind of real world values we had there kicks on kicks off exactly the same but now let's talk about how we would do this in function block so right now for value is less than the temperature set point and here's where you can start talking this out and figure this out if it's less than the temperature set point or so this branch is an ore it's less than the temperature off and the heater is on then we're going to turn on the heater so let's talk about how we could do that in function block so let's bring down let's find a less than so if we go over to our select limit let's not select limit no compare then we're looking for a less than so same deal we're going to edit this and let's get rid of the watch window and we're going to bring down a less than i'm glad you like it vincent let's see okay so our source now notice you know and here's where you know you just got to learn the differences between them is all right so we have source a and source b but we've got to use those input things or we've got to use some direction here and so we're going to go there i'm going to bring this down it's going to go there and we're going to connect these and so our first one okay first this is our scaled function block value and then this one is our temperature oops not temperature off what was it temperature set point and yeah i know it's not a temperature set point now but and yeah i can change that there we go we're gonna edit it this is now our milliamp set point there you go if you didn't know you could change tag names on the fly now you have it changed to there so if it's less than that so this right here is going to take place of this right here okay now we have this piece so we have an or statement so we're going to go back to our function block and we need an or so if we go to our favorites tab right here we have b or so there's our or and this was a top one and then we had another less than now if you notice though we had taps organized here a little bit move that over there there we go i'm gonna bounce back and forth fast here's the ore but i noticed we have this and in here too so we need to put the ended statement in here and that's right beside of it right here there's the b and so we're going to bring that down and this is that second condition so there we go and notice we have three extras here you'll just hit this view block properties you can uncheck the ones that you're not using there you go and that tidies that up and okay so now we need another less than i'm just going to actually know i'm not going to copy and paste we're going to go up here and find it and compare and we bring that down now you notice now that i'm not a very neat function block maker so somebody probably will get upset with me actually but yeah let's get at least halfway lined up so put that there you can bring that up line it up there and then yeah that's less than probably should be right here and then we need a couple more inputs we're going to bring that down bring another one down and yeah i should line these up really neatly oops yeah you're not going to get a lot out of me on neatness a lot of these up but we're going to put that there put that there and okay this one again is that scaled function block okay in this case right now it is temperature off we're going to change the name of that as soon as we get it up here so now we're going to right click properties and we're going to change the name of it that's going to be our milliamp off there we go and now we have an and here and our second condition was that our well expensive heat early is an expensive heater our expensive heater has to be a one or has to be on so in function block to do that first of all this is going to connect to here that's our first condition and yeah we'll line that up and yeah probably should line that up something like that and then our second condition is going to be the output so it might be able to get it right here i never really needed this but local colon one colon o dot data dot zero that is okay now i can't have the expensive heater up there because it text gets truncated but we're gonna put that there bring that there and again that's really bad i won't leave that i'll drag that out and get that neat there then we'll hit the b and we're going to take those two extra conditions out and then we'll put that in [Music] and all right we got to do something here i want this where you can see it so this will be our expensive heater so it is local colon one colon o dot data dot zero that's our expensive peter now let's get our main routine and let's change this one because i need this i don't want to duplicate output that's for another lesson series so i'm going to change this to output 1 just so it's not going to be controlling our expensive heater but okay now we get our function block let's look at this and make sure we understand so now if our scaled function block input is less than our milliamp input then we're going to end up with one or zero here this is our true or false here and in this case if it's one is if our selected function block is less than or milliamp above then we're going to get a one or a zero here and this already showing a one or zero and that's why i kind of do like function blocks now we do need to talk a little more about that i didn't say you should go out and hog while i'd use function blocks but there are some things about its logic that i really love and actually i usually bring over to ladder so put that in there and first let's see if it works exactly the same our green is on and we are at so right now our heater value is less than or i'm sorry our millionaire value is less than 12. so this is true and it's represented really well by this one right here so we know this is true and we have an or statement here now it doesn't skip still there is a process that goes through and i'll show you later in some function block exercises why it matters but okay this is also less so this is true it's really showing well by that one this shows that it's a one and here we need an end and n means that you have to have ones in all of these things to get a one out that's going to matter in a second we have this ore so we only have a one here and if we look at our expensive heater it is on now one thing i kind of don't like is i wish i don't know people look here and they don't associate this one with this but this does if you have a line going across here this one is that right there okay so now we're going to start heating so that means our milliamp value is going to start going up so there's 12 12 1 and we're going to bring it on up let me get it close and we get about 13.8 okay we see we're at 13.8 so at this point notice this is a zero now because 13.8 is not less than 12. so this is false now 13 8.8 is less than 14 so this is true and we have to have our expensive heater on so we have an and here we have both ones coming in so we have a one here so the zero here we have a one here but this is an or statement so either or if we get a one in one of these things we're gonna put a one out and that's what we're showing here are expensive heaters on we're going to bump up to 14.1 and now we have zero here zero here zero here zero here zero here so 14.9 or 14.1 is definitely greater than 12 so this is false you see a zero same here this is not less than this so zero here and our expensive heater is not on now mainly because this was false this was false and that made this false so let's bump it back down we're going to go back down to 13 9 so now this is true notice we got a 1 back here that's why i mean function block has some advantages and but we need a one here and a one here to get a one out so we're going to need oops going our own way so we're going to get down let's get to 12.1 and all right 12.09 still not there so i'm going to go to 119 and right away we get a 1 here and everything's ready to go again and we're going to cycle through this exactly the same as we cycle through with our ladder diagram so they're going to do the exact same thing and i had these set up down there where we had brighter things and we could have shown all at the same time but you get the idea here in fact yeah i can do a watch one day so let's right click this and oops i wonder why they don't have a watch option there but okay at any point you can go to view and you can go to watch and we're just going to drag oh i already have it down that's right we have a watch one of that we don't really need our scale though you will leave that actually don't need either of these but let's just delete that out and let's drag this in oops won't let me drag so we're going to type local colon1 colon o dot data dot zero that's one in our function block now and we can copy that we can put it right here and put one and that's going to be the other one so now they're both off and we're going to go up two oops down we're gonna go down to 12. they both kick on it exactly the same time we got ones in both of them we come up and they go back off now one question is should we use this and this is some question i get often and you know and i'm surprised nobody said it yet this is horrible or you know you i don't know if maybe it's been long enough that all of them were gone but it is regional and that's what i have to say about whether you should do discrete logic in function blocks or ladder if you're going into a plant and every technician in there is trained in ladder please make the things like the switches and stuff ladder and i know we could say well they need to be trained better okay maybe they do but you're going to plant that 99 of them only know ladder you need to make that part louder now we can we can do our process control scaling and all that and function well because they don't go bad they don't they're not going to do as much troubleshooting as those but now with them in europe you know and i kind of broadly say in europe i gotta remember europe's a huge place but for the most part europe you're gonna see a lot more function blocks and to a point maybe if i throw ladder there you may be in a place that 99 of them only know function blocks so it's very regional it's very important that you figure out or you know your audience i guess that's what i got to say you got to know your audience you know you got to know who's going to work on the equipment and no there is no statement out there saying oh they just need to be trained better no i don't know trust me i need people to go for training and we make a living off of training but that is not an excuse for writing a program that can't be trouble shot by the bulk of the technicians at a plant but okay while we're here let's go ahead and see how we do this in structured text because we've set we've spelled it out almost really if you go back to our ladder here we've said if the ladder let's say if the value is less than 12 or the ladder is less than 14 and the motor is running or our pump is running our heater is running whatever then turn on the output oh we can type that out in structured text so we go over here and we edit this and yeah we're going to go to the next line and we're going to type if and you start typing it and you know one all your instructions are gonna come up so if you're not sure you know there it is if and we can even mouse over it and okay if then that's what we're doing so we're gonna double click there and so the first thing was that our scale and one okay this case we're gonna use the scaled structured text is greater than our m a and remember this was cool even though it's structured text i would always use the drop downs because i'm i'm not a great typer but our milliamp setpoint so there's our first condition or now let's make sure we get our parentheses right is now we're just going to put or and now i need a parenthesis because same grouping we had to do in function block we've got to do over here so the and came first and then we have the or so order operation this gets the parentheses to make sure that we evaluate it first so or and this would be scaled function block structured text oops i made a mistake is that greater than was that less than those were less thans so less than and this will be scaled structure text oops lost mass there we go is less than and this was the m a off and now we need that and we're just typing it out exactly like we would and local colon and we're going to change we're going to change it so you can see the green light so we are going to use localcolon1.data now remember if you're going through this just like i am then you're going to need to go back just like i'm getting ready to do and edit that other one so if the scale structures text is less than a milliamp or the structures test structured text level is less than a milliamp off and that then oops actually then i would put no i'll put it that way probably which way would it go i don't even know how to do it but it's cool you can put it anywhere this was kind of terrifying about structure textbook so if it's true then we're going to make local colon one going o dot data dot zero colon equals because remember that's how we make it do something one semicolon else if i say else and i notice there i put else and i ain't pause for a second it's like which one is it so we have an else and we have an else if so we could have multiple conditions but in this case we're going to use the else local colon one colon o dot data dot zero colon equals zero semicolon and then we need an end yeah and really these should be lined up differently and everybody has a different preference on this and i don't know how i'm doing i probably do that um somebody else might say the intention should be different but i usually have a typo in this so first let's hit the verify button statement line number five statement there you go i'm gonna do it ninety percent of the time i'm gonna forget one of these semicolons and so what this means not terminated by a colon line five sometimes exactly where the problem is i'm gonna put that there i'm gonna hit my verify button again just to make sure and we're looking good now let's go to the function block routine though and let's edit it and i change the other one to a one so let's change this to a two and in this case we'll change this to a two and that will do all that all right and now if we get our structured text and here's where yeah notice that while i was editing i couldn't see the values and i think they made a good compromise i wish this was the default value or maybe they just i don't know if you do not know that you can look at these values in structured text it can be a nightmare to troubleshoot but all right we are at 14.3 milliamps oh oh what did i do wrong i did something wrong here oh no okay here's our scale and that's our scaling here's where we're at 14.3 has to be less than 12 or 143.3 has to be less than 14 and our output be on now one thing to notice is they don't have a description here and i would not and i would knock people pretty hard on this as you notice if you go here there's no way to actually put the descriptions in so what you have is you can add descriptions to each line and let's do that really quick so i can go out here and i can go slash slash and i can put that this is scaling analog input and i can put slash slice oh determines if our i don't know what are we calling this now we're just going to call it our green light green light should be on and then yeah this one's obvious probably but i could throw something on it anyway turns green light on and finally this one's gonna be turns green light off all right and let me put that in there because that's going to see see these description here's where you know structure text gets a bad rap because people don't use the tools available and the one tool is these descriptions the other is being able to see these values and so all right jason well i'm glad you enjoyed this and yeah i would i think this is turning i think we pieced this back together from a power failure and we will make this available later so make sure you're just subscribed and you should be able to see that in the uploads uh later probably and actually it takes it a little time it'll probably be like 24 hours before the whole thing's on youtube takes a while to process the live streams but okay let's see if this works so we're going to go down to 12 and we should see well one we should share green light come on then also right here we should see this turned to a one and also if we bring our watch window back where did i watch one to go did i close that i think it did yes it did let's go view and watch and then let's add 5 since we did use 5 for the function block so they're all off i'm going to bring this down to 12.1 and okay and so this is looking for it to be less than 12 and it's off and we see all of them are off here i'll drop it to eleven nine right away all of these come on and we can see yeah eleven nine is definitely less than twelve or eleven nine is less than fourteen that's also true now and the pump or whatever the green light is now on so both of these are true now and you know i will not get too far into it but i think this is still a little difficult to troubleshoot as far as turning on bits and things so if you expect a technician to be able to go through the structured text i think you better you know make sure that they are trained for it it shouldn't be they should be trained for it but really i would have this in either i would it would again it's regional if it's if it is um ladder then the physical outputs now i use structured text all the time in fact um i'm going to critique one of my recent programs thing where actually i use structure text function blocks and ladder diagram but it wasn't intentionally it was just the way the program worked out but okay let's go up to 14. well actually we bring up a 13.9 and they're all ones now i want to bring up the 14.1 and we can see right here is what we're looking for and that's going to go to zero so this right here works exactly the same as this right here which works exactly the same as this right here so there are three ways that you can do this i see john i like to put a structured text routine that is purely for con you know i had never heard of doing this until recently and i'm like oh my goodness why has no one ever told me to do that so yeah what john's saying is he adds a routine and i'm going to call this machine document oh gosh yep time for the live stream to be over i can't spell documentation now documentation i'm hungry and we're gonna make a structured text and then we're gonna open that up and oh i always forget it i have to right click it every time to see oops not that i want options all right click options here you go and i i don't remember all this that well oh john you're right there um what is it star star is that how we add multi-line comments is that it oops i gotta edit that seems like that's not right no anybody remember that i know the slash slash is the single line and that's what i use most of the time but there's a multi-line comment as a well and where is it oh come on computer the computer's starting to choke too it's like i'm done yeah now i'm hold on let me um oh come on computer yeah my computer is toast there we go um parenthood let's see oh gosh i am not remember there's a way to make multi-line comments um i should know that is it open parentheses oh well let's just try it i probably could hit f1 too but whoops my mouse keeps disappearing over here star this there we go and mainly you can see that it's typing in green so now um i can put this is whoops i'm getting ready to hit my chat here and remember screens are backwards this is one line of comment and then this is another line of comment and then at the end you put star parentheses and then isn't that it well let's hit the button and find out yeah there we go so we're going to get a warning right now because machine documentation can't be reached but here's where you can actually put i mean you could just i mean really you know that's what somebody was saying yeah they um they have a manual that has some procedures and they copy and paste the whole procedure of how to do a couple things if you're having issues some troubleshooting guides so yeah that's a really cool feature i do and i haven't used it yet i'm like man i can't i can't wait to find a home a reason to do that but okay i think we have exhausted um everything horribly not in order but we have managed to get um everything accomplished that we have so let's wait a second and let me send michael message because michael needs to select a winner here for our giveaway so are there any other questions because yeah we are getting ready to end this and i do appreciate your patience as we um completely change what we did we completely changed location scenes equipment and everything and managed to still do this but any any last minute questions and also be thinking what you want the next live stream to be about and yeah put it down in the comments because yeah um these have i've really i've really enjoyed doing these for one i i i get a lot of immediate feedback on what you think we've got some great video ideas in them and yeah all right and michael i'm almost he's looking we're waiting i mean jeff honestly i use i i don't ever use a linear i use let's use the um switched um you know that um that 60 watt class 2 the same thing you use i don't um i don't know in this case it doesn't matter it isn't i guess that's my answer to this it doesn't really matter and that but that's going to make a really good video and i don't have equipment to do it but i'm going to show you on a milliamp setup you can vary the signal i mean you can vary the voltage going into it and it's still going to work great that's what's awesome about milliamps is it's going to regulate a current as long as it has enough voltage to push 20 milliamp across that resistor that load resistor or their total network resistance then it's gonna work and that's what's so cool about it okay and the winner is john birch you have won the analog simulator so john if you will reach out to contact us at twcontrols.com we'll get your address and get that worked out for you and all right guys that is it for today again please hit that subscribe button like our channel and yeah any recommendations you have or questions feel free to put them in the comments or reach out to me and yeah till next time hey this is tim and this is amber of tw controls we run the automation store hey thanks for finding our channel here's a playlist with some similar videos and youtube thinks you'll like this video please like our video and subscribe to our channel and if our videos have helped you make some money and you're not using our products please consider supporting us on patreon till next time see ya
Info
Channel: Tim Wilborne
Views: 4,370
Rating: undefined out of 5
Keywords: analog signal, 4-20ma signal generator, 4-20ma current loop, Tim Wilborne, 4-20ma explained, Industrial Automation, PLC Programming, allen bradley plc training, 4-20ma current loop transmitter, 4-20 ma, 4-20 ma current loop, 4 to 20ma, current loop 4-20ma, 4-20 ma vs 0-10v, 4-20ma signal, 4-20 ma scaling, 4-20ma current source circuit diagram, 4-20ma current source, analog signal vs digital signal, 4-20 ma conversion formula, 4-20 ma current loop tester
Id: 20QltAiD_G4
Channel Id: undefined
Length: 188min 30sec (11310 seconds)
Published: Tue Aug 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.