rsdoran
Lifetime Supporting Member
I got this PM from rayc about a program that involves time and information being put on an Excel sheet. I am going to refer him and his request to the forum; albeit I may still answer.
rayc said:Hi rsdoran,
My name is Ray and I work in a cannery in Australia. I am very new to PLC programming and my boss asked me to write/modify some PLC code (RSLogix 500) my colleague left me before he resigned. I have a problem with a "second pulse" and I thought you may be able to help me.
Basically I have this Excel file that talks to a PLC does a DDERequest to a SLC 5/05 every second 24/7. This excel file will then be saved automatically at the end of every shift (8hrs or 480 mins). There is a second pulse generated by a Timer On Delay (Time Base 0.01, preset 100) and a XIO contact is attached on the same rung and used in many others. All counter acc values in the PLC will also reset at the beginning of each shift and it's done by comparing S40-S42 with a preset value.
At the end of the shift, the "shift" counter is always short of approx 5 mins (475min) and I realised that the TON is running a fraction slower than the PLC clock S42.
I've tried using S:42/0 as a second pulse output it in a counter then multiply the accumulated value by 2. Again this is done throughout many rungs. I got 478 mins out of 1 shift, which is not so bad but other values do not add up to 478 mins.
For example in my situal,
Shift minutes = 475 min
Runtime = 300 min
Downtime = 175 min
Cleaning = 0 min
Available time = Run + Down + Cleaning time
Each variable above has a S42/0 pulse, a CTU and a MUL by 2.
Shift time should equal Available time but it's not at the momemnt.
The Scan Times for this code are
S:22 = 2
S:23 = 1
S:3L = 0-1
S:3H = 10
S:35 = 6-7
Sorry for this long mail and I hope you can understand what I am trying to say. I am really desparate to find out the best way to get a accurate second pulse. Please help me..please.
Thank you very much from downunder.
Regards,
Ray