Web Drawing to LabVIEW

One of my suppliers familiar with my engraver project sent me this video of an Adpet robot with iPad interface. Of course I have been thinking about advancing my iPad machine control, so I got to work on creating a web based sketch pad that I could upload to LabVIEW. (These days I assume most of what I want to code has already been coded by a more talented community member.) After a quick search I came across this HTML5 canvas program. I got the canvas program running on my development server and then began hacking it to save the sketch to the server and store the location in the MySQL database. The 'Submit to Robot' button saves the image and stores its information in the database.

HTML5 Canvas Sketchpad

On the other end I reused the LabVIEW program I had created for the iPhone controller. This time I monitored for the png image file location and opened it in LabVIEW. Along with the final image I also store the canvas event data so that I can recreate the motions the user entered to create their picture. The next step will be to translate the image and event data to robot locations. Then I can start taking automated web orders for robot art.

LabVIEW png image display program

Here is the captured canvas data for recreating the drawing exactly as it was performed.

{context:{},canvas:{jQuery1312232317558:11},type:,coordinates:[0,0], events:[

{type:strokestyle,color:#000000,time:1312232317625},

{type:strokestyle,color:#000000,time:1312232346567},

{coordinates:[32,175],type:beginpath,time:1312232348311},

{type:drawpathtopoint,coordinates:[32,174],time:1312232348326},

{type:drawpathtopoint,coordinates:[33,174],time:1312232348342},

{type:drawpathtopoint,coordinates:[35,168],time:1312232348350},

...

 

Read More