With what are you going to shut down the motor?
You must have a relay card in your Agilent 34970 or a separate computer controlled relay.
I see two solutions
1.You can configure the Agilent 34970 to make alarms and pull a relay on a internal relay card to switch off your motor.
2. In your measurement loop you compare measured values with your limits. If there is a alarm you shut down you motor with your switch.
(your attached program is not complete, lots of missing vi's)