cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Image Changer question

Image Changer question

dwoodlock
Member

Trying to figure out if there is a way I can trigger a changed based on a float value?

The 0-1 for boolean values works fine, cant seem to figure it out with a float.

tried >5 <5 for changes, and it always seems to convert to a string type comparison.

Thanks in advance.

dwoodlock_1-1729802845108.png

 

dwoodlock_0-1729802701300.png

 

5 REPLIES 5

Sgilk
Frequent Contributor

@dwoodlock ,

This is working for me with integer and float item parameters. I can also select either integer or numeric comparisons in the image changer. This is in WebIQ 2.15.7.

Sgilk_0-1729805329794.png

Are you sure your active pressure is a float and is set to the comparison values? 

HmiGuide
Community Moderator
Community Moderator

Here some basics for the image changer:

  • you can only compare with concrete values (value=5)
  • you can NOT compare with value ranges (value<5)
  • all values which are not mapped as option will show the default image
  • using floats for compare with a concrete value may fail, because of the decimal places (see Floating-point_arithmetic)

When you want to display different images for ranges of number, you can solve it like this:

  • use mulitiple widges iq-image
  • hide the image with WebIQ functionality (see picture below)
    HmiGuide_0-1729842243354.png

     

Thank you for the clarification, hugely helpful.

HmiGuide
Community Moderator
Community Moderator

@dwoodlock Alternatively, you can also convert the range of the float number into an INT so that the image changer can be used. You can do this in the PLC or WebIQ. Here an example for the PLC.

IF (rFloat>30) THEN
  iImgId := 3;
ELSIF (rFloat>20) THEN
  iImgId := 2;
ELSIF (rFloat>10) THEN
  iImgId := 1;
END_IF

  

I ended up just making the determination from a binary within the plc program instead of trying to use the float. KISS philosophy.

 

Thanks

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist