How to copy data from MySQL server to PLC register

Hi everyone,

I am working on a project that is involving writing and reading data to and from PLC. I have Ignition, RSLogix 5000, and PLC (Allen-Bradley), but I don’t know how to use these tools so that I can read and write data. My goal is to copy data from MySQL server to PLC register.

Thank you so much for your help.

Nak

You should look into the SQL Bridge module for Ignition. The SQL Bridge module has transaction groups that allow you to move data back and forth from a PLC and a database (like MySQL). Here is some more information on transaction groups:

inductiveautomation.com/supp … uction.htm

Good Morning Travis,

Thanks for your help. I have another question that I need help. I already have Ignition, MySQL, MySQL Workbench. So, do I need cPanel and phpBB? The reason I ask because I am having a hard time importing CSV file to my database. In order words, how can I import CSV file in MySQL Workbench. Right now, I can only create a table using MySQL Command Line Client.

Thanks,

Nak

No, you don’t need cPanel or phpbb. To load a CSV into MySQL take a look at this page:

support.modwest.com/content/6/25 … mysql.html

Hope that helps.

mysqlimport is a command-line utility to use the LOAD DATA INFILE method. You should be able to find it in the \bin folder of the MySQL install directory.

Travis and Jordan,

Thanks to both of you. If someone could explain me more how to import data from database to PLC, that would be great because I am new to PLC, Ignition, and MySQL.

Thanks,

Nak

The answer to that, as with a lot of things, is “it depends”… :laughing:

How much data are you sending? Also, what data types are you looking to use?

Jordan,

I am talking about a simple data (3 rows x 3 columns) for testing purpose only. I would like to know some steps how to copy that data from database to PLC. Then, I would like to know which register is used to stored that data. If you could help me with these questions, that would be helpful.

Thanks for your help.

Nak

Nak,

If you want you can call our tech support and we can help you with setting up a simple transaction group that takes data from the PLC and puts it in the database.

The basic idea is to create a Standard transaction group that has a mode of DB to OPC. Select the database and table you want to pull data from. At the very bottom of the Action tab you can select UPDATE / SELECT. We will be using the SELECT mode since the group is in DB > OPC. When selecting you can choose the first record, last record or use a custom where clause to choose a record from the database table.

Now, you can drag in all of the PLC tags from the OPC browser into the group that you want to write to. Each item has a Target. You can map each tag to a column of the table. When Ignition chooses a record we will take each cell from the row and write it to each tag based on the mapping.

Hopefully this can get you started.