Using Siemens Test Suite Advanced for Application Tests in TIA Portal

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone thanks for joining i'm liz co-founder of outlier automation a control systems integrator today we're going to dive into siemens test suite in tiaa portal i'll start with what unit testing is and how that fits in with siemens test suite and then we'll go through an example of how to use it unit testing is a software development method which typically uses automated tests to check that modules of code logically perform as expected there are many testing frameworks that have been developed for modern programming languages and siemens test suite is tia portal's version of unit testing test suite application tests let us run test cases on interfaces of one or multiple function blocks and functions let's take a look at a function block to see how we might apply an application test i have a function block called fbio analog input called an ob1 it has logic in it that evaluates the rn value versus the r in low low and are in high high values to see if the analog input value is below or above an alarm set point we can use an application test to verify that the set reset logic i have here actually functions as expected which is that once the rn value crosses the r in high high value for more than one second it sets an alarm bit unit testing has some big advantages it reduces startup time when we commission our code on a live system if we know before we download to a plc that all of our alarms work there's a lot less testing time in a high pressure expensive situation it also improves the quality of code because running automated tests allows us to test many more cases and combinations of logic faster than we could manually both of these reasons allow us to build confidence that our overall solution will be robust and thoroughly thought through there are a few key things to remember when developing unit tests it's best to break down your code and test into small test cases this allows you to build up pieces that you know work and to think of simpler tests that are useful tests are not for simulating an entire machine or communication between external applications think of a test instead as checking a black box where a function block is your box and the inputs and outputs are the interface parameters check all of your black boxes individually and then the overall solution is the connection between those boxes finally when you're writing your code think of what test cases you should check and ensure that your code will meet the desired outcome okay now that we have all the basics my coworker nick is going to show you how to set up and use test suite now let's pull together everything we need to start building app tests in test suite so it's important that we install plc sim advanced first so let's go ahead and download that i'll search siemens plc sim advanced and version 4 is the latest version at the time of this video click in here if i scroll down here's the link to the executable i went ahead and finished that install offline so now let's grab test suite i'll search test suite advanced version 17 to match my portal version click this link and this should be the executable as i mentioned earlier make sure you install plc sim advance before installing test suite the good news is we only need a license for test suite not test suite and plc sim advanced as we'll see later test suite actually spins up a virtual instance of a plc using plc sim advanced and it uses that to run the app test but it all happens in the background so as long as we have the test suite license we're good to go now let's get into the software with a demo alright so we're back in the same project we had open before let's scroll down go to test suite application test we're going to add a new test case let's call it ai test this scope allows us to run tests on different plc's but we've only got one so i'll choose plc one now we can set up our variable table so here we're really just mapping tags which are local to the test case to the tags that we set up in our plc project so i only have two tags i want to do input which i'll tie to the wn value of the block and then high high alarm which i'll tie to the be out high high of the block so now we can move on to writing our first test case the first thing i'll do is give it a descriptive name and in this step what i want to do is set the input high enough that it's over the r in high high value but i don't expect the alarm to come on because i'm only going to run it for one plc scan and there should be a timer in that block which will debounce the signal so it'll only trigger the alarm if it's been high for five seconds so the way i do that is first you can see we set the input to the value then we say run for the number of cycles we want and then we assert that the high alarm should be false and every test case is going to follow that same format so now that i'm setting up this next one i want the error condition to be true after de-balancing right so first thing i have to do is set my input i'll use the same value now this time when i run i'm going to use time instead of cycles and i'm going to run it for 5 seconds once that's over we should assert that this time the high high alarm should be true so let's try it out scope is okay and i'll hit run okay so it looks like both steps passed so that means that the assertion line in each step evaluated to true but let's see what happens if i change the run time on my second step so i believe it's meant to be a five second debounce so let's see what happens if i run it for only 500 milliseconds yeah perfect so it looks like the second step failed it expected true but got false on that be out high high and turns out it was a one second d bounce not five okay now let's go ahead with another example and this time we'll actually do a test case on a safety block so in our main safety routine we have this e-stop block right here this guy will be perfect so i'll go down to test suite and add a new test case we'll call this one e-stop test i always like to split screen with my block for reference now procedure is pretty much exactly the same we're going to start with setting up our variable table so i'll set my local e stop to be the input to the e-stop block we'll have an acknowledge and then we'll set this tag q to the q output of the block now one interesting thing here is we can only read the instance memory of a safety block so to write to them we use the tags interfacing with that block so in our first step we'll start by setting the estop ok so to set that up first thing i'll do is set estop equals true to ack i'll leave false because it'll expect a rising edge then to run let's do one second and for our assertion let's see the q should be false yeah okay so for our second step we're gonna acknowledge so e-stop we'll leave true and then we'll set the acknowledge to be true as well run time one second [Music] and this time the assertion our q should be true meaning that the block accepted the acknowledgement and passed the input signal true on the e-stop to the output q let's run okay as expected both steps passed so when the e-stop was okay but we hadn't acknowledged q was false after we set the acknowledge to true q went high so we'll see that once we get rolling here adding steps on is actually pretty easy so let's do another cycle of the e-stop i'll just copy these lines change this one to be not okay so we'll have the tester drop the e-stop and the assertion should be that q is false then i'll need to restore it so i'll take this again and let's call that e-stop restored and then finally we'll ack one more time we'll run it and all the tests passed so we were able to verify the behavior of this block if we drop the e-stop acknowledge it drop it again acknowledge it again and we could go on and on like that and that's all for today thanks for watching if you have any questions send us a message at info outlierautomation.com and you can check out the other resources on the blog section of our website
Info
Channel: Outlier Automation
Views: 6,279
Rating: undefined out of 5
Keywords: siemens, automation, testsuite, vci, tiaportal, plc, programmablelogiccontroller
Id: _WEf5m0ieRY
Channel Id: undefined
Length: 11min 16sec (676 seconds)
Published: Tue Oct 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.