Forum

Daily production co...
 
Notifications
Clear all

[Solved] Daily production count from a CompactLogix 5069 into Excel, no SCADA on site

8 Posts
3 Users
0 Reactions
82 Views
(@tobik23)
New Member
Joined: 2 years ago
Posts: 0
Topic starter   [#188]

Morning folks,

Customer site, not my usual kit. CompactLogix 5069-L320ER, Studio 5000 V33, no SCADA at all, one PanelView Plus 7 on the line. They want one row a day in an Excel sheet, date, good count, reject count, and the production manager opens it Monday morning.

Somebody before me set up the sheet with a DDE link through RSLinx Classic on the engineering PC, polling the counters every minute. That works while Excel's open and the PC is logged in, which it isn't most nights, so Monday's sheet has gaps and the manager's stopped trusting it. I offered to have the L320 write a file over FTP overnight instead and got a look from the customer's IT, probably deserved.

What's the smallest thing that'll write that row every night whether anyone's logged in or not, because I'm not sure what's normal on a site with no SCADA at all?


Advertisement

   
Quote
(@stevek)
New Member
Joined: 2 years ago
Posts: 0
 

DDE through Linx, there's a name I haven't heard in a while. It was the way once.

Trouble is what you found, Excel has to be open. Does that engineering PC at least stay powered? And is the count totalised in the L320, or is it a live value that resets at midnight?


Advertisement

   
ReplyQuote
(@tobik23)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

PC stays on, nobody's logged in after 17:00. Count resets at midnight, there's a rung that zeroes it on the day change. Nothing keeps yesterday's number anywhere, so if you miss the poll at 23:59 it's gone. Which I think is half the problem.



   
ReplyQuote
(@eddieb)
New Member
Joined: 1 year ago
Posts: 0
 

Then the first fix is in the PLC, not the PC. Before the rung zeroes the count, move it into Yesterday_Good and Yesterday_Reject DINTs with the date alongside. Anything that reads once a day, at any time, then gets the right number. That removes the 23:59 race.

For the row itself, something that runs as a service rather than a spreadsheet. Kepware's data logger plug-in or a Node-RED flow on that PC, reading the three tags at 00:30 and appending a line to a CSV on a share. Excel opens CSV without complaint. The PanelView datalog would do it too, but then someone has to fetch the file.

Skip the FTP out of the PLC, IT were right. Someone did a decent article on the logging side: https://plctr.com/best-practices-for-plc-data-logging-and-remote-monitoring/



   
ReplyQuote
(@tobik23)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Added the Yesterday tags, that part was ten minutes. Node-RED as a service on the PC, an EtherNet/IP node reads the three tags at 00:30 and writes a line to a CSV on the share.

Ran it last night. Line's there, date's right. One problem, the count lands in the file as 1234.0 and the manager's sheet does a lookup on that column and misses it.



   
ReplyQuote
(@stevek)
New Member
Joined: 2 years ago
Posts: 0
 

Format it as an integer in the flow before it writes. And put a header row in once. The manager will stop asking.



   
ReplyQuote
(@tobik23)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Cast to integer in the function node, header row added, three nights clean now. Manager opened it Monday and the weekend was in it. First time.

The old setup could never have worked, when you look at it. DDE wants the sheet open and somebody logged in, and the count wiped itself at midnight with no copy kept, so one missed poll and the day was gone. Latching Yesterday_Good and Yesterday_Reject in the L320 before the reset rung is what fixed the real problem, and after that anything reading once a day gets the right number. Node-RED as a service does the writing.

The night the clocks change the day is 23 or 25 hours and I haven't thought about what the reset rung does with that. Probably fine. Probably.

Thanks eddieb, stevek.



   
ReplyQuote
(@eddieb)
New Member
Joined: 1 year ago
Posts: 0
 

Good result. The clock change one is worth ten minutes in October.



   
ReplyQuote
Share: