LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Last value from a loop and values inside the loop

Hi

Sorry about the confusing heading above, but its late at night and better words do not occur to me rightaway. Let me explain my situation.

I have a single instrument (a voltage source) that is being swept from one value to another for an experiment. It has three VI's : 1. enable o/p. 2. Set a voltage output level. 3. diable o/p.

I am using the error in and error out pins of instrument vis to properly sequence operations. I connect the error out pin of VI 1 to the error in pin of VI 2. Each of these errors is a cluster of three values.

When I try to wire the error out from VI 2 inside the loop to VI 3 outside the loop, the wiring breaks as I am then trying to connect an array (a 1 dimensional n member array of error outs) to a single error in pin. Trying to connect it to an array outside the loop is obviously the same. (I am making an assumption here - while the loop is running, I do not need to make certain of the sequencing of operations by putting a feedback node on VI 2 - that would mean something quite different in any case.).

So, how do I pass the last value (in this case, the error out cluster from the last stage) to error in pin of VI 3 ?

I have read that it might be possible using shift registers. I am quite new to LabVIEW. A somewhat detailed description of what I need to do would be nice.


Thanks.
0 Kudos
Message 1 of 4
(3,968 Views)
Hello,

There are basically two options:
  • Handle the errors outside the for-loop
  • Handle the errors inside the for-loop
For you solution 1 is the easiest achievable, after the for loop use the 'Merge Errors' VI this will change the 1d-array into a cluster. The downside is that if an error occured later states of the loops don't know this

Solution 2 uses the shift register you mentioned. To use this you have to right-click on the right hand-side tunnel of the error wire (where it leaves the for-loop) and select shift register, sequentially your mouse pointer changes into an downpointed arrow, click on the entry tunnel on the left of the for-loop. What happens is that an error in the for loop is remembered into the next iteration (use execution highlighting to watch these)

Here is some code:


A good start might be:
The link to the LabVIEW Learning Center is here

Ton

Message Edited by TonP on 09-25-2006 08:01 AM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 4
(3,961 Views)
Hello,
Just to add to TonP's help, see this and feel free to ask more question if I'm not clear.



Hope this helps 😉

Message Edité par TiTou le 09-25-2006 07:50 AM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 4
(3,958 Views)
Hello,

Thanks for the suggestions ! Using the shift register gets rid of the broken wires. I have not tested the application yet. Will get back to you when I do.


0 Kudos
Message 4 of 4
(3,923 Views)