LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iteration Issues ?

Solved!
Go to solution

I am running my nested loops, When I am writing my resistance data to the spreadsheet, it starts at the 1st position correctly, I have the Index Array function tied into the Column Switch For Loop, so it starts running  and writing correctly, indexing down 1 position each time writing the new value until it his the Loop Iteration of 8, which is how many times I have the loop running, after I hit 8, the Row Switch cycles to the next and starts the Column Loop Iteration all over, which is what want, but it starts writing my data back in to position 1. Any idea on how I can keep adding them to the list after 8 and continue to fill out the rest of the data sheet?

 

 

aaa.png

aaa2.png

0 Kudos
Message 1 of 12
(2,902 Views)

I would suggest simply passing the resulting values out of the back of the columns loop as an array (either by auto-indexing or your way) and then simply pass them out the back of the Row Loop by a Concatenating tunnel.

 

Loops.JPG

0 Kudos
Message 2 of 12
(2,886 Views)

It is rather difficult to tell exactly what is going on in there. With overlapping wires and some things hidden by your highlight circles it is not clear what is connected to what.  Please post the VI.

 

Several things jump out:

1. It appears that you have i+1 of the Col Switch loop wired to the row inputs of the Index Array and Replace Array Subset. The column inputs appaer to be wired to constants.

2. You probably want to wire the i+1 of the Row Switch loop to the row inputs.

3. Your use of local variables may result in race conditions. NewXL inside the loops may be a possible race condition. it is not clear that there is any data dependence to define which instance will run first. It is very rare to need to use local variables in well written LabVIEW code and your application is not one of those situations.

4. Putting code which requires many seconds to execute inside an event structure may cause problems. Learn to use the Producer/Consumer architecture.

5. It appears that you may have a sequence structure at the right edge of the image. Like local variables sequence structures are rarely needed and should seldom be used.

 

Lynn

0 Kudos
Message 3 of 12
(2,874 Views)

Buenas noches es que quiero desarrollar una apliacion para mostrar una animacion de una cara que tenga gestos controlables

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

¿Puedo sugerir iniciar un nuevo tema en el la sección de idioma foriegn encuentra aquí.

0 Kudos
Message 5 of 12
(2,849 Views)

@OGK.NZ ... I tried that this morning, no luck ... didnt update the front panel datasheet at all until the outer loop cycled ... I need a live feed into the datasheet

0 Kudos
Message 6 of 12
(2,821 Views)

Not sure if this is related to your problem but I do see a race condition where you are reading from the NewXL local, and writing to it in parallel.  You can't know when you read what the value will be.

0 Kudos
Message 7 of 12
(2,811 Views)

@Johnsold ...

 

I know its a little hard to interpret, I am very new to LabVIEW so my skills/architecture arent the sharpest, but I appreciate the advice ..

 

1) I have the i+1 wired into both the Index ArrayReplace Array Subset because I am reading from the Meter Range on the and writing that to the DMM to adjust on one, and the other is appending the array with the Measurement with the other. The constants are because they readings & recording data are in the same Column.

 

2) I believe I have the Iterations correctly wired for the read/write functions, as they are reading & writing from and to the correct Subsets

 

3) I was told I have too many Locals, and I am aware of this, for now I am using them so I dont get confused with all the dataflow wires laid out everwhere. And as far as Race Conditions, as I stated I am new, not sure I grasp the concept of Race Condition. 

Data Dependance , I have a device with 32 pins that need a resistance measurement, 2 Switch Matrix's, & 1 DMM ... Order is as follows: Initiate SM1, Activate Row 1, Activate Column 1, Read Meter Range from datasheet, write Meter Range  to DMM, Take resistance, write resistance to datasheet, Deactivate C1, Activate C2, Read Meter Range from datasheet, write Meter Range  to DMM, Take resistance, write resistance to datasheet, Deactivate C2... and so on, 4 Rows, 8 Columns, hence the nested loops

 

4) I will look into Producer/Consumer Architecture, but what kinds of problems can occur from running an event that takes many seconds?

 

5) I do have a Sequence Structure before and after my main loop, 1st to Initiate & Reset all my instruments, and declare my variables, 2nd is my Executable termination VI as well as closing all the instruments with my Error Handling. 

0 Kudos
Message 8 of 12
(2,809 Views)

@Hooovahh wrote:

Not sure if this is related to your problem but I do see a race condition where you are reading from the NewXL local, and writing to it in parallel.  You can't know when you read what the value will be.

Does this fix the Race Conditon?

 

 

Race.jpg

0 Kudos
Message 9 of 12
(2,807 Views)

@gingram536 wrote:
Does this fix the Race Conditon? 

 

That is the one I was trying to mention.  But as other suggested posting the VI (if possible) would probably help more.

0 Kudos
Message 10 of 12
(2,797 Views)