LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch Matrix / Resistance Reading / Data Record ... Timing Issue??

Hello All, 

 

So I will start with I am pretty new to LV, so my programming techniques are the best out there, so bare with me ... So I have this device I am trying to take resistance measurements on. It has 20 pins and I have a fixture to place device in and a switch matrix connected to that and in turn connected to an Agilent DMM, all while recording the data on a datasheet. 

 

What I am needing is for the Switch matrix to ... Connect Row 1 : Column 1 ... Take a measurement ... Record on datasheet ... Disconnect Row 1 : Column 1 .. Connect Row 1 Column 2 ... Take Measurement ... Record ... Disconnect Row 1 Column 2 ... (repeat)  all the way to R4C8 and will then Switch to the Second Switch Matrix and continue.... and so on, nevermind the SubVI's [U2751A] , those are working perfectly.

 

When I run VI, it seems I am having a timing issue with the switching and the taking/recording data. I know its not the best practice to just get the timing down perfectly, but I would rather have it sequentially run these steps in that order to achieve the most accurate data. What is happening is for the first 5 or so switching/measuring/recording/switching again, seems fine, but then the timing is going bad and messing it up ... Anyone have any ideas on how I can Sequentially run these steps without having to depend on a time delay to get them functioning ... any help would be greatly appreciated... 

 

 

 1st Switch Matrix Action

Switch Matrix 1.png

 

 

2nd Switch Matrix Action

Switch Matrix 2.png

0 Kudos
Message 1 of 9
(2,857 Views)

One potentially huge problem in your VI that I can see from the limited screenshots is that you have one event structure buried inside the other.  This can lead to very unpredicatable behavior, and can lock up  your application solid depending on if you have the setting Lock Front Panel until event completes on any or all of your event cases.

 

Any situation that relies on a user doing things in a particular order so that the code can pass through the event structures cleanly is asking for problems.

 

Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2012 Help

0 Kudos
Message 2 of 9
(2,838 Views)

Here's the whole VI, any suggestions ?

0 Kudos
Message 3 of 9
(2,834 Views)
I'm sorry but that is an extremely poorly written program. You have nested event structures, a while loop inside the event, too many locals, and the measurement is completely asynchronous from the relay switching.

The relay switching and measurement need to be in the same loop. Use dataflow (the error in/out terminals to control execution order. Close the relays, measure, record. Repeat. Look at the producer consumer with events. If you use an event structure with a single measurement cycle, it will work but will it be problematic.
0 Kudos
Message 4 of 9
(2,828 Views)

well like I said, I am NEW to labview, not a veteran, but thanks for the beating

0 Kudos
Message 5 of 9
(2,824 Views)
Start with a single for loop that contains both the switching and measurement. Use wires instead of the locals. Post your results and we can go from there.

p.s. The purchase of LabVIEW includes the basic classes for free.
0 Kudos
Message 6 of 9
(2,820 Views)

I've thought of that, but then ran into the issue of triggering the second Switch Matrix to begin

0 Kudos
Message 7 of 9
(2,816 Views)
I did not notice the second matrix. That can be simply done with another for loop. Passed in an array of switch resources.
0 Kudos
Message 8 of 9
(2,806 Views)

Ok, So here is the updated version with the nested Event Structures removed and replaced. Seems to run fine, but now I was wondering what you ment by changing to the 2nd Switch Matrix with another For Loop. Also, which Delay is the one to where I can Connect the R/C Switch, let it settle for a second, then read/record data. When I tweak them all it always seems to not change.

 

 

 

Loops.png

0 Kudos
Message 9 of 9
(2,755 Views)