Image management in MSSQL

I am in the process of creating a Lockout/Tagout project and would like to add a picture of each of the lockout points. I know how to use the image manager and store the images to the gateway but I am wondering about going further and storing the images in an SQL table. I will have over a thousand pictures before I am done.

For those of you that may have had a project similar to this, which way is better in the long run?

How do I use the image component and bind the image path to an SQL table?

Thank you for the help.

The only downside to storing images in the database is that the database can get rather large. It all depends on the size of each image. It is a nice method since you don’t have to go into the designer to add new images and use them. In the long run I don’t think there is much difference.

If you do go down the database route you can put a label on the window (not an image) and use the following code to set the image:from javax.swing import ImageIcon blob = system.db.runScalarQuery("SELECT imageblob FROM images WHERE id = 1") icon = ImageIcon(blob) event.source.parent.getComponent('Label').setIcon(icon)You can also write the image to a temporary file and set the image path of the image to that. I think it is better to stay away from reading and writing files. Hope this helps.

In my installation, I have IIS running concurrently with with Ignition’s Apache Server. I save the pictures under IIS and then store the URL into the database. I do this with PDF’s as well.

Jordan, could you explain how to do this? Id like to use this on one of my systems.

I’ll post what I have later on tonight. Been an exceptionally busy day today. On the bright side I have a job to be busy at! :smiley:

OK, here’s what I have set up:






Bonus tip:

I know this is a tad late of a reply, but i dont know of another way to reach out to you. I am curious about your lockout tagout project that you created. I have been tasked to create one and i have been fishing around looking to find something that already exists. Let me know if you are willing to share. thanks