Now You Can Have Robust Data Logging for Free – Part 1
Now You Can Have Robust Data Logging for Free – Part 2
Now You Can Have Robust Data Logging for Free – Part 3
PLC program – Continue
Daily Log Information
MHR10 – Year (XXXX)
MHR11 – Month (XX)
MHR12 – Day (XX)
MHR13 – Weekend 12 am Meters MSW (Most significant word)
MHR14 – Weekend 12 am Meters LSW (Least significant word)
MHR15 – Weekend 12 pm Meters MSW
MHR16 – Weekend 12 pm Meters LSW
MHR17 – Weekday 12-8am Meters MSW
MHR18 – Weekday 12-8am Meters LSW
MHR19 – Weekday 8-4pm Meters MSW
MHR20 – Weekday 8-4pm Meters LSW
MHR21 – Weekday 4-12pm Meters MSW
MHR22 – Weekday 4-12pm Meters LSW
MHR23 – Weekend 12am Utilization % (xxx.x)
MHR24 – Weekend 12pm Utilization % (xxx.x)
MHR25 – Weekday 12-8am Utilization % (xxx.x)
MHR26 – Weekday 8-4pm Utilization % (xxx.x)
MHR27 – Weekday 4-12pm Utilization % (xxx.x)
The real-time clock can be populated by the following:
Note that the format is 2014 11 01 (yyyy mm dd) This will be important when setting up the database for the data.
We will determine the total meters per shift. Remember that our counter will give us one pulse every 0.303 meters.
For testing purposes, a 50ms internal timer is used. Also, the count input should be activated on the leading edge, if the 50ms internal timer is removed.
D19 contains the length per pulse of the counter. In our case D19 = 303
With each pulse of the input, D20 increments by 303. Therefore after 10 pulses the value in D20 will be 3030. This would represent 3.030 meters of product.
To change this into an integer to log the data we will divide D20 by 1000 and store the result in D30.
D30 will now contain the total meters for the shift. This is a 32-bit address location and we want the results to be in a 16-bit address location. (D vs MHR)
Using some math we split our total meters into the most significant 4 digits and the least significant 4 digits.
MHR13 – Weekend 12 am Meters MSW (Most significant word)
MHR14 – Weekend 12 am Meters LSW (Least significant word)
We will finish the PLC programming in part 4 and then continue onto getting the information out of the PLC.
If you have any questions or need further information, please contact me.
Happy Programming,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.