Home

Database connectivity for Axis

What is it ?

A simple python script for use with the Axis interface for Emc. It allows you to retrieve your gcode from a mysql database.

Why would I want to do this ?

In a manufacturing environment, where there are multiple emc controlled machines, it may be helpful for all machines to be able to access a central database of components. More idealistically, an internet based database of components could be established, enabling all emc users around the world to have access to a common library of parts. Other uses are possible.

Ok, I'm in. What do I do ?

To try this out, you need to configure the script, and then set up a mysql database to hold your gcode.

Configuring the script

The script is HERE. A good plan is to store it with any other emc scripts you might have. You will have to edit the script, to add your mysql user name, and password. These are clearly marked. Remember to set the executable flag on the file.

Check your Axis INI file, to ensure that the filter section has an entry to specify an interpreter. It should look something like this:

[FILTER]
PROGRAM_EXTENSION = .py Python Script
py = python

Configuring the database

This SQL FILE, can be used to create the database, and includes one sample part. Use it as follows:

cat emc.sql | mysql -u root

The mysql root password will probably be required.

Time to try it out

Fire up your emc, and open the mysql.py file. You should see this:

Select your component, click on import, and the gcode will be imported into Axis.

Other

If you wish to leave a comment, you can do it HERE.