Image Path Using Google Shared Drive

I have a window in ignition that includes an image of the current product running in production based on the SKU returned from a tag. Right now, I have it referencing a shared google drive with this image path expression "concat("file:///G://Shared drives//Barcode//Images//",{Root Container.current_sku},".jpg")". This works great and changes the image in the window based on the current sku. However, in order for that image to show up, the operator computers on production floor would need to download and have access to the shared drive. Which is a big security issue. I just don't want them to have the ability to accidentally delete images or documents. I don't want to use the built in image management tool because that means every time we add a new product we need to go in and add it with ignition. Which isn't a lot of work, but having it update automatically would just be a big time saver. Right now they are already adding an image to the shared drive for other reasons. I like the google drive concept because it further automates this process. I've made a python program before that uses google sheets api to get data from a changing sheet (unrelated to ignition) and I'm looking into doing another program using google drive api to access the images folder (read-only). Is it possible to tie that into ignition? Or is there an easier way to address this issue? Thank you in advance

If you're willing to run some separate out of process python programs to support this then the easiest approach might be to just serve the images up over HTTP using Python's built in HTTP server.

I suppose since this is Vision you'd want to bind that HTTP server to 0.0.0.0 instead of localhost so it was reachable by all the clients. Otherwise every Vision PC needs to run all the python programs and access the images locally.

1 Like

Another idea- you can use gateway message handlers to get the data that you then use a propertyChange script on the image component or paintable canvas to draw.

Since the a client on the gateway sounds to work fine- you can add a mechanism to receive the path perform the byte read and return to the individual vision client to then render.

Something like this: Using Paintable Canvas to get Blob image from MySQL - #6 by pturmel

1 Like