05-20-2014 07:48 PM - edited 05-20-2014 07:48 PM
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?
Solved! Go to Solution.
05-20-2014 08:20 PM
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.
05-20-2014 09:21 PM
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
05-20-2014 11:30 PM
Buenas noches es que quiero desarrollar una apliacion para mostrar una animacion de una cara que tenga gestos controlables
05-20-2014 11:44 PM
¿Puedo sugerir iniciar un nuevo tema en el la sección de idioma foriegn encuentra aquí.
05-21-2014 07:40 AM
@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
05-21-2014 07:55 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-21-2014 07:57 AM
@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 Array & Replace 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.
05-21-2014 07:59 AM
@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?
05-21-2014 09:05 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord