how to get Honeywell HC900 modbus read working?

dearkurt

Member
Join Date
Dec 2010
Location
kaohsiung
Posts
1
hi all

i test the HC900 modbus (master) read function by connecting s1 port to my notebook with rs485 usb converter. in the HCD, i monitor the MBS function block. i got NO_SCAN and BAD_COM both are false. does it mean all my connection and settings are right?

in the MBS function block, i set reading only one 16bit unsigned register.
in my notebook, i write a program worked as modbus slave.
i check the program, i get the query message are correct and conformed with my MBS setting. then i send responses something like 010302E148F022.
after many communications, very weird, in the modbus master port diagnostics, messages received are still zero, and the MBS output pin also zero, and all communication count as application errors. i send the response already within the timeout i set in the advanced setup.
what i miss to get modbus read working?

thanks for your reading and reply.

Code:
//my program 
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
    serialPort1.Open();
    do
    {
        if (serialPort1.BytesToRead > 7)
        {
            byte[] rcv = new byte[256];
            int i = serialPort1.Read(rcv, 0, 256);

            if (i == 8)
            {
                byte[] buff = new byte[] { 1, 3, 2, 225, 72, 240, 34 };
                        
                serialPort1.Write(buff, 0, buff.Length);
            }
        }
    }
    while (true);
}
 
i test the HC900 modbus (master) read function by connecting s1 port to my notebook with rs485 usb converter. in the HCD, i monitor the MBS function block. i got NO_SCAN and BAD_COM both are false. does it mean all my connection and settings are right?
in the MBS function block, i set reading only one 16bit unsigned register. in my notebook, i write a program worked as modbus slave. i check the program, i get the query message are correct and conformed with my MBS setting.

So the serial connection works - You confirm that the PC sees the HC-900's query message? "i get the query message are correct" means that you are sure that the query is coming through to the PC correctly?

wgpztk.jpg


then i send responses something like 010302E148F022.

I suppose you can fake a response, by responding at the end of the query with a legitimate Modbus response.

Your response message 010302E148F022 decodes as:
01 slave address
03 function code
02 byte count
E1 48 data
F0 22 CRC CRC

Is the HC-900 addressing slave #1? (It expects a response from the slave node it queried)

Is it reading a holding register at the 40000 memory region with the 03 function code?

Is the 2 byte format a format the HC-900 expects to receive?
(signed or unsigned 16? floats or 32 bits are the wrong number of bytes)

Is the CRC value using the correct word order?

The on-line CRC calculator at
http://www.lammertbies.nl/comm/info/crc-calculation.html
calculates the CRC for 010302E148 as 22F0.

50651w.jpg


Are you sure the word order for the CRC is correct? Yours is the opposite word order, F0 22. I'm not sure and it's late and I'm too tired to look it up.

after many communications, very weird, in the modbus master port diagnostics, messages received are still zero, and the MBS output pin also zero, and all communication count as application errors. i send the response already within the timeout i set in the advanced setup.
what i miss to get modbus read working?

If the response is too quick, the HC-900 will miss part of it. If the response is too slow, the HC-900 will time out.
If the CRC is bad, no comm.
 

Similar Topics

Hey Guys, I am getting random rack/slot errors. I go to download and everything is ok but then it has a error. For example - Yesterday everything...
Replies
1
Views
363
Hello Guys, I'm working on Honeywell HC900. I am using the PID block. I have attached the Switch and loop block to it as well. I have attached a...
Replies
2
Views
631
Does anyone have experience with setting up a HC900 to a prosoft card? Using this to communicate with an Allen Bradley plc
Replies
1
Views
696
Greetings! I'm trying to connect HC900 to Kepserver in Plant via HC900 ethernet driver provided by Kepserver. I put the IP address and most of...
Replies
0
Views
1,115
Hello All, I have problem with Honeywell HC900 C50 CPU, the problem is my all local IOs cards not communicate with CPU. I attached a picture of...
Replies
2
Views
1,661
Back
Top Bottom