AC800M Program to Merge 16bit two Integer to DINT
RTU560 to AC800M Communication, RTU is sending data in 32Bit format over ModbusTCP.
RTU format is as below
First Register : 16 Bit Data
Second Register : 16 Bit Data
AC800M side we need to concatenate both of the 16Bit data to one 32 DINT register
First INT 0.1.2.3.4.....16 Merge Second INT 0.1.2.....16
0.1.2.3.4.5.6.7...............................32
RTU format is as below
First Register : 16 Bit Data
Second Register : 16 Bit Data
AC800M side we need to concatenate both of the 16Bit data to one 32 DINT register
First INT 0.1.2.3.4.....16 Merge Second INT 0.1.2.....16
0.1.2.3.4.5.6.7...............................32
Answers
Hi,
Setpoint..._int = INT
Setpoint..._Comm = REAL

![]()
Setpoint..._int = INT
Setpoint..._Comm = REAL
We looking to convert the two INT variable to DINT ( two 16 bit to make 32 Bit data)
We are not looking for IEEE float conversion logic.
We are not looking for IEEE float conversion logic.
> "We looking to convert the two INT variable to DINT ( two 16 bit to make 32 Bit data)"
The basic principle is ..... (Word1 * 16#FF )+ Word2
Be careful in your type conversions. if you simply try to multiply an "int" type then you'll get an overflow.
You can also ROL (Rotate Left) Word1 16 times, then Bitwise AND with Word2. but MUL is more efficient.
The basic principle is ..... (Word1 * 16#FF )+ Word2
Be careful in your type conversions. if you simply try to multiply an "int" type then you'll get an overflow.
You can also ROL (Rotate Left) Word1 16 times, then Bitwise AND with Word2. but MUL is more efficient.
Add new comment