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 test.
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 comes without an enclosure, and this one I connected a light Sensor to Pin 0.
This video is not a comprehensive tutorial on how to code in Arduino nor JSL but only an introduction to this connection a sensor with JMP using a JMP Script.
First, let me show you it working, then I'll explain how accomplish this yourself. 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 two columns. Two Scripts are 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 I've found not to miss any data 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.