The Fourth Industrial Revolution (Industrial 4.0) is coming, and this revolution will fundamentally enhance the way the factories manufacture products. The conventional wired lines connecting central controller to robots or actuators will be replaced by wireless communication networks due to its low cost of maintenance and high deployment flexibility. However, some critical industrial applications require ultra-high reliability and low latency communication (URLLC). In this paper, we advocate the adoption of massive multiple-input multiple output (MIMO) to support the wireless transmission for industrial applications as it can provide deterministic communications similar as wired lines thanks to its channel hardening effects. To reduce the latency, the channel blocklength for packet transmission is finite, and suffers from transmission rate degradation and decoding error probability. Thus, conventional resource allocation for massive MIMO transmission based on Shannon capacity assuming the infinite channel blocklength is no longer optimal. We first derive the closed-form expression of lower bound (LB) of achievable uplink data rate for massive MIMO system with imperfect channel state information (CSI) for both maximum-ratio combining (MRC) and zero-forcing (ZF) receivers. Then, we propose novel low-complexity algorithms to solve the achievable data rate maximization problems by jointly optimizing the pilot and payload transmission power for both MRC and ZF. Simulation results confirm the rapid convergence speed and performance advantage over the existing benchmark algorithms.