36 Images showing PLC Tray UDT Array

I’m looking for ideas on how to solve an issue with my tray system, shown in Picture below. The tray has 36 positions, and I want to visually represent the status of each position using images. Specifically:

TrayPocketsArray is an array where each element represents the state of a position in the tray.

• A value of 1 means the part has been picked.
• A different array shown below also indicates that a slot is disabled (for example, because the robot can’t reach it).
• Otherwise, the slot is available.

I want to display 36 images corresponding to these 36 tray slots, each image dynamically showing one of the following based on the array’s value:

  1. Slot available – default image.
  2. Slot picked – image with a green checkmark.
  3. Slot disabled – image indicating the position is not usable.

I’m open to using Python, scripting, or any other method to implement this. I’m mainly looking for guidance or best practices on how to link the tray array state to the appropriate image display for each slot.

Any suggestions or ideas are greatly appreciated. Thank you!

This is the exact purpose of templates(Vision) or embedded views(perspective).

For vision:
Create a template that is just an image component. Add 3 parameters to the template, instance, slotPickedArrayPath, and slotDisabledArrayPath. Add 2 internal properties, isPicked and isDisabled. Indirectly bind isPicked to the item picked array position, and indirectly bind isDisabled to the slot disabled array position. Something along the lines of {slotPickedArrayPath}[{instance}] in the indirect binding.

For perspective:
The process is similar,but instead of a template, you make a new view, and you will need to make view parameters and view custom properties instead. The indirect binding and everything else should be the same.

From there, use the values of isPicked and isDisabled to adjust the image path for the image component via an expression binding.

For Vision:
On your main view, use a template repeater set to dataset, and give it a dataset with each row containing the instance number, path to main array, path to secondary array. This dataset can be made via a script if you want the amount of items to be dynamic.

For Perspecitve, use a flex repeater and point it to use your embedded view. Add as many instances to the list as required and make sure they each contain instance, slotPickedPath, and slotDisabledPath as keys.

4 Likes

Is it perspective or vision? The terminology and method for either module will be different, so unless you're truely intending to implement it in both modules, which one is it?

1 Like

Along those lines, I would create an Ignition side UDT with the disabled, empty, etc as members. Then, just pass a single root tag path to the template.

2 Likes