Our client is a market leader in oil field logistics and transload services. They own and manage a nationwide network of transload terminals where they store and move millions of pounds of bulk sand, crude, and other materials to and from trucks, railcars, silos, and other containers. Their services are a critical element in the energy supply chain in North America.
At each of the client’s loading facilities, they have operate one or several truck scales, industrial scales large enough to weigh an entire 18-wheeler, truck and cab.
When a truck arrives on site, the facility operations staff weigh the truck in, then sends the truck to get loaded somewhere else on site. After loading, the truck is weighed again. So you have an initial weight (tare) and a final weight (gross). The difference gives you the weight actually loaded on the truck while it was on site (minus any fuel consumed during the time period).
The scales have a series of pressure-sensitive load cells, which are all connected to a metal box, called an “Indicator” which is located in the small office where the terminal operator sits, at a computer.
The client wanted to be able to have that scale value feed directly into their custom terminal management system, so the operator doesn’t have to manually type the number in, and risk incorrect entry. This application, by the way, is a web-based cloud application, not something running locally on the PC.
We found there was a wide variety of scale indicators from different vendors in use. Some were network-enabled with RJ-45 ethernet ports or even wireless ports, but a lot just had 9 pin serial ports. We found that if we connected a PC to the serial or ethernet port on the scale, via Hyperterminal, it was constantly streaming a steady flow of raw data. However, the format of that data varied, depending on the vendor.
We ended up building a Node.JS service, which would open a socket to the scale indicator, and read the raw data stream. We built separate profiles for the different formats used by different scale vendors, so the service could interpret them. We also added logic to ignore variations caused by wind, and cut down network chatter. Then we deployed this service on a little headless appliance PC at each terminal.
Initially, the service simply provided a REST API to allow us to request scale weights on demand, but this required port forwarding at each location, which was not always possible, and when it was, made setup more complicated. Later, we reworked it so the service would push the weight data up to the cloud whenever there was a change.
Either way, the terminal operator, sitting at the PC, entering data about the truck could simply click a button, and capture the weight from the scale inside the web application, cutting data entry errors down dramatically, and making the data entry process much smoother.
The weights collected from these truck scales are used to automatically generate a bill of lading for each truck departing one of the client’s transload facilities. Feeding the scale data directly into the client’s custom web application, not allowed saved employees time improved truck processing efficiency, it also eliminated a source of errors, allowing the client to have confidence that the information printed on their bills of lading is correct.