3/29/2023 9:27 PM | |
Joined: 4/30/2018 Last visit: 4/10/2025 Posts: 2 Rating:
|
Has a better solution been developed for this? The lack of the SetBitWhileKeyPressed functionality is killing me right now... WinCC Advanced/Unified PC V17 Upd5 MTP1000 Unified Comfort Panel S7-1214 FC I have a "jog" button on my Unified Panel that is only visible when my drive is enabled. My PLC program runs such that if I jog to a position <= a variable limit, it will disable my drive. This prevents me from hitting the actual software limit (which creates an Axis fault). So as I'm jogging, it hits the program limit, drive disables, and the jog button disappears. But the problem is, the Jog variable is now stuck on. So when I re-enable my drive, it immediately begins jogging until it does actually hit the software limit, faulting the drive. Reset the fault, re-enable the drive, and it immediately starts trying to jog again, thus immediately faulting the drive. So I've gone in and added a line of code to reset the jog bit if the drive is disabled. Kind of clumsy/clunky, and annoying, but it works. HOWEVER now when I re-enable the drive after jogging to my program limit, even though the jog bit is low, the button still displays the graphic for "graphic with pressed button", even though it is not pressed. I guess it is switching the graphic based on the press/release triggers too. Tried adding the same "reset bit in tag" function into the Deactivated event - no change in behavior. This is the second time working around what is essentially the same issue. The first was an error acknowledgement button that is only visible when there's an axis error present - press Acknowledge and it clears the error and disappears the button. But the Acknowledge bit was remaining high, so next time I got an error, I had to press it twice to make it work: so I'd get the release action to reset the bit, then next press set it and cleared the fault... so basically my Ack bit was always staying on even with no error. Also, wrote a little line of code in the PLC to work around this. So am I going to have to go in and write little bits of workaround code for every place that I have a button with visibility conditions like this? SUPER annoying if so... It all worked just fine in the Comfort panel that I migrated from... ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 03/30/2023 09:29:38New subject after splitting |
|
3/30/2023 9:08 AM | |
Joined: 1/21/2013 Last visit: 4/21/2025 Posts: 3766 Rating:
|
Hi, A problem when using SetBitInTag or ResetBitInTag in the way tags are handled in WinCC Unified. For better performance, the tag values are first modified internally and then transferred to the PLC. However, it may happen that the value in the PLC is different from the value stored internally in WinCC Unified. It helps to use the Tag.Read() method with readType HMIRuntime.Tags.Enums.hmiReadType.hmiReadDirect directly after the bit set or read command. Development is still working on a fix for this problem, but it will take some time to change. Kind regards |
Follow us on