PCB testing - automation/ PC assisted - ideas - Page 1
Forum section: electronics / projects

author: Zap
author_rank: Newbie
timestamp: July 24, 2012, 01:50:09 pm
content: Hi eevblogers,I am looking to simplify a boring task i have of testing PCB's. I should mention I have no experience in test automation or assistance but I would like to learn/play with it out of hours to familiarise myself, and for some fun.Basically I need to send serial commands to a UUT and then measure the output on a cro ( is there a square wave present? and is its period about x) etc and so on.there is about 50 commands then measurements and after a while there is a risk you become blasé and miss errors as well as the time taken to enter all these commands and then adjust a cro to measure the output.I am toying with the idea of at least coming up with a GUI that has the commands as buttons ( saving they typing) and still doing the manual CRO settings and checkshowever at best an interface to measure the output and pass fail each step would be nice.what would be a good starting point, i was thinking python to build a PC gui? ( (i have limited programming in C++ mostly C for embedded micros, but willing to learn)the measurement side is a pipe dream but is it even viable? would you then look to labview and such systems?thanks for any direction, ideas or pointers

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: July 24, 2012, 02:22:13 pm
content: Because it's PC and you want a rich GUI, Visual Studio using c# would be a good way to do it.They have an express edition which is free and I think it would have all you need.If you are the only person using it, you could just run it in the debugger, that makes it easy to find and fix your bugs.I assume they have a usable serial api.You can pump stuff out to files, databases and graphs fairly easily.

author: David_AVD
author_rank: Super Contributor
timestamp: July 24, 2012, 09:33:58 pm
content: I'm heading down thesame pathat present. After getting a demo copy of LabVIEW I had the NI rep come out to discuss what we wanted to do. I'm not convinced that LabVIEW can do what I want long term though. As a Windows programmer (Delphi mainly) I have been thinking about writing my own GUI where you can place virtual controls on a panel and generate serial commands for the DUT.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: July 24, 2012, 11:47:06 pm
content: I suppose there is no harm in trying it. I guess your project is what Labview is designed for.My fears would be black box syndrome, you know it does something weird, I can't fix it, I'll have to email someone or find a work around.It's also fairly slow I think.I did some Delphi last century, I think it must've been the first decent IDE in history. Then I went on to VS 98 with COM and C++, it was like going back into the dark ages. These days Visual Studio is great, though they are managing to fill it up with junk. Express edition is probably better because you don't get all the junk.I notice that Atmel Studio 6 is using the VS Core. I guess that's great if your on Windows, tough luck if you use Linux.

author: Berni
author_rank: Super Contributor
timestamp: July 25, 2012, 08:48:41 am
content: Yes go for Visual Studio, its a great eviorment that helps you along as you write the code, the live suggestions work so well that you usually just write the first 2 or 4 letters of a command or variable and hit enter to autocomplete and at what ever point you hit F1 it will come up with a help for the command your cursor is in and most commands have a tiny example code for it in the bottom.It also all works the same in C++,C# or VB since it all uses the same .net interpreter and its also surprisingly fast.LabView i had to do various stuff in and it seams like its only good for signal processing, any sort of sequential programming gets really messy quite fast. But it does have a strong point in interfacing test equipment. You can get drivers for nearly any piece of test equipment that you can connect to a PC so that makes it really easy to grab a waveform from a scope and analyze it. You can also find standalone DLLs for talking to various test equipment from other programing languages but that might not be as simple.

author: nctnico
author_rank: Super Contributor
timestamp: July 25, 2012, 09:54:08 am
content: Quote from: Zap on July 24, 2012, 01:50:09 pmI usually implement a self test in the device itself. Together with a test rig which has signals, loads, etc a device can test and calibrate itself.

author: Zap
author_rank: Newbie
timestamp: July 25, 2012, 10:16:16 am
content: Thanks everyone for the posts and ideas - it would seem I have a lot more to look at before deciding if I can undertake such a task.It will give me something to play around with even if I am unable to implement it into the current work flow. My idea was it would reduce my test work load but it might be a case of moving it and more into developing the test software.(i have downloaded Visual Studio and will have a look into it also)Regards

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: July 25, 2012, 12:09:55 pm
content: It will be much more interesting to automate the testing than to actually do the testing. So automate what you can.

author: TerminalJack505
author_rank: Super Contributor
timestamp: July 25, 2012, 12:15:42 pm
content: I don't know if this will be an issue with your software or not but beware that you cannot reliably do real time processing using .NET. This is due to the use of a garbage collector that can kick in at any point during the execution of your application.By the way, so far as Delphi and .NET (and C#) goes, the same person that developed Delphi also helped develop .NET and C#: Anders Hejlsberg.

author: Zap
author_rank: Newbie
timestamp: July 25, 2012, 01:01:12 pm
content: As a first step, if I can turn a string of text sent to the UUT into a single click of a button, and I still use the cro to confirm the output - that will save me a tone of typing and speed things up.If was able to integrate the wave form and have a automated test and measure then that would be even better however at this stage i think it would be beyond my ability given this will be my first shot at any form of automation/assistance/pc programmingit would be nice though

author: Berni
author_rank: Super Contributor
timestamp: July 25, 2012, 06:34:55 pm
content: Well DSOs do cost money so if he doesn't have one its a tough one. But if you are dealing with any digital or other complex signals a DSO is worth its weight in gold so well worth getting one in this digital worldI am a windows user so i like to put a GUI on all my little test programs, especially if its something i keep reusing like the tool for turning binary files in to C arrays or making sine tables and such. With tools like visual studio its really quick to just draw up the GUI from common windows elements so i never even tried making a command line app with visual studio.

author: Short Circuit
author_rank: Frequent Contributor
timestamp: July 25, 2012, 08:08:10 pm
content: The DSO is already there to verify the signal manually, so cost is hardly an issue.Take one with GPIB/USB and you can send the settings to the scope, and also use the scope measurmenet functions to query the voltages, frequency, dutycycle, etc. Same as you can on the DSO user interface. Probably does not cover the entire test, but at least allows for some basic automation of signal testing.edit:here's a C snippet from some PCB testing application which uses a Keithley 2100 DMM (though VISA and USB), I assume working with a DSO will be quite similar.Code:DOUBLE DmmRead(BYTE vAc, FLOAT vRange){BYTE pStrout; // Read in data bufferBYTE pStrin; // Read in data bufferULONGnRead = 0;if(vAc == 2)strcpy((CHAR*)pStrout, "CONF:FREQ");elsesprintf((CHAR*)pStrout, "CONF:VOLT:%s %f,%f", vAc ? "AC" : "DC", vRange, vRange / 10000.0);PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);strcpy((CHAR*)pStrout, "INIT");PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);strcpy((CHAR*)pStrout, "READ?");PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);PviRead_usb(m_instr_usbtmc, pStrin, 64, &nRead);pStrin = '\0';DOUBLE val = atof((CHAR*)pStrin);//printf("converted: %.4fmV\n", val * 1000);return(val);}

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2012, 09:10:01 pm
content: Quote from: Zap on July 25, 2012, 01:01:12 pmI have already written some software where you can define serial strings, put them in a list and trigger them with a button click. You can also add a time parameter so that the strings are sent in a slow sequence. Sounds like what you want for the first part.

author: Zap
author_rank: Newbie
timestamp: July 26, 2012, 10:48:47 am
content: Cost of equipment is not an issue as currently we use a laptop, a user (me) to type in text, then a Tektronix cro to measure - and change settings manually. Test firmware is not an option as this is a final test to ensure the board is ready to use - and works as expected ( i understand test firmware would also do this - but its not an option i have)I don't mind if its only for educational purpose, so I might try doing it at home with my Rigol and a simple set-up and if it works well then try and apply it to simplify my testing.thank you for the ideas and help - i will search about and try and gather a better understandingEdit : when i say cost is not an issue - i mean to buy a DSO, pc and userany further equipment or software / licence is an issue ( as this is basically a home project to learn and further my own skills in an area i have never ventured and it seems like a good way to spend my time)

author: nctnico
author_rank: Super Contributor
timestamp: July 26, 2012, 12:40:51 pm
content: I mean that you could embed the test firmware into the final firmware. Setting a jumper puts the board into test mode.