Welcome, Guest
Username: Password: Remember me

TOPIC: using bitRead/bitWrite for commands and status

using bitRead/bitWrite for commands and status 6 years 4 weeks ago #419

  • vissing
  • vissing's Avatar
Hi.

Im used to work with a command word and status word when working with buttons, for then only to have one Server tag for commands and one for status tag. This Seems not possible here? (missing AND WORD)
Is the only way to use single server tags for each boolean command / status?

/Kasper.
The administrator has disabled public write access.

using bitRead/bitWrite for commands and status 6 years 3 weeks ago #420

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
Hello,
You can use scripts object from "Bitmap operations" library. To read bit you can use "Read bit" object, for set bit you can use "Set bit" object.
What protocol do you use? For most protocols you can read and write bit separately.

Best regards,
Ruslan
The administrator has disabled public write access.

using bitRead/bitWrite for commands and status 6 years 3 weeks ago #421

  • vissing
  • vissing's Avatar
I’m using modbus.

I’ve tryid the setbit and reset bit with bitread, but didn’t find it usefully.
I cannot get a local tag to set bit when true and reset bit when false. I used the BNOT to invert the local tag for bit reset?

It could be very nice if an option to use an int bit in graphic object.

E.g switch control: “command”.bit0
The administrator has disabled public write access.

using bitRead/bitWrite for commands and status 6 years 3 weeks ago #422

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
For Modbus you can do it easily by binding Boolean tag to Holding Register and choosing Binary Data type. See attached file.



Best regards,
Ruslan
The administrator has disabled public write access.

using bitRead/bitWrite for commands and status 6 years 3 weeks ago #423

  • vissing
  • vissing's Avatar
Ahh. Thanks!
I’ll try that!
The administrator has disabled public write access.
Go to top