Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: ModBus_TCP Client retrieving Digitals

ModBus_TCP Client retrieving Digitals 4 months 1 week ago #12216

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 159
  • Thank you received: 5
  • Karma: 1
Hi Claes,

Using Proview ModBus_TCP clients, we routinely read and write to UInt16, UInt32, Float32, Strings and Arrays. My question is around digitals. Sometimes, bit-packed digitals are passed as UInt16 and parsed into individual DVs using PLC code. But there are cases where a single boolean value is represented as UInt16, where the value is either 1 (true) or 0 (false). Currently, a boolean value is read as a ChanIi, mapped to an Ii and eventually converted to a digital using PLC code. I am looking for a method to map an UInt16 0/1 signal directly to a ChanDI without having to resort to PLC code conversion. All kinds of experiments have been tried, but I cannot get ChanDI to map correctly. I was thinking Bit16 with masking might work or something similar? From the documentation, it appears ChanDI was designed specifically for use with physical I/O cards? Is there an obvious solution that I've overlooked?

Your insights and advice are much appreciated.

Regards,
/Ron
The administrator has disabled public write access.

ModBus_TCP Client retrieving Digitals 4 months 5 days ago #12217

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3183
  • Thank you received: 504
  • Karma: 133
Hi Ron,

With Bit16 you can read each bits with 16 ChanDi numbered from 0 to 15. The bit you are interested in is number 0 so you just have to create one ChanDi with Number 0.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: AutoMate
  • Page:
  • 1
Time to create page: 8.081 seconds