10-08-2013 01:44 AM
Hi,
I got introduced to labview a few days ago and I was wondering if someone could help me with the following problem:
I would like to introduce a triggered for loop in my labview code.
To make my question a bit more clear I will give a brief explanation on what I have to program:
In the for loop certain parameters will be calculated. These parameters will be send to a device (for which there is no labview driver) using a RS-232 connection. The device will do a certain process and when completed it will send a trigger back (RS-232). This signal has to be used to trigger the for loop to start the next iteration. The process time of the external device is however not constant.
Thanks in Advance
Seppe
10-08-2013 02:12 AM
Instead of using triggered for loop, you should consider using state machine as discussed in http://www.ni.com/white-paper/3024/en.
10-08-2013 02:24 AM
Seppe,
i assume that you are using NI VISA to communicate with RS-232.
If your instrument sends a real trigger, you can use "VISA Wait on Event" to time your for-loop event based.
If you don't have a real trigger, you have to poll the RS-232 interface for the "trigger" which will most likely mean that you need a while loop instead.
As pointed out, a statemachine is always a good idea (handling stop button for instance!)
Norbert
10-10-2013 12:40 AM
Hi Norbert,
Thanks a lot for your advice, it is doing the job
Seppe