Jump to content

Modbus RTU and Danfoss

Recommended Posts

Hi All


Not sure if I am posting this twice but I have a problem Modbus RTU


I have successfully set up communication between the drive and a V1040

If I ask for a parameter on the drive, such as maximum frequency, I get a value such as -14582763 instead of the expected 60hz.

If I change the value in the inverter the long number changes on the V1040 indicating that I am reading the correct parameter.

I have tried to store the value into an MI,ML and DW in case there is an issue with data length.

I know I need to read 2 MI to get the required result, could these be returned in the reverse order and if so how do I reverse these.

Any help would be appreciated.


Below is a Link to the modbus manual.







Link to comment
Share on other sites

Hi Denis,

Look for this document. It may be for other drive, but idea is the same.

Look table at page 9.

I hope this will work for you.


If this is not working - find coil/integer map for your drive model.

Hi Alex


I already have communication established and I am sure i have the proper address (when I change the value in the Drive it changes in the PLC)

the problem I have is that the returned answer does not match the expected value.

When I request frequency I should read a value of say 60, what i get is a large positive or negative number.

I need to read two MI values in the drive to get the value I need so I suspect the drive is sending 16 or 32 Bit.

Is there any way the PLC is reading the returned value in the wrong format.





Link to comment
Share on other sites

It is strange, that you have to read 60 HZ as 16/32 Integer.


Is it possible that drive keep frequency as 32 bit Float Point?


Please set 60 HZ and then 50 HZ and read what drive send.


Is this any indicator, which show frequency at VFD itself? LCD for example?


You can do next test:

Set MF at PLC to 60 HZ or 50 HZ, and copy MF to DW. Then look at DW Bytes in HEX. Do you see numbers, similar to what VFD send?

If yes - you can see how you can swap byted to have right number.


I hope this helps.

Link to comment
Share on other sites

Thanks Alex


I will be working on this during the week.

I am only reading from the inverter not writing to it.

I do not know exactly what the drive sends, but I remember that it was a very large positive or negative number.

I know I am reading the correct parameter because when I change the parameter in the drive it changes in the PLC.

If I change any other parameter the PLC does not change.

When I get back to this I will post exactly what I get when I set the parameter to 50 and 60.


Thanks for your suggestions.





Link to comment
Share on other sites

  • 1 year later...

Hi All
I have a problem with testing a Modbus RTU via RS485 on V130 as master and Danfoss frequency converter FC280. I made a PLC simple program to test write and read with modbus. 
Till now I did not use modbus serial comunication with frequency converter. Even a Unitronics PLC is not my strong range but I have been working with a Danfoss FC280 quite a lot. 
I see LED triping for comunication on FC280 when I press a F1 or F2 Buton on V130. But I stil can get a result.
Pleas any help.

Modbus FC280_pop1,1.vlp

Link to comment
Share on other sites

  • 4 weeks later...


I change the ID address of the master/slave, as Gabriel Franco said. I also change the the other modbus parameters to: 9600,8,E,1.
But its still does not work. Not to read or write. If I go to boot menu on V130, see under the Comunication Port1 that Rx and Tx was sended. But there is nothing now not a Led tripping on frek. converter. I was waiting for new cabel 6/6 I was thinking maybe is a problem in cabel but it is the same with new cabel. Please any advice or suggestion.

Modbus FC280_pop1,2.vlp

  • Like 1
Link to comment
Share on other sites

I change the COM INIT block and also change the Modbus configuration to 57600, 8,n,1,N. And do the same in FC. ID of slave is 2. I have the jumper on V130 for RS485 an termination ON. The termination on slave is OFF. I also try to swapping the two outer pins of the com cable. I can see that the telegarm have been send in PLC. And on FC the Bus message count chenge, when ever I press the F2 button on PLC. But the reference on FC, what I want to regulate, does not change. The parameter to change this in Danfoss FC parameter is 3-10. Modbus 4x Holding Register (decimal) for that parameter is 3100. If we want to change the parameter to 10%, we need to set the value 1000 (INT 16). I tried to change the frequency converter, but my PLC program does not work on non of them.

Modbus FC280_pop1,3.vlp

Link to comment
Share on other sites



I noticed in the application that you are trying to read from address 16130 in length of 10.

According to the Excel file you attached before the next address after 16130 is 16140.

if the frequency register is 16 bit then you need to set the length to 1 , if the frequency register is 32 bit then you need to set the length to 2.



Link to comment
Share on other sites

  • MVP 2023

Hi Afterall,

I haven't looked at your program, but some points to ask:

Why slave termination off?

Have you tried 9600, 8 N 1?

Have you tried to communicate with the Danfoss using Modbus Poll etc to confirm numbers, instructions, sequencing etc?  If you can get it to work with this, then you can apply results into the PLC parameters.  Easier with Mbus poll initially.



Link to comment
Share on other sites


I tried to change the vector length: 1(dec), 2(dec), 10(dec), 16(dec)   and all this with hex. I tested termination on FC Off/On. If I press the F1 or F2 button to send telegram, I see on FC that the Bus message count increase for 3, because the master did 3 retries but increase also a Slave error count. If I change the slave ID on FC, there is no message on this FC, just in a bus massage. That means the FC received the telegram. There must be some error, but I cant find it. I do not have the Modbus Poll licence. I did some tests with coils in modbus and FC, some times ago. And that time works corect. Does anybody see the solution?

Link to comment
Share on other sites

  • MVP 2023


What's a Modbus Poll license?

This thread has run for a while and you've tried a lot of things.  We still don't know which end the problem is on  - the Unitronics side or the Danfoss side.  Unitronics Vision series can be tricky to set up Modbus on as you have to write your own code to make sure the Modbus task isn't busy, as well as make sure the Rules of Modbus are being followed, as Ofir pointed out.

I'm afraid you're going to have to set foot in advanced troubleshooting land and do some testing using known software on a PC to gather some known information.  With this you can hook the two sides together.  You want to use a PC because the addresses, lengths, and COM port parameters are super easy to change to try different things.

1.  Go online and order a USB to RS485 converter for your computer.  A quick Google search produced this: http://www.usbgear.com/GM-485422.html  but any one with terminals will do.

2.  Here are links to limited use Modbus Master and Slave programs that you can download for free:

Master: http://www.simplymodbus.ca/RTUmaster.htm

Slave: http://www.simplymodbus.ca/RTUslave.htm

3.  Establish communication between Unitronics and the Slave PC program.

4.  Poll the Danfoss with the Master program.

5.  Let us know what happens.  Post any code that works or doesn't with questions.  


I bought a PC-based Modbus program years ago and it remains one of my best troubleshooting tools.  If anyone is interested I use this one - https://www.calta.com/mdbus.htm

I get no compensation for this.  I am just an extremely satisfied customer.

Joe T.

Link to comment
Share on other sites

  • MVP 2023

I'm also assuming that you have fully read the MG07B202 manual from Danfoss, starting at page 59  "Modbus RTU".  There is lots of info there, and also lots of initial settings that have to be right for things to work.

And +1 to all of Joe's stuff above.



Link to comment
Share on other sites

I've tried to test the communication with ADAM  USB to RS485 converter and Modbus master. And that really helps me. I finally find the solution. I did quite many mistake in my PLC code on master and also in the slave side. In the past posts I attached the unworking PLC codes. Now I post the code thats works if anybody in the future will need this, and delete the old attaches. Thank you all.

Modbus FC280_pop1,4.vlp

Link to comment
Share on other sites

  • 2 years later...

Interesante,  en general manipulo equipos Danfoss comunicados con PLCs así como sus diferentes comunicaciones que dispone,  en este momento me encuentro con un Unitronics V350-J  utilizare Modbus para controlar mi FC-302 ya que es compatible.

Tomare en cuenta los comentarios anteriores ¡geniales todos¡, iniciare con el desarrollo de la aplicación.

Link to comment
Share on other sites

  • 4 months later...
On 18/4/2017 at 17:12, Joe Tauser said:

En el bloque COM INIT, desactive Control de flujo e Ignorar interrupción. La señal RS485 se encuentra en los dos pines externos del cable com; intente intercambiarlos.

Joe T.

En este caso tengo una aplicación en desarrollo de Modbus RTU, de forma breve dentro de mis MI del sistema e ingresado a mi PLC V350 al realizar la lectura de algunos parametros de un varidador Danfoss en MI asignadas solo me aparece el valor(5) eso que me esta indicando

Link to comment
Share on other sites

  • 2 weeks later...
On 7/12/2019 at 0:57, Joe Tauser said:

Si obtiene un valor de 5, entonces el comando Modbus está agotando el tiempo de espera. Publique su código para que podamos echar un vistazo.

Joe T.

Buenos días Joe T.

El código correspondiente es:

  • Imagen 1 y 2: Solo estoy utilizando el puerto que trae de fabrica (no tengo la tarjeta adicional). En este caso activo y desactivo el puerto cuando requiero programar el PLC.
  • Imagen Com: Es la configuración que tengo en el PLC puerto serial.
  • Imagen Config y rhr: Referentes a la configuración del Com, y la siguiente es respecto a la lectura que pretendo realizar al variador Danfoss.  

De igual manera anexo los datos que tengo del FC-302 Danfoss .

  • Configuración del puerto Com.
  • Referencia que pretendo leer del equipo.
  • La lectura que hace referente.

Hago una observacion que en la imagen no aparece el parámetro 8.30 donde muestra que se encuentra en Modbus RTU , pero físicamente en el equipo esta seleccionada la opción.

Dentro de mi FC-302 mi ID 843.0 hace referente a espacio disponible para leer parametros en Modbus RTU.

  • 843.0 es lectura de parametros, en este caso lee el parametro 1603 en realidad lo tengo configurado para leer el 1685(que es un valor en hexadecimal).

En base al manual del fabricante Danfoss Modbus RTU, indica que para hacer lectura de los parametros la lectura corresponde a 843.0 corresponde a 2910 por esta referencia es que en el PLC trato de leer este parametro, e realizado pruebas de igual manera en 42910 como lo marca el manual pero solo recibe en las MI un valor (4 y 5). E realizado este tipo de red en PLC Siemens, Allen Bradley y otros aparatos y no e tenido problema alguno con las mismas referencias que  mencione anteriormente, pero en este caso no comprendo el error que surge.


Anexo la liga del manual página 18:


De ante mano agradezco la atención, sigo realizando pruebas pero aun  me encuentro sin excito.






fc 302 puerto.jpg


lectura fc.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...