Phil,
there is nothing wrong with your code! The only thing you should have a look at is if you really need to check (poll) the line state that often or - if not - if an On Cycle loop would do the job as well once or twice a second.
best regards,
G. Nied
Georg Nied Software-Development Hansestr. 7 51149 Cologne Germany
Tel: +49 (2203) 9770915 Fax: +49 (2203) 9770924 E-Mail: info@gn-software.de
-------- Original Message --------
Subject: [vrf] newbie advice sought... (15-Nov-2004 14:28)
From: P.J.Vossler@exeter.ac.uk
To: vrf@agilent.com
> Please can someone advice the best way to "wait" for an external i/o event?
>
> My system consists of an intelligent stepper motor controller that is
> controlled from Vee via a serial port. I can monitor the "DSR" line via
> a direct i/o object to tell when motion is taking place. Essentially I
> want my program to "wait" or "sleep" until movement has finished i.e.
> DSR toggles low.
>
> Currently I am using an until break object with a direct i/o and if/then
> clause to wait for a change in DSR.
>
> e.g.
>
> Until Break
> READ IOSTATUS DSR x
> if X==0 then
> Break
>
> is there a more efficient method?
>
> (please accept my apologies if this has been asked a thousand times before)
>
>
> Many Thanks
>
> Phil Vossler
> School of Physics
> University of Exeter
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
> if/then clause to wait for a change in DSR.
Well it's not ideal, but it will work.
You can use a Device or Interface event (on the I/O->Advanced I/O menu) to
wait for events on devices or interfaces. As far as the serial interface is
concerned you can wait for the Data Available event - so if the device would
send some kind of string (like "complete") instead of toggling DSR you could
use that.
Other interfaces offer more choices.
-SHAWN-
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".