Let's Make Robots!

Datalogger

AttachmentSize
DataLogger2.zip152.14 KB

Datalogger

Description

This little program can be used during the development of robots or other electronic devices. It can display a graph based on input from a serial port. It reads data from the serial port and displays them in the graph. The data can be single bytes or it can be 2 or more bytes combined. The program will either run for a predefined number of samples or it will restart the sampling when it receives a predefined reset sequence.

program.jpgchart.jpg

License

It's pretty simple. It's free. You can use it and you can copy it, but you can't change it.

Installation

To install the datalogger you have to download it (of course). The program requires the following components to be installed, so start by downloading them:

  • Java Runtime Environment (JRE) 6 - The data logger is a Java application, so you will need a Java interpreter. It is developed using Sun Java 1.6.0_05 so at least this version is recommended. You can find it here
  • JFreeChart 1.0.9 - This is the library used to draw the graphs. Get it here. Note that JFreeChart depends on JCommon, which you will also find there
  • RXTXcomm 2.1.7 - This is the communications library that the datalogger uses. Get it here
The datalogger itself can be downloaded here

Installing the Java runtime should be rather straightforward. The JFreeChart, JCommon and RXTXcomm components are a bit more difficult. If you are used to Java, you can install them anywhere you like. Remember to include them in the classpath and pay attention to the drivers in RXTXcomm.

If you are not used to Java, perform the following steps. It's just a matter of extracting the files you downloaded above and copy some files.

  1. Unzip DataLogger2.zip somewhere. This will create the DataLogger2.jar file and a subdirectory called lib.
  2. From the JFreeChart package that you downloaded above, find the files jcommon-1.0.12.jar and jfreechart-1.0.9.jar. They should be in the lib folder in the jfreechart zip file. Put these in the new lib directory, that was created when DataLogger2.zip was extracted.
  3. From the RXTXcomm package you need RXTXcomm.jar from the package that you downloaded. Put that one in the lib directory as well.
  4. You will need some libraries that are specific to your operating system. For Windows, you need rxtxSerial.dll. Find it in the windows folder in the rxtx package. Put that one in the DataLogger2 lib directory, together with the jfreechart and rxtx .jar files. For Linux, Solaris or OS X, you will find the libraries in the other directories. If you have one of these operating systems on your computer, you will have to copy the correct libraries to the DataLogger lib directory.
  5. In the end, you should now have the files DataLogger2.jar, run.bat and a directory called lib. In this directory, you should have:
    • appframework-1.0.3.jar
    • swing-worker-1.1.jar
    • jcommon-1.0.12.jar
    • jfreechart-1.0.9.jar
    • In addition, you should have:
      • For Windows: rxtxSerial.dll
      • For Linux: librxtxSerial.so
      • For OS X: librxtxSerial.jnilib
      • For Solaris: librxtxSerial.so

Starting the program

To start the program, use the run.bat program on windows. On linux, you have to open a command prompt. Change to the directory where you extracted the files and type

java -Djava.library.path=lib -jar DataLogger2.jar

to run the program

Using the program

The program is quite simple.
  1. Select a communications port and enter the speed. The program uses 8 databits, no parity and 1 stopbit. (8N1).
  2. Select fixed cycle mode or triggered mode.
    • In fixed cycle mode the program will plot a number of samples in each run and stop after the last run. The default is to run once and sample 150 values. If you increase the number of runs, it will start a new graph with a new color for each run.
    • In triggered mode the program will monitor the datastream. When it sees a specific byte sequence (255 255 255 by default) it will start a new graph. This will give the connected device time to settle and will make sure that the sampling starts at the right time. Enter the sequence as byte values, separated by space
  3. Select a sample size. Default is to use 2-byte values. The lowest byte should be sent first.
  4. If you would like to send a trigger value to the connected device when the sampling starts, you can check off the "On start send 255" box. This will make the program send a 255 byte when Go is pressed, before it starts to listen for data. Use this to trigger data-generation on the device
  5. Press "Go" to start the sampling. To stop, press "Stop sampling"

Sample device code

Here are some code samples for devices that can be connected to the program. If you have samples for other devices, please add them.

Picaxe

This program shows how to use the program with a Picaxe board. It shows how to send range data from an ultra sound sensor mounted on a servo.
symbol ping = 1     ' Pin connected to the sensor ping function
symbol echo = 7 ' Pin connected to the sensor echo function
symbol head = 0 ' Pin connected to the servo
symbol range = w0 ' The measured range

main:
' Move the servo to one side
servo head, 75
' Send reset sequence to computer
sertxd (252, 253, 254,255)

for b2 = 75 to 225
servo head, b2 'Move servo
pulsout ping, 2 'Send echo pulse
pulsin echo, 1, range 'Wait for reply
sertxd (b0, b1) 'Send value to computer
pause 50 'Wait for echoes to die out
next b2
goto main

Set the prorgam to triggered mode and the reset sequence to "252 253 254 255". When the program is run, the Picaxe will reset the servo, send the reset sequence to the computer and start sending range data. When the servo reaches the end, it will start over. If the Go button in the program is pressed while the program is running, it will wait till the next round, before it starts displaying data.

If you insert a line with serrxd (255) between main: and servo head,75, the device will wait for a 255 byte before scanning. Check off the "On start send 255" box to do this.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
The java app is still working 100% Thank you very much for creating this!
datalogger link says 404 not found :( hope someone still has it
The link to the zip file is at the top. There is no other way to download the files.

Very cool, I'm looking forward to playing with this. Thanks for making it available freely.

DanĀ