Data aquistion for fusor on PC's

For PC type software that runs under some PC opsys.

Data aquistion for fusor on PC's

Postby Doug Coulter » Sat Jan 01, 2011 5:13 pm

As we are getting ready to get really serious about mapping out the parameter space on fusors, I've been writing (and paying to have written) some PC side code to grab data from this and that, and stuff it into a MySQL database for later analysis. In this case, I've not even read most of this code myself -- I simply did the first few parts, then Dave Knight (the middle guy in the picture at coultersmithing.com) did the rest. The PC code is in perl, and uses Tk, so theoretically can be ported to windows as well, should be pretty easy to do. It uses the serial port module, as our MultiGeiger data aq box puts out RS-232 for up to 5 counters and 4 a/d channels, along with time stamps and other useful stuff. This code also can aquire data from the soundcard, for either vocal annotations, or pulses from detectors for later use with the software for pulse height analysis mentioned elsewhere on this board. Further it will acquire setups and waveforms from our GDS (gw instek) scope periodically or on button pushes. I tried to make the DB schema as flexible as I could, for example, to scale and lable the a/d inputs, there's a separate table of scale factors and labels, things like that, and the main run just stores the index into that table so later mining can know what it's looking at. There are some warts, to be sure, and anyone who does perl (no really, it's not that bad for things like this) is invited to comment and/or help improve it. I'm just getting going, and using only simple GUI tools that you can get for linux to look at the data, but obviously we need ways to search meaningfully in this (for example, max neutrons or max Q) and display the various data. This is just the bare beginning.

I had to rename the perl script to a .txt extension to get it to upload here, them's the breaks for now. The board denies some extensions as they might be executable, in this case, it IS executable so I had to fake it out.
AQGui.txt
Perl code for data aquisition
(41.18 KiB) Downloaded 278 times


Hint, if you open this in Gedit in linux and save it once, Gedit will notice it's perl and do color syntax highlighting for you. Nice. We've also played with other IDE's but Gedit works fine for us. We set up a custom command in it to run the thing being edited after saving it, so just like DevStudio, one button and you're testing. We didn't see much advantage to another learning curve in the other IDE's, though I'm sure they are fine.

I'll add some other interesting perl modules you'll need, but these are just as received from CPAN, FYI.
You'll need to get Tk from there (or ubuntu's software installer can get it fine) too. Tk ain't the worlds greatest GUI, if you are used to MS devstudio, it's not comparable. But it works, and on many platforms, unlike anything from DevStudio that's fast (eg not .net junk).
Device-SerialPort-1.04.tar.gz
Linux serial port module for perl
(96.39 KiB) Downloaded 262 times

Device-SerialPort-1.04.txt
Readme for the above
(11.96 KiB) Downloaded 274 times


We use the gui SQL admin tools here, which can be found on the ubutntu software installer. (MySQL Administrator and MySQL Query Browser. Obviously, you'll need an install of MySQL itself, and the DBD/DBI modules for perl too, which tend to come with perl, I don't remember ever having to go and get them.

So, all this is potentially cross-platform. Troy informs me that the activestate perl for windows no longer has Tk with it, but something else called TkX -- they are't compatable, so you'll have to get a real Tk for windows too. For all we know, TkX is better -- I just don't have it or any documentation on it for use here on linux (if that exists).
Win32-SerialPort-0.19.tar.gz
Serrial port module for windows/perl
(118.1 KiB) Downloaded 262 times


Note, I wanted to add the sql to create the database, but the current backup is 180 megs, so I'll either have to learn how to do just the create tables, or wipe my existing db and back it up with the gui tool -- no big deal, none of the data in there is crucial at this point (and it's easy to restore), but yes, these get big quick as audio and bmp's from the scope get shoved into the DB as binary blobs at the end of a run. Anybody who needs it quick, ping on me and I'll get it done much quicker...Aha, found some old command-line-fu, so here it is, sans any data.
A better version would have the schema data for the Multigeiger stuff -- I'll post the code in that project elsewhere.
dbschema.txt
DB schema sql text, rename to .sql for use
(9.6 KiB) Downloaded 274 times


Once you have mysql installed, you can just use the GUI Administrator to make some users and give them passwords and privileges. I did this for the user/pword in the perl code, myself, and of course, root.

I am working on a perl/C module for the LabJack, and plan to add data from it to this as well, and possibly use some of the lab jack outputs to control the fusor itself so we can run truly hands free (eg with it in the cave). We can put a PC with it and use VNC or some other remote desktop to run things from a safe distance that way. With the fusor improvements we are now getting, the days of running it in the lab where you can just look in there (or open the door and reach in) are about to be history.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Return to PC

Who is online

Users browsing this forum: No registered users and 1 guest

cron