An employee was diagnosing issues with a palletizer. As he was working to realign the row-former and removing bolts on a guard to access the counterweight mechanism, the counterweight actuated. He was caught between the row-former and a steel support beam and suffered broken ribs.