S7-1200 Data logging Siemens PLC

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
kula hi today we will learn how to use the data log feature in their 7 1200 before we start I want to set some settings for multi OC so right click properties I just want to enable the memory bits and the clock memory and the very important thing is to enable the web server because it's the only way you can reach the file you will create now my file is created I'll go to the main obi-wan the commands for the data logging you can find it in the extended instruction if you scroll down to recipient data logging you can find all the commands for data logging data log create will create the file for you the and automatically will open it after it's created but in case you you already created a file and you want to open it again to for writing you will use data log open data log write is to start to writing the values to the file is being created close is too close and stop writing what you will use the day is data log create and automatically it will open and will use the write command so we will drag and drop the data log create and we'll see the setting for this to be sold so in order to understand the data types for each one of those we need to consult with the manual and here in the manual it will explain all the data types of each one of those parameters now to use those parameters I'll create a data base I'll just call it create and I'll start storing the values for each one of those parameter in the database I just created so I'll start the request is actually a transition from 0 to 1 so I'll I'll use I have a push button add input 0.1 I'll choose that as to start the data load creation so I'll go to my database and I'll type records and from here I can see the record is unsigned double integer it's the number of the records data records circle of the circular data log circular means 1 the full number you entered is useful is a file will be continued original but on the layer the first values the rating so it's circular once itself will go back again so the data time for it it's unsigned double integer so I'll choose here and sign double integer number of Records I'll choose 25 now the second parameter the format and the timestamp those are for default r1 the format is a1 it's comma-separated which is what I want and I want to include the timestamp so it is already 1 now the name is a variant mean it depends on what you choose so I'll go back to my database and the name and I'll change the name type as strength and I'll name it logging the other parameter it's the idea the idea number it should be a double word so I'll go back to the database ID double word I'll give it an idea value of one and the header the header means the name of the columns in your data file as we see here the headers are a variant so it depends on what you want to define so I'll go to the database I'll call it headers and I'll give it at the type of trend so here I'll put the names of the the head of the columns that I'm storing the the values as saw I'll use temperature comma if you need another header I'll use a pressure so there is a third one common the name of the third one and so on so this is the headers now the data as you can see it's a variant it's a pointer to the record data structure so I'll use in the database for the data I'll use alcoholic data let the type I'll call it structure now in this structure I will have current temperature and I'll choose any type I want I'll use unsigned double integer and current pressure I'll choose the same type what led forming are the done the busy and the error bits and the status those are important if you want to troubleshoot if a new suspect is not working well those will be handy so I'll add those this in my database so done it is boolean busy and error they are all boolean and status we can see the status should be a type of a world what happens if you use Devon world the number that will appear here will not correspond to the error table the values of errors so it's important to choose it as a world now we'll go back to our main movie and we will start assign those values to those parameters so I'll go to the create and the value of the records already stored here those are the default value for the name are two the same db2 and I'll look for the name it's the whole name sewn on the ID is the same ID so create ID the headers mean the name of the columns headers and the data db2 data none so I'll prove both and the done busy error and status the only thing left is after the data log create I need to add the right the data log right so the data log right actually should be only enabled after the cell is created which is only true after this dumb bit will be true for one cycle so what I will do I'll add the done bit it will be true for one cycle when it's finished so I'll choose it with the set and I'll use a memory location for this 10.0 so once it's done this that memory am 10.0 will be always true so this will be the condition for my data log right to be enabled so I'm 10.0 the request which is how the frequency of the time we want to write to the database so I'll choose the clocks I'll choose it one helps mean one value every second will be recorded the ID this is very important to be the same ID for the data log create block so I'll choose the same value that's stored here and you can for sure create another than and busy and error on the status to troubleshoot it something wrong with the data log right the only thing I need now to add is to simulate a value so that I can store what I did is I connected a power supply a variable power supply to my analog input of the PLC so I'll take that value and I'll scale it normalize it normalize it as scalar and I'll store it in the data data file so I'll go to normalize and scale the data type out to double integer to real and from real also to a double integer I'll take the minimum of zero the maximum will be twenty seven thousand five sixty five which is the maximum that carried and the value I read it from the analog output which is the iw 64 I'll just put it in an MD let's take em b12 and here I wanted to be scaled that zero will represent zero centigrade and the maximum will be present a hundred centigrade and the value will take it for sure from the MD twelve and it will store it and an MD so once I used double what mean I'm using twelve thirteen fourteen fifteen so 16 is the next available one and what I will do I'll move the value from the MD 16 which is the scaled value of the temperature I will move it to the database data current temperature and output the moving operation to be done every one second so what happens here every one second the move will move this value the simulated value of the temperature from the MD 16 and put it in the database of the data log and every 1 second that value will be written because of this clot will be written in this value so let's compile and then download if you download directly it will compile automatically and download but sometimes if you are working with databases or high speed counters you will avoid some problems by compile and then downloading so what I'm doing I always compile and download I you will avoid a lot of headache as you follow this procedure now I'm downloading the file to the PLC and let's check let's monitor we can see the request is not on yet because I didn't press the button all the damn busy are our souls the right will not will only be enabled after the m10 which will be true only as the Damned it will be true for once and this is the scale and normalized from the satellite the valuable DC supply that they have so if I change the value of my supply you can see that the value here also is changing and actually what I did I took the scale so I can tell from here 66 so my valuable three of my valuable voltage is 6 volt is I lower it you can see so this is just to simulate the temperature now I'll go and press the request for the data log create and let's notice the busy I press it and it's a true but it is true for more than one cycle it's only needs probably need more than one cycle to be true we didn't notice the diamond if it is go through our notes because it's only for one cycle but we can notice it here now the setpoint the m10 point zero is one so that mean the file has been created successfully that's like the time that was that and once it's created now the right is always enabled so every one second this value is written to the file so if I change it I suppose to see different values for the temperature in order to retrieve the file I created that's why we enabled the webserver at the beginning so if I go and I already here but I reach it through just acting the IP address of the TLC if you go to enter data logs you'll see all the files have been created the one news we called it's logging so I'll press it open and I suppose now to have an excel sheet with two headers which is true and you will see the temperature we will see here it's supposed to be 25 record and if I change the values I supposed to see a different values here because it's a continuous operation you can see here the change 67-68 and back so it's continuing its work those are the headers those are the values I hope you enjoyed and learned how to use the data log good luck and see you in another video goodbye
Info
Channel: Ali Al-Mukhtar
Views: 144,701
Rating: undefined out of 5
Keywords: Siemens, PLC, Datalogging, S7-1200, data logging, web server
Id: E2tdtwrT_sE
Channel Id: undefined
Length: 18min 8sec (1088 seconds)
Published: Sat Jan 14 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.