Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exiting script when direct connection is disconnected

Status
Not open for further replies.

RX87325

Programmer
Mar 17, 2005
3
US
I making a direct data connection to a lab instrument.
I prompt the user for data information and then connect to the instrument.

My problem: I need to do some shutdown processing after the user shuts the instrument off.

The ICON on the tool bar changes from connected to disconnnected when the instrument is shut down.

What event do I watch ("WHEN" statement) to catch the disconnect action?

 
I just noticed that when the instrument is on and running the "CD" icon is RED.
When the instrument is shutoff the "CD" icon returns to gray.

I have tried to setup a "WHEN" event based on $CARRIER.
Does anyone know what the value of $CARRIER is when the icon is RED?

advTHANKSance
 
$CARRIER is 1 when the light is red (connected). You can't specify what the value of $CARRIER should be in the when $CARRIER command, but you can check for the appropriate value in the procedure called by the when command and act appropriately.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top