You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 12th, 2019, 02:25 AM   #1
Grzesiuk
Member
Poland

Grzesiuk is offline
 
Join Date: Dec 2018
Location: Poland
Posts: 15
Gathering data.

Dear experts,

I want to implement a modification to my machine, which will count a working time of motors. Three shifts (I shift: 6:00 - 14:00, II: 14:00 - 22:00, III: 22:00 - 6:00). I want to get data for each day, the whole week, which shall be displayed in HMI [First we open the window that will display all informations for current day (3 shifts), then in the same window, there should be an option to choose whatever day from the drop down list and then another window (not sure if we can do this in one window) will appear displaying informations about working time of that day]. When we start another week, we just delete information from the following day and overwrite it by current day, the rest should stay untouched until next day and so on.
I am not sure how to start with that thing. I am using KTP700 with S7-300 (CPU 314C).
If it would be only for one day then its okay, but I want to gather data for whole week, and split it to each day for three shifts.
I would be grateful if you provide me with some examples, informations, tips how to implement such function.
  Reply With Quote
Old February 12th, 2019, 04:15 AM   #2
collinsd70
Member
United Kingdom

collinsd70 is offline
 
Join Date: Feb 2014
Location: Swindon
Posts: 91
Quote:
Originally Posted by Grzesiuk View Post
Dear experts,

I want to implement a modification to my machine, which will count a working time of motors. Three shifts (I shift: 6:00 - 14:00, II: 14:00 - 22:00, III: 22:00 - 6:00). I want to get data for each day, the whole week, which shall be displayed in HMI [First we open the window that will display all informations for current day (3 shifts), then in the same window, there should be an option to choose whatever day from the drop down list and then another window (not sure if we can do this in one window) will appear displaying informations about working time of that day]. When we start another week, we just delete information from the following day and overwrite it by current day, the rest should stay untouched until next day and so on.
I am not sure how to start with that thing. I am using KTP700 with S7-300 (CPU 314C).
If it would be only for one day then its okay, but I want to gather data for whole week, and split it to each day for three shifts.
I would be grateful if you provide me with some examples, informations, tips how to implement such function.
Hi Grzesiuk

You will need to call SFC1 to get the date and time from the PLC. If you dont already; SFC1 will need to be imported from the standard library and called cyclically (for example OB1). Get this downloaded and make sure your date and time is being passed into Memory.

Once you have that, I would create a UDT block of your required information (so Time) then use this to create a structured DB (12 Months, 31 days per month, 3 shifts per day, X number of minutes runtime per day). Then all you need to do is write an FB with input parameters for time, day and start/ end times of all your shifts. Your output parameter will point to the relevant point in the structure and write to it...

Now everything is located in 1 DB. The advantage of this method is that you have lots of records, however the memory allocation will be high and maybe tight for you on the 314C.

In terms of HMI view; you can always create another block to populate the HMI table, for example lets say you want to view data for 25-12-2018, the relevant FC/FB could retreieve this data then populate the HMI DB. Look at this like a 'store' of data and you are simply collecting the relevant 'packet' you require to be displayed.

All in all, it sounds like a great little project ����...


Regards

Daniel

Last edited by collinsd70; February 12th, 2019 at 04:47 AM.
  Reply With Quote
Old February 12th, 2019, 04:54 AM   #3
collinsd70
Member
United Kingdom

collinsd70 is offline
 
Join Date: Feb 2014
Location: Swindon
Posts: 91
Check if your code is not already calling SFC1, if not this guide will show you how to write to SFC1 in STL.

https://support.industry.siemens.com...dti=0&lc=en-WW



Regards

Daniel
  Reply With Quote
Old February 12th, 2019, 07:57 AM   #4
Grzesiuk
Member
Poland

Grzesiuk is offline
 
Join Date: Dec 2018
Location: Poland
Posts: 15
Hey, thank you for the answer!
Counting the work of the motors is already delivered, in program we set the bit for one cycle, and if the motor is working we are counting up. I dont like they way its done now, because we dont have any control of it at all. I can see that someone have placed SFC1 to Program, but its not used anywhere, so that a good start. The idea to create UDT is pretty good and I was thinking about it too, but had no idea how to start. However I dont want to collect data for entire year, for my purpose it is enough to gather it for one week, and then overwrite old data, so the problem with memory is disappearing. Your solution seems fine and I will try to follow that way.
  Reply With Quote
Old February 12th, 2019, 08:08 AM   #5
collinsd70
Member
United Kingdom

collinsd70 is offline
 
Join Date: Feb 2014
Location: Swindon
Posts: 91
Quote:
Originally Posted by Grzesiuk View Post
Hey, thank you for the answer!
Counting the work of the motors is already delivered, in program we set the bit for one cycle, and if the motor is working we are counting up. I dont like they way its done now, because we dont have any control of it at all. I can see that someone have placed SFC1 to Program, but its not used anywhere, so that a good start. The idea to create UDT is pretty good and I was thinking about it too, but had no idea how to start. However I dont want to collect data for entire year, for my purpose it is enough to gather it for one week, and then overwrite old data, so the problem with memory is disappearing. Your solution seems fine and I will try to follow that way.
Sounds good....in that case simply just create your UDT then make your DB for only 1 week ie ARRAY [0..6] of type UDTx. Sounds simple enough.



Regards

Daniel
  Reply With Quote
Old February 12th, 2019, 08:40 AM   #6
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,216
Just out of curiosity, why the need to determine running hours of motors per shift? Is it related to production?
  Reply With Quote
Old February 12th, 2019, 09:11 AM   #7
Grzesiuk
Member
Poland

Grzesiuk is offline
 
Join Date: Dec 2018
Location: Poland
Posts: 15
Yes, its related to production (no overseer over II and III shifts and some miscalculations in productivity), but also because of poor monitoring system that was delivered, which is counting a work time of motors in seconds to eternity (I could reset counter only in PLC, which i want to change and make an additional button to HMI to reset the values) - this is not a valuable information for me at all. Additionally I want to add measurment how long there was a power supply for control cabinet and how long we had controlling system switched on.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
The new Logix platform Firejo LIVE PLC Questions And Answers 20 November 9th, 2018 12:45 PM
Unable to Access ODBC Data source darienpogi LIVE PLC Questions And Answers 2 October 18th, 2018 11:25 AM
Flame Controllers , and gathering data from them ? Rob S. LIVE PLC Questions And Answers 5 February 7th, 2015 01:58 AM
PLCs, data logging and analysis, need to get up to speed on available software Mr. Blah LIVE PLC Questions And Answers 9 December 19th, 2012 09:17 AM
Help me CIP read data fail from control LGX (1756-enbt)) chenhg LIVE PLC Questions And Answers 1 September 27th, 2008 06:31 AM


All times are GMT -5. The time now is 09:38 AM.


.