Lesson 07 - Global Data blocks (DB) Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello my name is Kelly Anton PLC training instructor with PCC in this lesson I'm going to cover global data blacks part 1 I'm going to expand out the PLC and then expand out the program blacks folder I'm going to select the add new block when this add new black dialog box comes up I'm going to select data black and give my data black a name this is going to be a global DB and I'm going to give it the name DB underscore opt for an optimized data block so I will select ok and this will open up the data block editor once the data block editor is open in the name column I can enter in elements inside my data block so the first element that I put in my data block is going to be called start command I'm going to give this a data type of bool I'm going to add another element in this data block and this is going to be called flash bits and the data type for this one is going to be the byte data type going to add in another element this element is going to be going to be my speed and the data type for this one is going to be an integer so I'll select the integer data type for this entry and in another element this is going to be called temperature and the data type for this is going to be real so you can see that I can mix and match data types within a data block let's add in one more element this is going to be a name and I'm going to select a string data type to represent you know string characters so I've got numeric values and I also have string data so I'm going to limit my string to 10 characters what I would do is add in another element here it's going to be called preset time and I'm going to use the time type this can be used as a preset value in a timer as an example you create another element here it's going to be called my array the data type for this is going to be an array of and then I can select what type of array it's going to be or I can select a drop down here and then I can fill in the individual parameters you know for the array itself so here I'll select the drop-down pick my data type and I'm going to create an array of integers so now with one definition I can allocate many values in any table editor you can right click and select optimize with about columns so that you can make all of the column headings fit next I would like to show you the two elements of my array so if I expand out the my array that I created you'll actually see there's two elements underneath so the first one being like zero the second one would be index one next I am going to copy the data block that I have here so I'm gonna right click on it select copy right click and then paste in the program blocks folder the first data block that was created was an optimized data block this next date of block what we're going to do is we're going to rename the copy of the data block that was just pasted and call it STD for standard access data block next I'm going to right click on the data block and select the properties for the block there's an attribute that is called optimized block access so I'm going to uncheck that and this is going to change it from optimized access to standard access optimized his name only access when I do standard access now you'll see that there's actually going to be an offset column in the data block I'm going to right click on the properties of the standard block access and go up to the general area here I'm going to select manual so that I can change the data black number because I can't have two DB ones in the program so I'm just gonna change it to two so it's a unique number you will see that the offset column has not been filled in yet once I compile the program then it will fill in the offsets for the individual elements within the data block next I will open up the main program block in the project tree once this black opens up I would like to collapse all of the networks from the previous exercises so I'm going to go up and collapse all networks and then expand out Network 6 now to be able to show data block addressing I'm going to use a move instruction for that purpose so I'm going to drag and move instruction in I'm going to show both standard access and optimized access I'm going to add an additional output pin to the movements action on the input side I'm going to select the clock bite that we defined earlier and I'm going to move that into a data block address so I'm gonna highlight my optimized data block address and I'm just gonna use the drag and drop method so I'm just going to drag flash bits from the details view in and then you can see the optimized axis now I'll highlight the standard access block and do the same thing for the flash bits from the standard data block so you can see the difference between the addressing between the two I will add in another move instruction I'm going to use an empty box instruction and just type in the instructions and I'm looking for so I'm going to use the move this time I will add in another additional pin but on the input side I'm going to use the analog pot value so I'm going to select pot 1 and now instead of doing the drag and drop method I will just start typing the first few letters of a data block so I'll use my optimized access and then I'll drill into the data block to pick the speed tag I will do the same thing for the standard access so now start typing the first few letters of the data block select my data block and then drill in and select the speed tag so with the standard access you have an absolute address as well as name address and then optimized access you just use names only next I'm going to change my zoom level to be 120% to make things a little bit easier to see I'll save my project up till this point highlight my program blocks folder and select download to device so this is going to compile my PLC programming at this point and allow me to load that into the controller once the loading of the PLC program is complete in the program I can go into the project tree and I can select one of the data blocks for monitoring so I will press my monitor all this happens to be the optimized data block I can modify values and I can view value so if I right click on a field I can select modify operand and I can type in a new value for that field so in the modified value column for this boolean tag I'm and turn 1 and press ok boolean values you can also double click and it'll bring up a toggle value command as well so if I go to the temperature I can right click modify operand and enter in a real value now for this value so I'm going to entering in eighty point three for the temperature I will turn the monitoring off then I will save my project and I will go offline and this concludes the lesson on global data blocks part one [Music]
Info
Channel: Professional Control Corp
Views: 11,028
Rating: undefined out of 5
Keywords: PCC
Id: 8graVct7wYU
Channel Id: undefined
Length: 7min 21sec (441 seconds)
Published: Thu Jun 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.