Video Script @stan_koprowski

Craige Hales of JMP wrote up an innovative way to read real-time data with an Arduino. I wanted to try this for myself, and with the help of my Colleague Stan we made few adjustments with the current version of JMP, I'm happy to say it was successful. It was sincerely fun to experiment and I learned a ton more of JSL. The JMP Script and Arduino Code are both linked below for you to experiment.
So an Arduino is an inexpensive microcomputer that connects through USB which you can upload your custom code for it to run. It can operate on a battery or use the power of a USB. The Arduino comkes without an enclosure and this one I connected a light Sensor to Pin 0.
This is not a comprehensive tutorial on how to code in Arduino nor JSL but simply and introduction to this connection a sensor with JMP using a JMP Script.
First, let me show you it working, then I'll explain quickly how it's accomplished. With both JMP and the Arduino IDE Programs up and running, I'll select the Run script icon in the top ribbon banner. That will first create a data table with 2 columns. There are 2 Scripts waiting in our table panel to start things off. I'll select run Connect and it will open the Communications port that the Arduino is on and start the main Script going. By the way, I'm virtually running Windows on a Mac Book Pro and my Arduino is on Com3 because that's what the drop-down in the Arduino software has indicated.
As you can see it quickly starts populating our 1st Column with the light data from the IR sensor connected to my Arduino. The Second Column is a timestamp created by JMP. It also launches a Control Chart builder for us to Visualize the data in real-time.
Here's how it works.


The Arduino is powered up and actively collecting sensor information using the uploaded code linked to this video.
In JMP, The JSL Script creates a data table with 2 Columns, sense, and time. The Baud rate is quite high, but it is one way not to miss any data being read from the Arduino feed.
The JSL Script makes the Connect script, which connects and listens to the port the Arduino is using. We start the time, grab the line from the feed, end the time then populate the data table row for sense and time.
Next, we launch a Control Chart to visualize the incoming data.
This portion loops until we run the Script to Disconnect.
You could potentially add any sensor to the Arduino you'd like, including reading from the Digital pins.
If you have any questions or ideas, please comment below.
Hi Ryan, nice work 
I have a few ideas to make this more robnust and even more applicable:
- Make some checks for RAM usage from time to time, just to be sure you do not run into out of memory issues and therefore a runtime error. If to few RAM is left, automatically stop, restart JMP and run the script again, adding a line to the control chart x-axes telling there was a new start
- Publish results into JMP Live instead of the local control chart to have others see what happens
What do you think?
Martin
Thanks Martin, good idea on Ram check. My next project is looking at multiple sensors at a time. For JMP Live use case, maybe a sensor check at longer intervals would be a good application.
Some (obvious) Experiments we could try.
- Manufacturing application of a device open or closed. (0 or 1)
- Pressure
- PH
- Temp