Author Topic: Modbus RTU  (Read 15707 times)

philipjoseph

  • Jr. Member
  • Posts: 57
    • View Profile
Modbus RTU
« on: December 18, 2008, 01:12:24 PM »
Hi,
I am looking on some help to get comunication between a T100MD+ and a Control Techniques VFD thru Modbus RTU.
The VFD support functions 03,06,16,23 and 40.
If parameter on VFD Pr 1.02 = 40102 (MODBUS PLC register) = 101 (Register address), what will be the format to read/write to/from that parameter?

Thanks.



Philip.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus RTU
« Reply #1 on: December 18, 2008, 10:56:26 PM »
To read Holding register 40102, and assuming that the RTU has ID = xx and has an RS485 port, then you can connect the PLC's RS485 port directly to the VFD's RS485 port and use the built-in READMODBUS command such as:

DM[1] = READMODBUS (13,xx, 101)

This will read a single 16-bit word of data from the VFD at location 40102. It is extremely simple. The PLC will perform all the CRC16  calculation and perform CRC error check of return response. It will retry the command up to 3 times until it get a valid response and it will then extract the data from the response and assign it to a variable such as DM[1] above. There is very little your program need to do other than to check if the command is successful by testing with the STATUS(2) function.

You can also use READMB2 command to read multiple registers in a single command into the data memory array.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

philipjoseph

  • Jr. Member
  • Posts: 57
    • View Profile
Re:Modbus RTU
« Reply #2 on: December 22, 2008, 01:47:11 PM »
Does the plc transfer any value to the parameter?
Example: Parameter 1.14 use text strings intead numbers and I want to write on it A1.A2 via Modbus RTU.
A="A1.A2"
WRITEMODBUS (13,02,A)
Will that work?

Thanks,
Philip
Philip.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus RTU
« Reply #3 on: December 22, 2008, 08:27:58 PM »
What do you mean? MODBUS RTU does not really support text string. WRITEMODBUS can only write  16-bit integer to the MODBUS RTU slave.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

philipjoseph

  • Jr. Member
  • Posts: 57
    • View Profile
Re:Modbus RTU
« Reply #4 on: January 03, 2009, 08:17:13 PM »
This is the situation now.
I have the T100MD connected to the VFD.
I have setup a function (1st scan) to change the port #3 to 19,200 8,2,n (setbaud 3,14) to match the VFD.
I have another dCfn to read the parameter 105
DM[1]=READMODBUS (13,1,105).
I change the ID=2 on the PLC, the VFD ID=1.
I am suppose to receive 50 on DM[1], i have no answer from the VFD.
I disconnect the cable from the VFD, if I check the voltage on the plc port is 2.1v and when the function is activated, the voltage change to -1.5v and go back to 2.1v. That may show that the port is sending the signal, I don't know.
On the VFD cable I have 2.57v (disconnected from the PLC). When I connect the VFD to PLC port, the voltage is 2.4 and also when the function is activated, the voltage changes.
What am i doing wrong and have no communication?

Thanks,
Philip
Philip.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus RTU
« Reply #5 on: January 04, 2009, 01:07:03 AM »
The parameters for SETBAUD must be entered in Hexadecimal form. For  for 19200,8,2,n, enter:

   SETBAUD 3, &H14


Email: support@triplc.com
Tel: 1-877-TRI-PLCS

philipjoseph

  • Jr. Member
  • Posts: 57
    • View Profile
Re:Modbus RTU
« Reply #6 on: January 14, 2009, 09:03:31 AM »
THANKS,
PLC IS WORKING LIKE A GEM, IT IS READING AND WRITING THE PARAMETER FROM/TO THE FREQUENCY DRIVE AS NEEDED.

PHILIP
Philip.