Infra20 Script Installation

WINDOWS. I’m going to assume you have a reasonably clean Windows/XP/whatever installation to start with. There’s nothing you should have to do to Windows to continue.

PERL. If you don’t already have a perl interpreter installed you might as well use activeperl. At the bottom of their screen you’ll find a link to their download page. Click on the x86 version of whatever is the latest (currently 5.16.3, which is what I tested on) and you’ll download an msi file. After the download completes you execute that file (usually a double-click) and accept the defaults. By default it installs into the c:\perl folder and changes Windows’ path statement so scripts have automatic access to it.

Once you’ve installed perl you can then write and execute perl scripts. Scripts are executed from the DOS window. To get to the DOS window, click on the Start button, then the “run” button. That opens up a box that is asking what you want to run. Type in “cmd” and then ok. Initially you’ll be in your “documents and settings” folder and you want to be in the C:\perl\site\bin folder. This folder will contain the scripts and eventually the infra20’s data files (unless you change things around, which isn’t that hard to do, it just takes a little thought). To get to that folder, type “cd c:\perl\site\bin” at the > prompt. Look at the pictures above to get an idea. You can then do a “dir” and see what’s already in there (same as using Windows Explorer). At this point you could create some perl code with a text editor (like notepad++). There’s lots of examples on the web, like ” print “hello world”; ” and execute it by typing “perl yourfile.pl” at the prompt.

WIN32-SERIALPORT. I’ll assume you’ve got perl running and you’re in the perl/site/bin folder. One of the nice functions activeperl includes is ppm, the perl package manager. At the prompt you can type “ppm” in and it will give you a display of all perl’s installed packages. Assuming you are connected to the internet, you can type in “ppm install Win32-SerialPort” (note the CAPS) and it will go out and find it and install it for you. If you don’t have internet access, you’d have to go find it, probably on cpan, download it, carry it over, unzip it, etc. I’d think getting internet access would be easier.

MY SCRIPTS. Once the Win32 package is installed you are ready to run my scripts. Copy both the “serial” and the “analyzer” scripts into the c:\perl\site\bin folder. Plug the Infra-20 into the serial port. Normally this defaults to “COM1”. It is possible you’re already using COM1 for something else (like internet dial-in, ugh) so you’ll have to do some tinkering which is above this tutorial. Same if you’re using the usb converter. In any case, once you figure out which Com port you’re using, you’ll have to change it in my “serial” script, about line 40.

RUN IT! While still in the c:\perl\site\bin folder in the DOS window, type “perl serial-work-3.pl” at the prompt (note the numbers could change). You should see the “now writing file” message. The DOS window can be minimized or left open, your choice. The script will run until you stop it by pressing ctrl-c. You exit the DOS window by closing it, or by “exit” at the prompt. After an hour you should start to see your folder listing grow with new data files.

In a like manner, you run the analyzers by typing “perl analyzer-work-2.pl, or “perl analyzer-batch-1.pl”. A bat file can save lots of typing errors. A typical file takes maybe 5 seconds to analyze. I don’t think I’d run an analysis on the file currently being collected (the batch script won’t let you).