Now You Can Have Robust Data Logging for Free – Part 2

Now You Can Have Robust Data Logging for Free – Part 1
Now You Can Have Robust Data Logging for Free – Part 2 

PLC program 

The programmable logic controller PLC will log the data in the PLC memory using indirect addressing for the data log. Information will be collected based on shifts.
We will use the following shift schedule. Midnight, Afternoon, and Days for the weekday and have two-weekend shifts. Each shift will show the amount of product made, utilization of the machine, and rate of product produced.
Also, we will log a minute-by-minute account of the machine. This will log the amount of product made and the rate at which it is made. We can then graph the machine’s performance to determine if it is running correctly.


Hardware:
Do-More Designer
https://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/Do-more_Series_(BRX,_H2,_T1H)_PLCs_(Micro_Modular_-a-_Stackable)
We will demonstrate everything in the PLC simulator, but the hardware will be the following:

  1. Qty 1 – H2-DM1E – Do-more PLC H2 series CPU module, three built-in communications ports: (1) RS-232 port; (1) USB port; (1) Ethernet port
  2. Qty 1 – D2-03B-1 (110/220 VAC) 3-slot base (includes power supply)
  3. Qty 1 – D2-08ND3 – 8 pt. 12-24 VDC current sinking/sourcing, one common (2 common terminals), removable terminal

Software:
The software will be broken down into several elements. Understanding each element and how it relates to the program is essential.

Shift Bits- These are the shifts that employees will work.
C0 – Internal Bit – Weekend – 12 – 12 am
C1 – Internal Bit – Weekend – 12 – 12 pm
C2 – Internal Bit – Weekday – 12- 8 am
C3 – Internal Bit – Weekday – 8 – 4 pm
C4 – Internal Bit – Weekday – 4- 12 pm

Total Shift Seconds – This is the number of seconds elapsed on each shift. This will determine the percentage of the shift that the machine was running. If the PLC were not in run mode, then this would not function.
D0 – Total Shift Seconds – Weekend 12-12 am
D1 – Total Shift Seconds – Weekend 12-12 pm
D2 – Total Shift Seconds – Weekday 12-8 am
D3 – Total Shift Seconds – Weekday 8-4 pm
D4 – Total Shift Seconds – Weekday 4-12 pm
Note: 8 hour shift = 8 x 60 x 60 = 28800 seconds
         12 hour shift = 12 x 60 x 60 = 43200 seconds
Shift Seconds Reset – Use the leading edge of the shift bit to reset the shift seconds and the total shift seconds.

Next, we have to determine if the machine is running or not. If it is running, count the number of seconds for the shift.
The input X0 is a signal from a proximity sensor for a length counter. Every pulse of the input will represent 0.303 meters of product.

Machine Running Bit:
Determine if the machine has stopped. If the count input stops counting for 2 seconds, then the output stop bit turns on.
Timers are used for both the on and off condition of the input. The input can stop when the input is on, or it can stop when the input is off.
Stop Bit – C10 – Will be on if the machine has stopped counting

Shift Seconds – This is the total number of seconds the machine has run for each shift.
D10 – Shift Seconds – Weekend 12-12 am
D11 – Shift Seconds – Weekend 12-12 pm
D12 – Shift Seconds – Weekday 12-8 am
D13 – Shift Seconds – Weekday 8-4 pm
D14 – Shift Seconds – Weekday 4-12 pm

We will stop here and continue the PLC program in part 3.
If you have any questions or need further information, please get in touch with me.
Happy programming,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimals, Hexadecimal, ASCII, and Floating Points.

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.


Leave a Comment