Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 

webIQ snippet

webIQ snippet

RobotART_Walter
Long-established Member

Hi,

I made an composite and want to change the data which is shown with an item value. 
The widget is configured like this:

RobotART_Walter_0-1730300305502.png


The snippet itself looks like this:

RobotART_Walter_1-1730300448301.png

The item attached looks like this, which is just an int value:

RobotART_Walter_2-1730300490404.png

However, the value is not overwritten when changing the item value. It seems to always be 1. 

Is there something I am doing wrong? Or is the snippet functionality to meant for using with (changing) items?



6 REPLIES 6

webiq-sk
Frequent Contributor

You entered invalid JSON code:
webiqsk_0-1730301791336.png

You must not have quotes inside "" - this will break JSON as it makes it invalid. If your item (for whatever reason) really contains quotes you have to escape it for proper JSON syntax:

"recipeData.\"<%= Nr %>\".volumes.0.amount"

webiqsk_2-1730301921429.png

webiqsk_1-1730301901681.png

 

RobotART_Walter
Long-established Member

Hi,
Thank you for your reply. 

Actually, when not using quotes the item is received as null. 
Do I need to acces the actual item value in a different way? Like item.value or something? 

You have to specify the item name exactly as it is defined in the "Alias" field on the Items tab in Process Data Manager:

webiqsk_0-1730358473680.png

 

webiq-sk
Frequent Contributor

In any case, why don't you simply drop an input widget into your HMI and connect the item you wish to use there manually? If this works the item name will work everywhere, if it doesn't the item name is incorrect.

RobotART_Walter
Long-established Member

The name is 100% correct, since I used the 'select item' menu and selected the item from there. 
Using an input widget works correctly. This is actually how I change the item in the first place.
However what I try to achieve is to overwrite the array number with the value from the item(for recipe managment purposes). This does not seem to work, the array number remains 1 even though the actual Item is a different number( I checked this from the plc side).
I have done this before using an INT placeholder and this works correctly, but now I want to use an item instead. 

"The name is 100% correct, since I used the 'select item' menu and selected the item from there. "
This does not ensure that the item actually (still) exists with the PLC - it only means that WebIQ knows it, but the referenced item in the PLC might still be gone. Please note that there are two parties involved here: WebIQ is where you setup the alias <-> item name mapping in the PLC. However, if the item is removed from the PLC it will still exist in WebIQ, but not work.

"Using an input widget works correctly."
This means that the item is known to WebIQ and still exists in the PLC, so that looks fine.

"I have done this before using an INT placeholder and this works correctly, but now I want to use an item instead. "
Please do not confuse "item name" with "item value" - WebIQ does not support item values for placeholders, only static values. By selecting "item" as the placeholder type the only thing that happens is that you can then select an item from the dropdown an the *name of the item* will be used for the placeholder, not the value.

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