Switch Hardware and Software

Showing results for 
Search instead for 
Did you mean: 

Number generating loop

A switching system uses a Channel list to apply power, and sequence through test points. If the list comes in a comma delimited spreadsheet file it can be stored in an array and the switch points can be seperated out to close the desired points, wait while testing, and then open the switch points before going to the next points/closures in the list. It would seem that being able to index or increment a testing sequence for the number of array entries might be the way to go. Although, I find that generating contiguous numbers seems to result in a 1D array that also needs to be indexed or incremented. What is a good (the best) approach with LabView 6?

Maybe I'm looking for something similiar to this, done in "Basic":

10 CLS
20 X = 1
30 P
rint "This is the start"
40 Goto 1000
50 If X < 5 Goto 40
60 Print "Done"
70 End

1000 Print "I've been here";X;"times."
1010 X = X + 1
1020 Goto 50

Also could be done with "line labels", "Gosub" and "Return".
0 Kudos
Message 1 of 2
If you have already put your comma delimited string into a string array, I think that you can do what you are looking for by just using a For loop in LabVIEW. If your string array is outside of the For loop, and you wire the array into the loop, LabVIEW will auto-index the array. So with each iteration of the For loop it will pull out a single element in your list of things to switch.

Each of your tests could then live within the confines of the For loop. You could use the "i" (the iteration counter in the loop) as an input to a case structure where each case would implement a different test.

I'm not confident that this is the best way to solve your problem for scaleability reasons, but it seems like if you get that far then you ought to be able to extra
polate as needed.

Hope that helps!
0 Kudos
Message 2 of 2