Skip to content

Partial Bit Access in HMI, not working?

I've been testing partial bit access to a word in the HMI and it seems to not be working as documented:


Here is the documentation:


When trying to manipulate a bit of a WORD using three different kind of HMI symbols, the results are like this:

  • Standard symbol Button and Check box only manipulates the first bit, regardless of %X0, %X1-2-3 and so forth.
  • A custom symbol with variable type BOOL or ANY_BIT, will not accept a partial bit access as it throws an error.


Screenshots:


Four Buttons and four Check Boxes, they manipulate bit 0, 1, 2 and 3 of a WORD.

Pressing any of those writes the first bit of the word, not any other bits.


Example screenshots of one of the checkboxes and one of the buttons:


If I create my own symbol, such as this iOS-styled slider:


I get this error:


I am running 2023.9

Comments

  • edited October 2023

    It mess when BEHAVIOR tab used or as parameter link...

    Hope can be improved on next iterations

  • @Martin PLCnext Team could you check with the development team if this is a known issue ?

  • whoever made this decision, owes me a day of my life 🙂.

  • @Martin PLCnext Team Do you know if the development team plans to fix this bug?

    I was hoping it would be fixed for the 2024 release as we are stuck with RTS-releases going forward due to type approval requirements.


    The reason this is important to me is that it is very efficient to perform checks of for example interlocks if the various interlock conditions are packed in a word:

    Example:

    InterlockWord.%X0 := EmergencyStopActive;

    InterlockWord.%X1 := SomeOtherInterlockActive;

    ..and so forth for as many bits you require.

    This way the start condition becomes very simple: "StartPermitted := (InterlockWord = 0)". Which is much much more simple than checking dozens of conditions individually or within an array.


    So if you want to display these start interlocks to the user in the HMI (and I am the kind of guy who wants to display as much as possible to the users), one simply refer to the individual bits in the interlock words and put it into a symbol for a red indicator or something with a text describing the interlock. It's quick and effective and scalable.

    But because the bitwise access is not working, i have to convert the WORDS (and DWORDS and LWORDS; i use this technique a lot) into arrays instead and refer to various array indexes. This is waste of variables and doublework i try to avoid.

  • As I know, there is no trouble to use partial bit binding, when you use it for visualization dynamic properties, visibility, color fill, toggle value, etc. Actually, you should not meet any troubles to visualize bits from bitstrings (byte/word/dword) in some "color lamp" signals.

    So it can be used for workaround quiet well. And it work good for me at leas from FW/IDE 2022. Please find out sample project attached. It for IDE 2023.9 and FW2023.0 PLC axcf1152 (for simulation proposes).

    Best regards.

  • Hi @Oleksandr Guminskiy


    First and foremost, I am thankful for your time and effort, and that you created an example. I attach a few screenshots beneath so that other forum users can see:




    HMI in use (number input above is the bitstring interpreted in bitwise binary below):


    The gray/green colored symbols are text-symbols with a dynamic connected to the bitstring


    The yellow part is a symbol which takes a dword as an input and displays the bits:


    So there are some parts of the HMI that can take bitwise access, and I will investigate how I can incorporate this into my HMI.

    To recap, my problem is that user-created symbols cannot take bitwise access as parameter input as shown below:


    So that means that I have to create a symbol that takes in the entire word (or dword or lword), and map up 16-32-64 bits internally in the symbol with bitwise access the way @Oleksandr Guminskiy has done above.

    That is not a perfect fit for me, because i sometimes only use 5 or 8 or 3 of the bits, and I dont want to be forced to display 16 when I only need to show a few - that is why a symbol with direct bitwise access is desirable to me.

    Of course, I can re-create the symbol as a text box with dynamics each time - but then the entire advantage of using symbols is lost because I have to change each and every one of them individually if i later decide to change how they work. A symbols is a "fix one place"-type of solution.

  • Ok. You may try to use additional id variable/constant to point exact bit you need. This way will return you some warnings about data type compatibility but still be operate. Please, find archive attached.

    This is about this symbols


Sign In or Register to comment.