4PPC50 and RS485 communication with Danfoss inverter

Dear All,

I am having some trouble to connect to the Danfoss inverter via RS485 on 4PPC50 (Panel/PLC).
The wiring is OK, on both sides. When I try to reach the Danfoss inverter, I have error 20210 - invalid ID or ID is 0.

For the initialisation of the communication I have this code:

Open.enable := TRUE;
Open.pDevice := ADR (‘IF9’);
Open.pMode := ADR (‘/PHY=RS485 /PA=e /DB=8 /SB=1 /BD=19200’);
Open.pConfig := ADR(‘name of .dat file’);
Open.timeout := MBTimeOut;
Open.ascii := 0;
Open();

– Not sure if this is correct Open.pDevice := ADR (‘IF9’).

This matches the IF9 “psysical” configuration in AS. For this I have INA protocol active and ModbusRTU communication OFF. For the Danfoss inverter everything is set, and the Modbus communication is enabled.

What could be the problem, and where do I make mistake?

Thank you in advance.

Hi Milan,

Which function block is reporting error 20210?

I’m not sure which library you’re using, but my guess is that the “Open” block is MBMOpen() from the DRV_mbus library. Is that correct?

MBMOpen returns an “ident” output that must be used for future function block calls. Error 20210 sounds like this ident is not being saved and used properly:

Hello Marcus,

Yes, that is correct. I’m using DRV_mbus library.

1

I don’t have much experience with 4PPC50, but I never had problem with the X20CP34xx or X20CP13xx.

I’m not sure If I had the whole configuration right. Maybe I got something wrong in those steps.
Perhaps, because of that I can’t read the slaves - hence the error.
Also, not sure if in the Physical configuration is OK.

This is configuration from the PLC side, with code.

When MB_Enable is called in the cyclic program, what is the ident it is given?

It seems risky to me to call the Open function block only one time in the Init as this block may take multiple calls to complete. This block should be called until you have a status of 0, or an error. This can be done in the Init routine with a WHILE loop, but the recommended way would be to implement a state machine within your cyclic program that doesn’t enable Master until Open is finished.

I think I got it.

This is what I have now:

I have the reading from the Danfoss inverter.
The problem was in the Danfoss, the S640 switch should be in Terminated position.
That is all I did.
I made an array of 2 Danfoss (that is what I need btw), and when I terminated the array on Danfoss physically, everything seems to be fine.

I want to inform you that this problem is resolved.

Thank you so much for the assistance. Special thanks to Marcus.

2 Likes