Modbus Registers

Ones_Zeros

Member
Join Date
Feb 2014
Location
at work
Posts
367
Hello I have a power quality meter
that I'm wanting to read several bits from a register into wonderware
say the register is 0426
This register is a month & date

the first 8 bits is the day (00000101) Month=5
the second 8 bits is the month (00000011) Day=3

How in wonderware can I read these bits to stamp it on the screen as a month and date

I would have to read the first 3 bits as the month changes
and on the day I would have to read the first 5 bits as the day changes

how could i script this to so the correct month and day

thanks
 
If the bits in your word are 0000010100000011

To isolate the lower eight bits you perform an AND operation of the word against hex 00FF which is the same as all of the lower eight bits set to 1.

Word AND 00FF = 0000010100000011 AND 0000000011111111
which equals 0000000000000011 or decimal 3.

To isolate the upper eight bits you perform an AND operation of the word against hex FF00 which is the same as all of the upper eight bits set to 1.
Word AND FF00 = 0000010100000011 AND 1111111100000000
which equals 0000010100000000 or decimal 1280
The result is the upper eight bits isolated, but shifted eight places to the left.

Divide that by 256 to shift the bit pattern right by 8 places and you get decimal 5.

I hope that's specific enough.
 

Similar Topics

Good day guys. I have a third party device with its Modbus registers which I want to copy/set up on a plc because I need to convert my Modbus tcp...
Replies
3
Views
163
Hello everyone, I want to read a register in HC900 honeywell but I am not understanding. https://ibb.co/2dNDsmk In this link are the things I...
Replies
10
Views
1,806
Hi Team, So, what is the correct understanding of the codes for Holding vs Input registers? My understanding was #3 = Input registers & #4 =...
Replies
15
Views
2,757
Hello, I am attempting to add some IO Discrete tags to a AVEVA InTouch project (version 2020). These tags use the MBTCP driver and attempt to map...
Replies
1
Views
1,242
Platform: CCW, 2080-LC50-24QBB, Using 2080-SERIALISOL card Task: Writing Multiple Registers Using Modbus RTU (RS485) Problem: I am attempting...
Replies
4
Views
1,382
Back
Top Bottom