Automated Testing - Page 1
Forum section: electronics / projects

author: David_AVD
author_rank: Super Contributor
timestamp: June 25, 2012, 09:20:16 am
content: Just joined EEVblog forum today and I have a question already!I'm setting out to automate some hardware testing. This will involve simulating external input(s) as well as monitoring output(s) of the DUT. These I/O will be serial comms, contacts, voltages, pulses, etc.For example, the PC may send out some serial data and then check (or log) how the hardware responded or time an event, etc. There would need to be some sort of scripting to drive the events and judge the results.Writing the PC software should be possible for me, but I was interested to see if such software already exists apart from Labview which seems to be > $3000 for the event driven version. If so, is there a standard interface method?The plan is to develop hardware and software plugins as the need arises and have them integrate on a common platform.

author: Thomas
author_rank: Regular Contributor
timestamp: June 25, 2012, 05:04:09 pm
content: For automatic testing,http://www.ni.com/modularinstruments/is used a lot.But, as you have discovered, prices are not hobbyist-friendly.There are ways of accomplishing something like this at a lower price, though. Using standard instruments with more traditional computer interfaces (USB, RS-232 etc.) would be a good start.

author: nctnico
author_rank: Super Contributor
timestamp: June 26, 2012, 12:21:48 am
content: There are many cheap PLC systems on the market. From these its easy to build an automated test system without much programming.

author: David_AVD
author_rank: Super Contributor
timestamp: June 26, 2012, 12:59:32 am
content: I am looking at a PC based system as I want to output many different types of data / signals. Serial comms, DMX, E1.31 streams, contacts, voltages, pulses, etc.Though I have already written quite a few software tools, a lot of them overlap in functionality and I can see that a more universal approach could be better.Coming up with a somewhat common API for USB interfaced hardware is one area that I need to look hard at.I've just downloaded the evaluation version of LabVIEW to see if that's a viable option of if it gives me ideas on the direction to take.

author: free_electron
author_rank: Super Contributor
timestamp: June 26, 2012, 02:46:23 am
content: Forget USB if you need a standards based tests system then LXI is the way to go. plenty of manufacturers have machinery that has LXI on board. you can easily find pattern generators to do all your digital work in the form of a PCI or PCI-x card that you can drop in a standard pc. Installing VISA , either from National instruments or Agilent, then gives you a uniform way to access any kind of test equipment, whether GPIb , LXI , USB , Serial ,printeport or anything else.The Visa API exposes a visa class. you instantiate the VISA core and pull the instruments as objects. in a few lines of code you control all the machinery you want.I have large automated testsystems that run automatic test for device validationa nd characterisation. it's just a couple of 19 inch racks full with stuff from Agilent / keithley , or sometimes even simply a bench setup. some of the stuff sits on USB most on GPIB and some scopes go through the network.As for development system : Visual basic express 2010. Don't laugh at it. It serves me well. It's free , code development is a snap. Most examples in the programming manuals of test equipment are given in basic anyway ... if an unexpected event happens i can go in break mode and drive it from the interactive window. Been running for years without a single hiccup.

author: David_AVD
author_rank: Super Contributor
timestamp: June 26, 2012, 03:13:37 am
content: I don't wish to go with anything that requires adding cards inside a PC. This is for use on various desktop and laptop PCs.The reason I am thinking USB as it's easier (for me at least) to develop hardware for than Ethernet. Creating various modules with with USB interfaces would be within the grasp of many more people.As for PC software, I use Delphi on an almost daily basis so I'd probably develop in that. The plugins could be done as dll's though.

author: free_electron
author_rank: Super Contributor
timestamp: June 26, 2012, 03:41:58 am
content: fine, VISA can be called from delphi as well. no problem.it wan't clear that you want to develop hardware a well. i though test system as in buy a bunch of test equipment connect it together and focus on the test scripts...if you do USB ... make sure you isolate everything !Real testquipment has isolation....

author: David_AVD
author_rank: Super Contributor
timestamp: June 26, 2012, 04:31:44 am
content: No problem. As per my first post, I am willing (and able) to develop the custom hardware as well.Isolation of the signal side from USB is a given, though I should have said it explicitly I guess.Coming up with my own API will be a challenge, but at least that's easy to change in firmware / software.

author: amspire
author_rank: Super Contributor
timestamp: June 26, 2012, 06:57:56 am
content: Quote from: David_AVD on June 26, 2012, 04:31:44 amYou definitely can set up some automated test without spending big $$$'s.You will probably need to set up some kind of dual pole relay matrix. Always try and add series resistors wherever possible. Also add protection for your instruments, particularly signal sources. You are testing faulty boards, and that means that the nodes you are testing can easily have a big fault like a short to a power rail. You have to make sure that the autotest hardware can survive the board faults.A big issue you will have is convincing everyone that the autotest measurements are accurate, particularly if every second board fails marginally. People are more like to believe the results of a high end Agilent meter attached to the test system, then your own micro-based A/D board. Definitely keep a reference test board along with the test jig. This is a board that has the bench test results recorded, and it is used to verify that the autotest jig is working correctly. It is really important that you can work out very quickly if production boards are failing, or if the Autotest hardware has a problem, like a stuck relay.Richard.

author: David_AVD
author_rank: Super Contributor
timestamp: June 26, 2012, 08:51:50 am
content: There is no issue with result certification in my case. The testing is for in-house use and I own the company!My main use is to poke the DUT with data and check that it's doing the right thing(s). It will get used during product development just as much as post manufacture testing.The design of the DUT side of the interfaces is not a problem. I've been a board designer for many years (over 700 PCB designs so far) so that's reasonably trivial for me.What I do need to get a handle on the the best way to do the PC side of the interfaces (addressing, protocol, etc) and how to approach the PC software design. I want to make it as extendible as possible as well as easy to set up tests.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 26, 2012, 10:09:56 am
content: Quote from: nctnico on June 26, 2012, 12:21:48 amfriend... example pls... the best that you know.Quotehow do you like if its a handheld standalone instrument, can communicate/controlled to PC by USB. costing maybe somewhere $100-500? i'm thinking a project of somesort similar like this, but very early stage and it looks not easy, the logic and hardware... but if you still thinking of PC based, then you should "know it all" the many comm protocols and work around to make your project more generic.

author: nctnico
author_rank: Super Contributor
timestamp: June 26, 2012, 10:34:44 am
content: Quote from: Mechatrommer on June 26, 2012, 10:09:56 amFor example:http://www.xlogic-plc.com/http://www.aboutplcs.com/http://www.starting-point-systems.com/specs.htmlQuoteI've been down this road. In many cases I just want to repeat the same test for a long time to see if a circuit keeps working. I found out that if I have some relais to switch a circuit on/off, change loads etc and a dual channel AWG with digital outputs (like a Lecroy LW420) I could cover 99% of my test needs without trying to re-invent the wheel. The PLC can generate logic signals, analog levels, measure analog levels (pass/fail) but its not fast. With the AWG I can create fast signals and digital patterns like serial, SPI and I2C. By using triggering and marker outputs I can make them work together. I could include a scope to do pass/fail testing on signals.If making hardware is fun to you (raise your hands... Okay I see a lot of hands... thank you) then try to put your energy into a novel new product you can sell or learn something new. That time is much better spend than trying to make trivial stuff.

author: David_AVD
author_rank: Super Contributor
timestamp: June 26, 2012, 10:40:17 am
content: I am envisaging a collection of interface modules (contact I/O, Serial, etc) all connected back to the PC via USB. How many and what type of module would be dependent of the task at hand.There would be some low cost test equipment already out there with comms capabilities (DMM, etc) and the rest would need to be scratch built.If I had a huge budget, I'd just buy LabVIEW and $100K of shiny new equipment. I don't, so the DIY approach with incremental capabilities is the way I'll have to go.

author: nctnico
author_rank: Super Contributor
timestamp: June 26, 2012, 12:36:20 pm
content: Again, if I where you I'd look very closely to available modules and PLCs! What you want isn't very special.The 'not invented here syndrome' can be very expensive. My former boss suffered from that severily. For instance he insisted on designing a relais board for a one-of project and writing our own project management system. All because he didn't want to learn / understand something build by others. Its money and time down the drain.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 26, 2012, 08:22:45 pm
content: Quote from: nctnico on June 26, 2012, 10:34:44 ami will look at the 3rd option, the 2nd is look expensive. the first one i've came across, its expensive. thanks for your suggestion.

author: nctnico
author_rank: Super Contributor
timestamp: June 26, 2012, 08:59:17 pm
content: The ELC12 economy version of Xlogic is very affordable. Only the analog output modules are quite expensive though. Here is a pricelist (excluding VAT):http://www.plcshop.nl/xlogic-prijslijst.htm

author: David_AVD
author_rank: Super Contributor
timestamp: July 02, 2012, 09:26:26 am
content: Now that I have a Rigol DS1022 signal generator on the way, I've been thinking about a standard way of interfacing with it and other (possibly DIY) items.I know very little about LabVIEW and VISA drivers so far. Is it realistic for a reasonably competent programmer to write VISA compatible drivers?EDIT: Grammar error.

author: Bored@Work
author_rank: Super Contributor
timestamp: July 02, 2012, 04:41:36 pm
content: Quote from: David_AVD on July 02, 2012, 09:26:26 amWriting drivers? That is the job of the device manufacturer and the VISA implementation supplier (for standardized protocols). VISA is an API that then shields you from many device details, and you are supposed to program on top (applications), not below (drivers), of VISA.

author: David_AVD
author_rank: Super Contributor
timestamp: July 02, 2012, 09:40:48 pm
content: Yes, I am talking about writing drivers for DIY test equipment or controllable equipment that doesn't have a VISA driver.I'm only at the start of my VISA and IVI investigations but I think* I understand how it basically works.* could be totally wrong!

author: free_electron
author_rank: Super Contributor
timestamp: July 02, 2012, 11:35:29 pm
content: you don;t need to write a visa driver. that is the key behind visa.VISa is a gateway manager. that does two things1) it provides the application programmer with a pipe to the machine.2) it provides the instrument maker with a transport bus of choice. rs232 , gpib , lxi , lan.all messages being thrown in to the pipe are plaintext ASCII following the SCPI commandset.if you make a system that exposes a serial port ( over usb for example ) you can plug this in the computer. tell visa to connect to COMx and off you go. as an instrument mker you only have to implement a command parser that can read ascii streams terminated by a LF or CRLF pair , parse them and respond.the absolute must-be-implemented commands are the ones that begin with a * in the SCPI commandset. the rest is up to you.

author: David_AVD
author_rank: Super Contributor
timestamp: July 02, 2012, 11:46:02 pm
content: Ah, I understand now. Thanks for that.

author: thmjpr
author_rank: Regular Contributor
timestamp: July 03, 2012, 01:35:03 am
content: Quote from: Mechatrommer on June 26, 2012, 08:22:45 pmSome other low cost DAQs:http://labjack.com/http://www.mccdaq.com/solutions/USB-Data-Acquisition.aspxhttp://sine.ni.com/nips/cds/view/p/lang/en/nid/14604

author: free_electron
author_rank: Super Contributor
timestamp: July 03, 2012, 05:05:25 am
content: Essentially what VISA does is probe all the ports of the computer ( usb , gpib , ethernet, serial , printeport ) and figure out what is there. it does this by sending the *IDN? command to which a machine must reply with its manufacturer name, model number and firmware / hardware revisionAs an application programmer you simply tell VISA 'there should be a machine at ::USB0:DEV0:VID3476:PID2341' or ::COM3::DEV0 or ::GPIB0:DEV22:visa will poke around , and if a machine is found it will give you a 'handle'. This is a 32 bit number.so you createint32 my_voltmeter = Visa_Open("::USB0:DEV0::VIs...")visa_write (my_voltmeter,":DISP:TEXT 'hello world'")in object oriented languages you can do this :dim my_voltmeter as new VISA_instrument( "::blabla:my_voltmeter.send ":disp:text 'hello world'"VISA has all the protocols and transport mechanisms and can talk GPIB , LXI , PXI , VXI , MXI , whatever you want. it is a true 'pipe'as an application programmer you throw in an ascii string and VISA cooperates with the hardware, the hardware drivers (like ethernet drivers , gpib board drivers etc ) to get the string sent to the endpoint.You as a device simply get a string. when you have something to say you just send it back and done.VISA has an internal API toward the GPIB boards . a GPIB board aker needs to provide a VISA driver. The instrument maker doesn't need to do that.VISA is available from either national instruments or Agilent. In general if you buy a GPIB board from either one they give you a runtime licence for VISA. You can also purchase VISA without such a board.I have 'objectified' all my testequipment.i can very quickly make testprograms. There is a number of base classes like 'multimeter' , 'supply, ' scope, ' generator' ,'spectrumanalyzer' etc. Each has subclasses that are instrument specific and extend/overload the base class.i can write testprograms in Visual basic like thisCode:dim dvm as new HP34401 (gpib22) ' give a voltmeterdim vdigital as new HP3432(GPIB7,2) ' gpib adress 7 channel 2 of the supplydim vanalog as new hp3432(gpib7,1) ' gpib adress 7 channel 1 of the supplydim device as new chip_under_test ' gvive me a chip to testdim dac7 as new device.register(&h307) ' bind this to a register located at adress 307 in the chipdim document as new xl.workbook ("logfile.xls") ' ope a excel logbookdim sheet as document.sheet ("sheet1") ' grab a sheetdim chamber as new Tenney310(gpib4)vanalog.voltage=3.3vanalog.current=0.1vanalog.output=truevdigital.voltage = 1.8vdigital.current = 0.5vdigital.output = true.dvm.measure = voltsdcdvm.range = volts3sheet.rowcol("A1") ="Testsweep"sheet.nextrowfor temperature = -25 to 125 step 25chamber.temperature = temperaturechamber.soak ' this waits for the chamber to settlefor sweep = 3.0 to 3.6 step 0.3vanalog.voltage = sweepfor x = 0 to 1023dac7.value = xresult = dvm.readsheet.addrow (temperature & "," & sweep & "," & x & "," & result)next xnext sweepnext temperatureI have a framework where the instrument connections are defined in a file called 'benchsetup.bas'. Since the equipment on a bench is static i only need to focus on writing my code.a coupe of lines of nested for-nexts bobmbar excel with a table of data.I have excel spreadsheet templates for all kinds of plots . the graphics are pre-made in excel. all the script does is update the table. you see the excel plot change in realtime as the measurement is running.Since the script calls the correct spreadsheet i don't even have to worry about that. i haev a library of 'golden' scripts with their accompanying excel files. if i need that kind of sweep i simply open that project and run it . the script asks me for a new filename , copies the golden excel file to that filename and then plumps the data in there. by the time i am back in my cubicle i can remotely open the output file through the network.Since we run vnc i can actually launch teh test form my cubicle , do something else while is keep an eye on the screen to see if all is well.i have links to matlab as well. There is even powerpoint files with links to the embedded exel sheets.If the boss asks me to prepare a new plot of a dac and prepare a few slides for this afternoons presentation i simply open Visual Basic Express ,run the script and set the filename. when done the slides are created uncluding time dat , who did the test , sample number and everything. I don't even get up... unless i need to go to the lab to change a chip ... we don't have an ATE handler ... -yet ---

author: David_AVD
author_rank: Super Contributor
timestamp: July 05, 2012, 10:25:10 am
content: I've installed the NI VISA software and plugged my Rigol DG1022 into a convenient USB port. The DG1022 was detected correctly and Device Manager shows it under the USB Test & Measurement Devices section.If I were to design my own USB interfaced instrument (with suitable parser), what type of USB driver is best? For example, could I use an FTDI USB chip and have the VISA interface connect to it?

author: David_AVD
author_rank: Super Contributor
timestamp: July 05, 2012, 10:38:48 am
content: Hmmm... I may have (partially) answered my own question.There's a Driver Wizard as part of the NI VISA software. Plugging my FT232RL based USB-RS485 interface in and selecting it in the driver wizard allows me to create a inf file.So it seems like I should be able to use either the FTDI USB chip or a USB enabled PIC and create suitable inf files for the VISA software to use.I'm guessing that I'll have to be careful with using the generic VID/PID as using the VISA inf file will prevent other devices using the FTDI USB chip from being used normally (non VISA).

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2012, 12:36:11 am
content: I've been thinking about the software side of things and will start a simple proof of concept Delphi application soon.Initially I am envisaging an IDE style of GUI where you could create buttons, set their properties (position, size, colour, caption, etc) and an event handler.Those event handlers could trigger actions such as sending some comms data, etc. I'm not sure how much scripting I'll implement yet, but I need to start somewhere.

author: RidiculousRichard
author_rank: Newbie
timestamp: July 25, 2012, 08:50:00 am
content: David,Please do keep us updated. It will be a valuable resource for all of us who will be following in your footsteps.Richard

author: nctnico
author_rank: Super Contributor
timestamp: July 25, 2012, 09:51:21 am
content: Quote from: David_AVD on July 25, 2012, 12:36:11 amThat sounds like Labview. There must be some open source alternative for it.Oh, and don't use Delphi. First of all its not portable (no, Kylix doesn't work), secondly it is very hard to write a stable application with it. Because its based on Pascal the structure of an application is cast in iron. Pascal is a language intended to teach structured programming not for writing huge pieces of software. Been there done that, moved to C++ and still happy.

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2012, 10:12:37 am
content: Quote from: nctnico on July 25, 2012, 09:51:21 amThat's what I said in my first post. Apparently there isn't.Quote from: nctnico on July 25, 2012, 09:51:21 amI'm not concerned with non-Windows use.Quote from: nctnico on July 25, 2012, 09:51:21 amWTF??? I think you mean that you couldn't write a stable application with Delphi.Quote from: nctnico on July 25, 2012, 09:51:21 amI'm happy that you like C++ but I'll stick with the language I've been using successfully for many years thanks.

author: nctnico
author_rank: Super Contributor
timestamp: July 25, 2012, 11:00:12 am
content: Look athttp://www.scilab.org/About Delphi: I've seen many people fail trying to write large pieces of software with Delphi. At some point the rigidness of Pascal gets in the way. Borland tried to fixed that by bringing in a lot of things from C/C++ but the result is a huge kludge. I've fixed or rewrote several of such projects in the past.

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2012, 09:12:56 pm
content: Quote from: nctnico on July 25, 2012, 11:00:12 amThanks for the link. I'll take a look.Quote from: nctnico on July 25, 2012, 11:00:12 amI'm not here to get into a pissing contest on programming languages. Different things work for different people. How about we all work towards a nice solution.

author: David_AVD
author_rank: Super Contributor
timestamp: August 01, 2012, 03:06:56 am
content: I've been pretty busy the last week or so but have made a start on the basic GUI.The first goal is the control panel editing where you can add, move, resize and remove buttons and save to / load from a project file. That's nearly done.Once that's working well, I'll add a property editor so you can customise the button captions, colour, etc.After that, I'll work on the event handlers and how to define the action that occurs with button presses, etc.Once I get something worth looking at, I'll post a small demo video.