This paper proposes a routing algorithm that enhances a network lifetime and decreases an end-to-end latency for industrial wireless sensor networks (IWSNs) based on ISA100.11a standard. The proposed algorithm can be applied to large-scale networks where data is conveyed by multi-hop forwarding scheme from source nodes to the sink. By estimating a residual energy and a packet reception rate (PRR) of a next hop, data can be forwarded through the optimal path. Furthermore, the energy consumption and the network latency are minimized by using an integer linear programming (ILP). Simulation results show that the proposed algorithm is fully effective in terms of energy saving and network latency for IWSNs.