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

Applying INTEGER placeholder as 2^INT BitMask

Applying INTEGER placeholder as 2^INT BitMask

NickOS
Member

I'm only a couple of weeks into WebIQ, and no previous json experience, etc. It had been mentioned in another post, Bit Access read/write from button, that the syntax bit[n]:Word does not appear to work for the button widget. I can concur I cannot get the read/write access working to an OPC-UA variable via this method. I am workingaround this by using a composite widget, with UI action and a placeholder for Word and bitmask:

NickOS_0-1669985586668.png

NickOS_1-1669985646138.png

NickOS_2-1669985698453.png

It works, but I'd much rather have placeholders for Word and Bit, so as to fully replicated the bit[n]:Word syntax. Is there a way to apply an operator, like 2**bit, using snippets? Or perhaps someone knows a better way?

5 REPLIES 5

HmiGuide
Community Moderator
Community Moderator

I think there is a missunderstanding. The Bitaccess is working for buttons. Only virtual items not supports the bit access.

I will put a bit more on that other post concerning how the bit-access isn't working for us. However, question still stands as to whether there is a method and syntax for doing such a placeholder value conversion?

HmiGuide
Community Moderator
Community Moderator

I do not understand what you want to do. Can you describe it in  a different way?

Sure, 

On UI action set-item-bitmask, it requires a value in decimal format, e.g. '32768'

If I place the object with this UI action within a composite widget, then create a placeholder 'bitMask', and use a snippet to drive this, also is fine (like in my images in OP).

What I am asking is if I can instead create a placeholder 'bit', and within the snippet convert 'bit' into a bitmask value, So if 'bit' = 15 for this istance of composite, internally I can apply 2^15 to utilise 32768 . In WinStudio, I'd be writing something like:

#Word: = #Word: OR Pow(2, #Bit:)

where (2,#Bit:) was essentially bitMask derived from my bit input.

 

HmiGuide
Community Moderator
Community Moderator

It's a bug of "Write on/off values when pressed/released", which will be fixed in next WebIQ version.

As workaround you can use the ui-Action "Write item"

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