Open yoabau opened 1 year ago
Hi, I think there are different interpretations of bitmask management and in any case it is not possible to satisfy everyone. The bitmask is intended to be associated with the value of the the bit (1/0) and not with the value masked with the bitmask.
Hi @unocelli ,
Thank you for your reply. Let me develop some arguments to convince you that it is not a question of interpretation:
myTag | Logic Operand | myBitMask | Result |
---|---|---|---|
16#00 | ??? | 16#0F | 16#00 |
16#01 | ??? | 16#0F | 16#01 |
16#02 | ??? | 16#0F | 16#01 |
16#12 | ??? | 16#0F | 16#01 |
16#12 | ??? | 16#F0 | 16#01 |
16#12 | ??? | 16#00 | 16#12 |
myTag | Logic Operand | myBitMask | Result |
---|---|---|---|
16#12 | AND | 16#0F | 16#02 |
16#12 | AND | 16#F0 | 16#10 |
myTag | Logic Operand | myBitMask | Result |
---|---|---|---|
16#01 | AND | 16#07 | 16#1 - WHITE |
16#02 | AND | 16#07 | 16#2 - GREEN |
16#04 | AND | 16#07 | 16#4 - RED |
... | AND | ... | ... |
16#12 | AND | 16#07 | 16#2 - GREEN |
Conclusion: If FUXA aims to be an industrial web HMIs, SCADA, it needs to comply, at least, with industry standards such as IEC61131. Bitmask is actually a topic covered by IEC (free sample here)
Hi,
I have encountered the same problem when using multiple bits on bitmask. For the same object (motor, pump, etc.) cannot set a color for each selected bit from bitmask. Please see my post #865.
@yoabau, regarding questions you put on point 1: 1.1 When no bit is selected on bitmask it's ok to get the numerical value of a tag. For example, it's useful to change the color of a pump when its current is between 2 and 10 A. When one or more bit(s) is selected on bitmask, the user can use either the boolean or numerical value of selected tag. It's true that when a single bit is selected, should be available only the bool value. But it can be easily selected. 1.2 When no bit is selected, the user gets tag's value and depending on it, the objected can be customized. 1.3 That's a very good question. When a single bit is selected, bitmask works as expected. The problem appears when multiple bits are selected as I wrote on #865.
@unocelli, bitmask for only one selected bit work perfectly. My opinion is that when selecting multiple bits on bitmask, 2 behaviors (B1 and B2) should be available.
B1: If the checkbox next to dropdown list is checked, the user should be able to select the logical operation to be made between the selected bits. Also, the + button should be disabled because the logical operation returns only one result so there's no reason to add another result for the same tag.
B2 If the checkbox next to dropdown list is not checked, next to each mask value should be a dropdown list which contains all the bitmask's selected bits. Then for each bit can be assigned a bool value.
Selecting multiple bits from a WORD or DWORD tag is often used in SCADA systems. Assigning a value to entire WORD or DWORD tag, when selecting multiple bits, is not always a solution because it could constantly change.
Hello everyone,
Thank you @IonuDragomir1 for your comment. It really helped me understanding the bitmask feature. The feature actually works as query of bit as defined her. After selecting the required bit to monitor, the shape can return a color based on status (0=False or True=1) of one of the bits. Reusing your example I managed to get this result:
But it doesn't, and instead it seems to only check whether one of the bit has value 1=True?
Originally posted by @yoabau in https://github.com/frangoteam/FUXA/discussions/295#discussioncomment-7392022