Optimal Triggering of Networked Control Systems