sgull

Modbus RTU and Danfoss

18 posts in this topic

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.

 

Regards

 

Denis

 

https://www.google.ie/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCEQFjAAahUKEwj1oPeorvjGAhVCjdsKHT3lDqM&url=http%3A%2F%2Fwww.danfoss.com%2FNR%2Frdonlyres%2F844E0F42-AB58-4EAD-A11B-BDAED985391D%2F0%2FModbusRTUOperatingmanual20111117.pdf&ei=DZi0VbXmBcKa7ga9yruYCg&usg=AFQjCNGatXumxxFsBLenfbhFo1XC4MqGjQ&bvm=bv.98717601,d.ZGU&cad=rja

0

Share this post


Link to post
Share on other sites

Hi Denis,

http://206.72.118.208/legacy%20literature/6000/175R5467Rev0604VLT6000ModbusIM.pdf

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.

 

Regards

 

Denis

0

Share this post


Link to post
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.

0

Share this post


Link to post
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.

 

regards

 

Denis

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

You set PLC Master ID = 2 and also trying to read/write from/to slave ID=2.

Change master ID.

0

Share this post


Link to post
Share on other sites

Hello

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

0

Share this post


Link to post
Share on other sites

In the COM INIT block, turn off Flow Control and Ignore Break.  The RS485 signal is on the two outer pins of the com cable - try swapping them.

Joe T.

0

Share this post


Link to post
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

0

Share this post


Link to post
Share on other sites

Hi,

 

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.

 

 

0

Share this post


Link to post
Share on other sites

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.

cheers,

Aus

0

Share this post


Link to post
Share on other sites

Hi,

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?

0

Share this post


Link to post
Share on other sites

Afterall-

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.

0

Share this post


Link to post
Share on other sites

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.

cheers,

Aus

0

Share this post


Link to post
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

0

Share this post


Link to post
Share on other sites

Thanks for the update!

It sounds like you've learned some of the secrets of Modbus troubleshooting.  You can't beat an external program and a 485 converter to find the gremlins.

Joe T.

 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now