The GraphicIndicator is used to switch between images based on bits in the PLC which can be used to display different states of an object. This walk through will show how to make a schematic symbol of a 3 way valve switch through different states.
- Download and save the 3 attached images to a location you will be able to easily find again
- From the Toolbox, add a GraphicIndicator to your form
- In the Properties Window, click in the GraphicAllOff property, then click the ellipsis button (3 dots)
- A new windows will open to select a graphic. Click the Import button
- Browse to the location you saved the images to
- Select ThreeWayValveLeft.png file
- Click the OK button to close that window
- Now go to the GraphicSelect1 Property and repeat the process, but this time import ThreeWayValveCenter.png
- Repeat once again with GraphicSelect2 property and ThreeWayValveRight.png
You can now do a quick test to make sure those steps were completed correctly.
- Go to the ValueSelect1 property and set to True
- You should now see the valve change to the image with the red in the center position
- Change ValueSelect1 back to False
- Change ValueSelect2 to True
- The image should change to the right position
We can now make bits in the PLC control which image is to show.
- You will need 2 bits from the PLC. One to select center position and one to select right position. Both off will change to left position
- Set PLCAddressValueSelect1 to the address of your first bit
- Set PLCAddressValueSelect2 to the address of your second bit
When you run the application, the 2 bits will change the valves different states. Not that ValueSelect1 has priority. If both bits are True, it will show the center image.