LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered For loop: external trigger

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

0 Kudos
Message 1 of 4
(2,913 Views)

Instead of using triggered for loop, you should consider using state machine as discussed in http://www.ni.com/white-paper/3024/en.

0 Kudos
Message 2 of 4
(2,902 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 4
(2,897 Views)

Hi Norbert,

 

Thanks a lot for your advice, it is doing the job

 

Seppe

0 Kudos
Message 4 of 4
(2,855 Views)