Image Component: Update image periodically

I have an image component displaying a bmp on the clients local filesystem, this bmp file will be re-written every x seconds updating its contents (from an external program). I’m stumped on how to re-load the image from the filesystem periodically so that the vision window will display an up to date image.

While i have not found a solution to this specific issue, i have been able to utilize the IP camera viewer component as the initial source for the image I’m trying to update is pulled from http.

1 Like

Maybe try a script using system.db.refresh targeting the “path” property of the image component.
Fire a property changed script using a custom property on the window bound to dateExtract(now(5000), ‘second’). Alter the 5000 value to get the polling rate you require.

If using the Image component, you should set the Use Cache property to false. If true, the client will cache the image and will most likely not update the image when it is overwritten since it would have the same file name. Making the Use Cache false should force the image to reload from the source. You would probably need a timer script to toggle the image path every X seconds to trigger a path property change event…

Unfortunately with this i get “WARN com.inductiveautomation.factorypmi.application.components.PMIImage - system.db.refresh() was unable to find a refresh-compatible property binding on Image.path”

system.db.refresh only works for properties that have bindings to a db query
Turns out it does work for any property binding as noted below

I had previously noted the useCache property and had it set to false. I did a simple test script on a button that changed the path to ‘’, then back to the actual path and that is working great.

1 Like

According to the user manual:

“Even though the function includes"db” in the name, the function can update all types of Vision component bindings, including Property and Expression bindings"

3 Likes

I just realized that i wasn’t using a property binding on path, i just had the path to the image static in the path property, which would probably explain why it couldn’t find the binding. If i have time i’ll give that a go again (i removed everything from the project that was supporting this) and see if it works.

1 Like

That occurred to me too. Not sure how it will handle a path binding rather than a static path string.
Good luck! :slightly_smiling_face: