10/4/2024 10:41 AM | |
Joined: 7/19/2022 Last visit: 9/15/2025 Posts: 436 Rating:
|
Hello AutoGen_5145465, Are these bits that are not updated being used somewhere in the PLC program? When using SetBitInTag, it is forbidden to write values from different sources (from the HMI and the PLC). I recommend checking the cross-references to see where the tags are being used. |
If this Information really helps, you could use the Rate function |
|
This contribution was helpful to
1 thankful Users |
10/4/2024 12:43 PM | |
Joined: 7/9/2024 Last visit: 9/8/2025 Posts: 5 Rating:
|
Thank you for answering my question. The bit_n in a tag is set to TRUE by a button in HMI with the instruction SetBitInTag. The tag is integer or word.I used this construction: - IF bit_n THEN DoSomething; bit_n:=FALSE; END_IF; Some further experiments lead to the conclusion that the construction above never will work. (According to my logic sense it should.) What I found: If the bit is set to zero/false in the same program cycle as it is read, then nothing happens at all. I believe it has something to do with how the system handles concurrent operations. I had to DoSomething only once, so the solution became: - IF bit_n AND NOT block_n THEN DoSomething; block_n:=TRUE; ELSE block_n:=FALSE; END_IF; I then added a timer to reset the whole integer/word to zero after 2 seconds. Regards, Kåre |
KaFj |
|
This contribution was helpful to
1 thankful Users |
Follow us on