07-22-2011 08:20 AM
Dear All,
I am posting this question because I am completely stuck in what should be a very simple program, merely a modification of the example one available in the drivers for the HP4140B pA meter / DC voltage source (available online at: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E92C3659CE034080020E748...). I must clarify that I have already had issues with this legacy equipment drivers in the past, and I finally had to use LabVIEW 7.1 (instead of LabVIEW 8.6), so there is a certain underlying difficulty...
The idea is adding a shut-off current to the "HP4140B Example (current vs voltage).vi" program, so that when a certain current value is reached, the measurements are stopped and the voltage goes back to 0V (so that the sample is not burnt when its conductivity increases). All the issues must come from the "HP4140B Read Wave Meas.vi" subVI, which is where I have made changes and where the execution has problems (when I check the highlighted mode), usually because of a timeout error [Please note that the example program runs nicely].
I have tried two approaches:
(1) Since the output from the Read Wave Meas subVI is an array, it's more complicated to compare single values and react quickly so as to avoid burning the sample, so I just removed the indexing of the inner subVI loop (getting just double-type current and voltage values at the interface, instead of arrays), added a greater than block (with a control value), and then put back the subVI and the new blocks in another do-while to generate the arrays [please find enclosed the main program and the modified subVI below].
(2) The alternative that I also checked was making no changes in the main vi and simply adding the greater-than block inside the do-while loop of the Read Wave Meas subVI: by adding an AND gate, I could check that both the pre-existent condition and the new one were satisfied so that the loop continued. Despite the fact that it's a small change, the system doesn't work either.
I would really appreciate any suggestions on alternative ways or any feedback on why the aforementioned two don't work!!!
Regards,
Pablo
Solved! Go to Solution.
07-22-2011 03:01 PM
Hi,
The instrument has a built in current limit function. From the manual: To protect the material or device under test, the 4140B has a programmable current limit capability on both internal dc sources. Current limits of 10-4, lo-“, 10’2A are selected either manually or under HPIB control.
It doesn't turn off the voltage but will limit the total power delivered to the DUT.
Jim
07-22-2011 04:51 PM
07-22-2011 07:39 PM
UPDATE:
I have been able to get it running, basically by means of something similar to what I had referred to in my initial post as alternative (2), and by choosing different values for the hold time and the step delay time (which were causing the time out errors). The new vi is enclosed.
Nonetheless, I am still not able to turn off the voltage after the shut-off current is reached, and so the applied voltage would still be applied and the sample would be damaged. Any ideas regarding how to lower it quickly (gradually, if possible) after the shut-off current is reached would be most appreciated.
07-24-2011 09:14 AM
I do not have the HP driver subVIs but it does not look like you make any attempt to turn off the voltage after you detect the current limit. The most straightforward way might be to put a case structure inside the Read Wave Meas VI which encloses a Write Set Voltage to Safe Value VI in the False case and nothing in the True case. The selector terminal would be connected to the output of the current <= Shutoff Current comparison. If you wait until after the Read Wave Meas VI finishes and then analyse the current/cap array looking for current above the shutoff limit, too much time may have elapsed.
How fast do you need the detect current above limit -> turn off voltage to occur? How fast does the instrument take readings and how long does it take to stop the staircase mode? Can it be stopped before it goes to the stop V setting?
I would probably structure the entire program differently, using a state machine architecture. That is something you should probbaly learn, but may be more than you wish to tackle right now. On the other hand it might be faster to learn that and develop a robust program than to tweak your existing program to do things it was never inteded to do.
Lynn
07-24-2011 09:48 AM
Dear Lynn,
Firts of all, thank very much for your response. You're right: neither in the first nor in the second version of the program I included any attempt to turn off the voltage (I was still struggling with the first part). Since I need to get it running asap, tomorrow (when I have access to the equipment), I will try the approach that you have proposed with the true/false case structure, even if it's not the most elegant one... Hopefully it shall do the trick for now. Nonetheless, I am aware that a state machine architecture would be the most suitable approach, and I may need to completely re-write it afterwards... the idea with this vi was to minimize the changes in comparison to the example so as to get the program running without having to go through too much debugging. I'll keep you updated with the progress.
Once again, thank you very much for your help! 🙂
Pablo
07-25-2011 01:41 PM - edited 07-25-2011 01:42 PM
Lynn,
I have been able to get it running with the true/false case structure (see enclosed files ending in "3"). Nonetheless, now I'd need to add a way of seeing the I vs V graph (or alternatively I vs time and V vs time) as the program is running, not only at the end. I have been checking this post on the topic: http://forums.ni.com/t5/LabVIEW/show-graph-that-is-created-in-a-subvi/td-p/672249, but I cannot find a way of following the steps in LabVIEW 7.1 (in particular the problem is step (6)). Can you think of a way of coming around this? I have prepared two draft VIs (numbered 4), so as to save time. Thank you so much!
Regards,
Pablo
PS: If anyone else reads this and can think of a solution, please post!
07-25-2011 01:42 PM
The other two files
07-25-2011 02:57 PM
It has been a long time since I used LV 7.1, so I do not recall exactly which capabilities exist in that version. Since you have a WF Chart reference you should be able to do the same thing with a the I-V plot.
Other ways include running the subVI in parallel and passing the data via a queue. If nothing else on the main VI front panel maters while the process is running, you can have the subVI panel open when called and close again when finished. That worked as far back as LV3 or 4, I think.
Things are starting to get messy. This is where the state machine begins to shine. About the next time you are told to add another "feature," you will wish you had taken the time now.
I notice that you have set it so that it will (attempt to) set the output to zero when the loop is abotu to stop, whether due to reaching the limit or due to an error. If that is what you want, you could just put the contents of the False case immediately outside the while loop before the Send Message. The case structure is not needed. If an error occurs do the HP4140 VIs execute? Many VI do nothing except pass the error along. You may need a dfiferent method to shut down on error.
Lynn
07-25-2011 03:15 PM
Dear Lynn,
There will be no additional functionalities, the "real-time" graph is going to be the last one, lol 😉
The problem, as I explained in previous email, is that I would need to do something similar to what Mysticfree explains in the aforementioned discussion (http://forums.ni.com/t5/LabVIEW/show-graph-that-is-created-in-a-subvi/td-p/672249), but I cannot get it working because some of the blocks that he makes a reference to are not available (in particular "VI server reference" does not appear, and the "control refnum" options are slightly different...) . The program up to this point only shows the I-V curve once it has finished the execution, and I'd need to see it "live", that's why I wanted to show the graph from the sub-VI in the main VI. You mentioned that since I have a WF Chart reference, I should be able to do it... the problem is what block should I use in the main VI so as to replace "VI server reference"?
The other possibility that you proposed (opening and closing the subVI's panel) is easier? What would I need to do in that case?
Thank you so much for your time and patience!!!
Regards,
Pablo