Looking to bring 24V inputs to PC to store in database
For an industrial application I would steer away from the Arduino or any hobby board solution. It won't be industrially hardened, you'll have to sort out 24V to 5V interfaces, power supplies, mounting, etc., and worst of all, you'll be the only one able to maintain it.

Standard industrial approach would be:


Use a small brick PLC with Ethernet comms capability.
Have the program measure the box length and save the value to a memory location. At the same time increment a counter in another location to indicate that a reading has been taken.
Use an OPC (Open Platform Communications) server to connect from your computer to the PLC. You configure the OPC device connection and "tags" (memory locations) that you wish to monitor and the OPC makes the tag data available to your operating system for reading by OPC clients.
Add an OPC data logger with a connection to an SQL database and you can begin logging. Trigger the logging the length "on change" of the counter.




Figure 1. Source: Inductive Automation.

OPC servers are similar to printer drivers in that they make the hardware available to all applications on the host computer.

Most of the major manufacturers including Siemens, Allen-Bradley, Mitsubishi, Automation Direct, etc., make low cost brick PLCs often with built-in LCDs and cursor, Enter and ESC keys.

There are many OPC vendors. The OPC servers may be available from the PLC manufacturer or third-party vendors. Have a look at Inductive Automation's Ignition SCADA package. It has extremely powerful OPC server, data historian, unlimited Java based clients, unlimited tags, browser based admin, and an excellent comprehensive series of short instructional videos at Inductive University. There is a "light" version of their product which may suit you. You can download full or light version for trial with two-hour runtime.

For the database you can use MySQL or MS SQL Express both of which are free.

Think about where this development is likely to lead in the coming years and pick a scaleable solution.