Move instructions, PLC programming tutorial Siemens TIA PORTAL | S7-1200 PLC (part 1/2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video we're going to learn some move operations which are move value move block fill block and swap finally we'll do a simple project first instruction is moved value this instruction transfer the content of its input to the output this is its ladder symbol now the value of MW 4 is 10 and the MD 0 is 20 when I activate this instruction with this contact the value at its input will copy to output usually input-output types are the same but sometimes they may be different here the input address MW for you 16 bits md0 has 32 bits so this instruction can transfer MW 4 value to MD 0 but it cannot transfer a number with 32 bit to an address with 16 bit you you another point is here the input value can be transferred to more than one address you let's see this instruction in Tia software let me insert a move value instruction from the left list if I hold the mouse on its input I can see data types which this instruction support them I want to transfer a constant number such as 22 to memory addresses you you now let's test it you you you you now both outputs are zero as you see when the enable input is activated the number 20 will be copied to outputs pay attention Tiye software automatically chose a best way to show numbers here the first output value is shown based decimal format and the second output on hexadecimal if you remember we've explained binary octal decimal and hexadecimal standards which are used by Tia software as you see with right-click we can change display format you you all right before to start another instruction let me explain what is data block until now we have seen timers or counters need a data block to work correctly now click here on add new block we have seen how to use functions before now select data block data block is a type of memory to store data here define a name suppose there are 10 motors in an industrial process and I need to store some initial information about them such as their maximum minimum and their default speeds so I chose motors name for this data block shows the global DB and then click on OK you my data block with the name Motors is inserted here now I can define Motors data first I define max speed tag here I can determine its data type at this column I can chose its initial value as you see you can define any parent with any data type you okay I want to explain an useful way to define similar data suppose you have ten or hundred similar motors so I have to define ten or hundred tags for their default speeds here with array structure we can define them easily so at this column select array then select you data type then determine number of your motors I select number one to ten now I can write a default speed for each motor you you you well you have learned array format of data let come back to learn another move instruction move block compare with move value instruction this has an additional count input the count specifies how many data elements are copied let's see what this simple ladder program do here is a move block instruction as you see it's I an input refers to motor data block and array with number 0 at the next input count we have number three so this instruction is going to move these three values but where is its target see the output address it refers to motor data block array with number 8 you you you so when the N input is activated by this contact the first three value will be copied to the last three address you you next instruction is similar to move block it fills a memory area with the value of the I n input let's see what this latter program do as you see its output refers to motor data block and array with number two you you and also it's count value is five so if I activate this contact the fill instruction right number 900 on all five selected addresses you alright let's see the last instruction swap we can use the swap instruction to change the order of the bytes at input in and query the result at output the swap task is different this instruction just works with word and e word data which used 16 and 32 bits you here we have number 2000 at input and 0 at MW to address you let's see what happened when this contact activates swap instruction all right to understand what does swap do my display format to hexadecimal so this number is the hexadecimal representation of number 2000 as you know MW 0 address you 16 bits you can see the binary representation of number 2000 at bottom we can easily change hexadecimal number to binary form it just need to convert each four bits of a binary form to a number four hexadecimal format well for a word data which has two bytes the swap instruction swap their place now see and compare input put result which zero seven swap with D zero now let's see how does swap instruction do with a double word from the right list select swap instruction and click here to open help window here we can see how swap change order for bytes of a double word data all right let's do a simple project suppose we have a speed motor display first define an array in a data block to store initial speeds of ten motors we have just done this part then write a program to show speed motors every five seconds for this part we need a pulse timer let's start programming from the first well here I have defined a data block at this data block we can store and see instantaneous speed of ten motors let me define another data block which is going to be updated every five seconds you you at this block I define an array which has ten rows you now I insert a move block I select the first array address for the first input I want to move all speeds so I write ten here at the output I use the second array this instruction move all 10 speeds number from the first data block to second but I want to do it every five seconds so I need to insert a pulse timer you I want this timer repeat its work every five seconds so I use a copper ater instruction when the elapsed time is zero my timer start its work when the timer reached to five seconds and after that its elapsed value back to zero the timer will start again now I use another equality comparator you here when the timer reached to five-second the move blah construction updates speeds numbers at the second block data let's test this program as you see the timer start it's work every five seconds also the move blah construction updates its output every five seconds let me open a watch table here first I insert motor speed array from the first block then I insert the second array let me have a better view you you you you all right click here to monitor all array values now let me write another speed value at this column I click here to modify speed values as you see this program is updating the speed value of the second array every 5 seconds this program can be used for industrial displays as you know if the speed value changed simultaneously human eyes don't able to read them you you thanks for watching in next videos we'll do a practical project with factory i/o and also continue learning ta software instructions [Applause] you
Info
Channel: plcgoods
Views: 14,612
Rating: undefined out of 5
Keywords: seyedreza, plcgoods.com, siemens simatic s7-300, delta plc, siemens s7-200 plc, siemens simatic logo, siemens simatic tia s7-1200, Move instructions PLC programming tutorial Siemens TIA portal, Ladder, FBD, Factory IO software, automation process, Move Value, Move Block, Fill Block, Swap, Fill_BLK, Move_BLK, Data Block DB, Function FC, Function Block FB, and Organization Block OB
Id: zyWGGeElOec
Channel Id: undefined
Length: 16min 49sec (1009 seconds)
Published: Wed May 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.