LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing out indicators after each iteration in a "double for loop" program

Hello,

 

I really need a quick help here. I have a system here that I quickly simplify for you to help me. I am taking some measurement in 5 RUNS. Each run has Horizontal and Vertical measurements. There are then 2 for loops here.

The second loop with iterate a number of time (36) and the measurement is taken after each iteration (so 36 measurements) in the vertical position and then 36 measurement in the Horizontal position for each run. Measurement are shown in Maker1 and Marker2

With the first run things are really ok. But my problem is that after the first run Marker1 and mark2 indicators are not being cleared out for other data to show properly. Data from those other RUNs are just being placed just below data from the first.

We just want to se that after each iteration, the next iteration shows its own data alone.

How do I clear this out after each iteration?

Your quick help will really be appreciated.

0 Kudos
Message 1 of 5
(1,173 Views)

Hi agnya,

 

Your problem is related to "Uninitialized Shift Registers" - you can read more about shift registers here: Shift Register.

 

In particular, (image below) I've circled the uninitialized SRs that are storing the memory of the previous "Marker" values.

You want to probably connect these to SRs on the outer For loop, and then reset them for each run (you said you have 2 For loops, but there are actually 3 - you want the SRs to be wired in the inner two, and have an empty string wired to the initialization of the middle For loops SRs (the outer For loop won't have SRs for the Marker values)).

cbutcher_0-1611032180110.png

 


GCentral
0 Kudos
Message 2 of 5
(1,115 Views)

Thank you for your ideas. Not sure that I am getting it right.

Please see the attachments, I just put 3 loops together and simplified the 3 loops to simulate a bit what is needed.

When running this, after each run I should be getting what is shown in this word file.

Please some help.

 

Thank you.

Download All
0 Kudos
Message 3 of 5
(1,087 Views)

Hello,

Any help for this?

 

Thank you.

0 Kudos
Message 4 of 5
(1,054 Views)

Hi agyna,

 

A few points:

  • Generally, saving code to an older version will help more people on the forums help you - see Saving for a Previous Version.
  • I realise this is simplified, but take care to avoid duplication if you can - your Local Variable for Polarization could be avoided by moving the indicator outside of the Case Structure.
  • You need to add an End-Of-Line character somewhere, consider if you want "\r", "\n" or "\r\n" (these have constants in LabVIEW, or you can switch the display mode of string constants and type them with the "\" character.
  • Although I suggested moving the initialization of the Shift Registers, you replaced them with Feedback Nodes. This is still fine, but you still need to initialize them further out. Right click on them and choose "Move Initializer One Loop Out". Move your Empty String Constant out to the place where you want to reset the string indicators. You should get something like this:

cbutcher_3-1611405688748.png

 

cbutcher_2-1611405599263.png

 

 

Note that you'll still need to do the same for the other case too - it may be easier (depending on exactly what you want) to use the Shift Registers instead, but you have to wire them through the loops (as shown in the lower case).

 

 

 


GCentral
0 Kudos
Message 5 of 5
(1,044 Views)