10-02-2008 07:30 PM
I'm going a little nuts with some hardware bug and could use some help. I've got 6 test stations all identical, and at one of them I'm having this problem, but not at any other.
Background:
1) Automated testing of encoder signals, including amperage check
2) Amps are measured with a DMM (PXI-4060 or PXI-4065). I actually measure voltage drop across a shunt resistor to get amps.
3) "Check Amps" (see jpeg) is a state that occurs at the beginning of the test. The state is definitely being reached, because it is during this stage that I turn the motor on.
4) "Amp Bench" is a separate bench test that can be pulled up to just check the amps apart from running the full test.
5) The Volt SubVI is more or less an NI example slightly modified to suit. See jpeg
The Problem:
When I pull up the main program and pick a part number, the test runs but fails for amps. Looking at the results, the amps are zero, so it seems as if there was no reading at all. If I repeat the full test, same result. That is, the “Amp State” part of the program is executing, but returning with zero. However, if I run my Amp Bench, it reads the amps OK, and thereafter running the main test is a Pass, the DMM is online.
Like I say, this is at this one station only, same program and hardware as elsewhere. Things I’ve done to eradicate this:
1) Swapped DMM
2) Swapped entire PXI chassi
3) Enabled the Rest and ID Query on the Volt SubVI
4) Updated the PC bios
5) Added a loop in the volts to go around a couple of times.
Arg!
10-02-2008 11:42 PM
Hi Pablop,
This is a "long-shot", but try adding a delay in "Amp State" - say 300ms - between the Digital output and the Amp reading. Timing is something that can change slightly from PC to PC, and it's possible the Amp measurement is being made before hardware has reacted to the new DO state.
Cheers!
10-03-2008 12:06 AM
You mentioned that you added a loop to make the Amp State read the DMM several times. Was it enough times?
In your test program, run the measurement out through an auto-indexed tunnel and look to see if the voltages are good right at the start of the array, or if it takes many iterations to get the value you want. I'd make sure the DMM is in whatever state happens before Amp State before running this test.
If the voltages in the array are good from the start, then I got nothing else for you...
10-03-2008 11:24 AM
Hi Pablop,
When you switched the hardware did the problem follow the hardware or stay with the machine and software?
You say "is a Pass, the DMM is online." do you mean that the main program now shows a correct reading?
I like tbd's idea about the wait. Additionally I was wondering if you could dump the results from AmpBench where it is going to the "Amps" indicator to a text file so as to see if even the first iteration of the loop gives the correct value.
10-03-2008 12:22 PM
I repeat…Arg!
Is it any coincidence that Meriam Webster’s Word of the Day today is Red Herring?
I have no solution yet, just more Red Herrings. OK, here we go:
1) tbd, adding a delay. That’s what the 2000 ms is about in the “Amp State” jpeg at the Motor SubVI. The default was 1000 ms, I added a whole second, no change
2) Jason_D, yes once I runt he Amp Bench the full final test now works, Amp State returns correct amperage. If I close the program and start again, same thing, I have to run Amp Bench again to get things working. WRT to hardware swapping nothing has made the problem go away, and the only hardware left is the PC, so that’s next, what a pain.
3) Gnunesjr, Great idea. I added the array and surprise, at my station in any event the array has amps even at index=0, see attached jpeg. I liked this so much that I made a little executable out of this so I could run it stand alone. Works fine on my station. Won’t run on the problem station at all, and only occasionally on others, see jpegs. VI attached if anyone wants to poke at, probably need to load NI-DMM drivers. It doesn’t lock up the computer, just hangs the VI.
4) Interestingly enough, along the same vein of 3) above, I also made an exe out of the subroutine Volt, see attached jpeg. This has no loop, fires up when executed, runs the DMM for one acquisition and ends. Works fine even on the problem station, see jpeg.
Arg
10-03-2008 12:24 PM
10-03-2008 12:35 PM
Is there a good reason to open and close the sessions for each measurement with the DMM? On most systems the initialization and shutdown are done outside the loop.
I notice that you do not have the error cluster wired out of the Amp State case. Do you get any errors?
Lynn
10-03-2008 02:15 PM
I do the same thing with most of my hardware, scopes included. I open sessions and then close them. I'm not getting any errors reported.
I suppose I can try moving parts out, but I can't see that this is the root cause of the problem.
And by the way, my simple Volt.exe locks up as well, even at my station. So, maybe I've reduced the problem down to something in this VI. Time to start an NI service request I suppose.
10-03-2008 03:13 PM
It’s definitely boiling down to something in the Open Session VI. Crap this is frustrating!
See attached revised Volt VI. I’ve added a loop to read the DMM, but more importantly, I’ve put the Open Session VI in its own flat frame and a simple message. This VI runs on my HP station, and another Dell work station, but fails on some of the HP work stations on the floor.
I can’t figure out why my Amp Bench always works, maybe because the Volts VI is in a loop, which includes the Open Session VI?
10-03-2008 04:51 PM
OK Jason, I found it.
In the Check Amp state, the Output Task subvi (just before the Volt VI) was generating an error because the virtual channel DO 7 did not exist on that machine. It was being passed to the Volt VI, but not being handled I guess. I still don't know why various subroutines I made like the Volts vi would crash standalone, but at this point I'm moving on.
I suppose I should really brush up on error handling. What's the best method? Just stick the simple error handler all over the place in the sub vi's?
Probably a question for another forum.