Micro 830 : Data send problem via Modbus RTU

Asefakaratas

Member
Join Date
Jan 2019
Location
Istanbul
Posts
28
Hello friends

We communicate between Micro 830 and a card that control DC motor via modbus RTU. We do not have any problems in communication. But for every value I send, it multiplies by 256 and receives a command. For example; If I type 10 rpm, it gets the command as 2560. What do you think could be the reason?

DC Motor Card Model: BLH2D30-KR
 
what happens if you send a value that is 10 times the value you want?


The problem is likely byte swapping: a difference in byte order between the sending and receiving modbus nodes. The bits in a 16-bit, 2-byte integer with a value of 10 on the Modbus source node are
0000 0000 0000 1010
The blue bits compose the Most Significant Byte (MSB); the red bits compose the Least Significant Byte (LSB). The integer is sent as two bytes, in some order, either MSB then LSB or LSB then MSB, by the Modbus source node and received as two bytes by the Modbos destination node. If the destination node interprets the order of the bytes received differently than the source node, then it arranges the bits in a 16-bit, 2-byte integer like this:
0000 1010 0000 0000

where the red bits are now the MSB and the blue bits are now the LSB. The value of the integer evaluated from those bits is 2560 i.e. 256 (= [1 0000 000]) times the original LSB or 10.


N.B. this is a special case: the factor of 256 only applies when the original MSB is 0. More generally, the destination value will be MSB + 256 * LSB, which reduces to 256 * LSB when MSB is 0, although there is also the sign bit to consider since the integer is probably a signed 16-bit integer.


If you are never going to send a value greater than 127 from the Micro830 to the motor, then you could simply multiply it by 256 before sending it and move on. The more general case, to handle any possible value, including negative values, is a bit more involved but not too difficult; I think the BSL and BSR instructions might be the way to go.
 
Last edited:

Similar Topics

Hi Guys, Is there any way to get the real time clock datafrom the PV300 to the Micro 830 ? I have figured out how to communicate from the PV to...
Replies
4
Views
3,043
Hi, Its possible communicate between kinco hmi (mt4404t) and Micro830 through a serial line ( rs232/485 ) ?
Replies
2
Views
1,562
Customer has a Micro 830 (2080-LC30-16AWB) and a Panel View component C200 (2711C-K2M). They want to add remote connectivity. I was thinking of...
Replies
9
Views
2,699
how do I make a timer timing bit in a micro 830 program using connected components?
Replies
5
Views
1,599
Good Evening , I haven't done much with CCW and the Micro 830. I am trying to upload a unknown program from a Micro 830. It just seems like...
Replies
1
Views
2,791
Back
Top Bottom