Author Topic: Modbus Problems  (Read 15527 times)

Russ Clifford

  • Guest
Modbus Problems
« on: July 22, 2002, 09:56:54 PM »
Hi

I am attempting to connect a T100MD-888+ to a Taian OP26L LCD screen via modbus

however, if i set the screen as the modbus master, i get no attempt of the screen to communicate wih the PLC... :-/

if i set the screen as a slave, i get the following comunications error codes - 8008 - and - 0008 - has anyone attempted to use modbus to connect similar units?, if so how did you handle the problems?

i am using the RS485 (comm3) port to communicate, and there are no other devices connected.

Thanks

Russ
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Modbus Problems
« Reply #1 on: July 23, 2002, 07:06:33 AM »
Typically a HMI (touch screen display) acts as a master and the PLC acts as slave. The master send command to the slave and wait for a response from the slave. If the master is not sending command out then they may not support the MODBUS master mode. You will have to check back with the manufacturer (Taian) to see if their touch screen support MODBUS master mode. Sometime they may list the driver but could be an option or not yet implemented.

How does the HMI act as slave? Does it mean that the PLC will have to continuously update the screen element on the HMI? If so it is still OK if the touch screen supports MOBDUS function 03 for a read and 06 for a write command (which is what the PLC uses in its READMODBUS and WRITEMODBUS commands, respectively).

You may also want to try out the OMRON C20H driver. It is quite likely that Taian may support this since OMRON is a popular brand in Taiwan.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Russ Clifford

  • Guest
Re: Modbus Problems
« Reply #2 on: July 23, 2002, 08:39:59 PM »
Hi
thanks for the advice... :D

I have attempted the above, the Omron C driver just produces the same communication errors.

is there a command that i need to program into Tbasic in order for the PLC to establish a modbus communications link to the HMI unit on initialisation?
or is this done automatically by the HMI?........ ???

i have never used modbus prior to this project and something which seemed very straight forward is proving to be a little mind-boggling.... :-[

and help or advise is much aprieciated...... :)

Thanks

Russ
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Modbus Problems
« Reply #3 on: July 24, 2002, 07:05:18 AM »
When using protocols such as MODBUS or OMRON it should be totally transparent to the PLC operation. The HMI will send commands to read or write to the I/O or internal memory of the PLC without the need to modify the PLC program at all.  The only TBASIC command that you may need to execute once is the SETBAUD command which let you set the comm port to the same baud rate and format as the HMI if the HMI's comm baud rate and format cannot be changed to match the PLC's default of 38400,8,n,1.

The few most important points about serial communication between two devices are:

1) the correct communication baud rate and format (how data bits, what parity and how many stop bit).

2) the correct cable - there is no universal cable here. It really depend on how the HMI manufacturer wire up their RS232 port. Our T100MD PLC only uses pin 2,3,5 of its comm port. But the HMI may demand that its RTS be tied to its CTS be connected together and its DTR be tied to its DSR.

3) The correct ID address has been defined in the HMI that matches that of the PLC. OMRON default ID is 00. Try to change that and reset the device.

To ensure that that the HMI is sending out correct serial commands, try to connect the HMI serial port to a PC via a null modem cable and run the HyperTerminal on the PC, select "Properties -> Direct to COM1" and define the parameters as 38400, 8 data bit, 1 stop bit, no parity, and none for hardware flow control. If wired correctly the Hyperterminal will display the serial data from the HMI, especially for the OMRON protocol it should be in the form of "@01xxxx...". This also offers a way for you to examine whether the HMI is addressing the correct ID, with the correct baud rate and the correct comm format. If you get garbage then something is wrong.

We have experienced some brand of HMI that even though we changed the baud rate setting on the panel it simply refuses to change without some eloborate reset - it is very annoying. How do we know? We connected to a Hyperterminal and saw that the baud rate never change despite change of the settings on the HMI itself.

Many users have used our PLCs with SCADA packages such as National Instrument Lookout, Wonderware and Intellusion and HMI such as Maple System without trouble. It is a matter of getting to know your HMI well enough to get a successful communication.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Russ Clifford

  • Guest
Re: Modbus Problems
« Reply #4 on: July 24, 2002, 12:22:55 PM »
Hi

Thanks, cracked it...... ;D

all down to the communications as you said.

finally got it working using the Omron C driver, would still like to get my head round ModBus though...leave that for a later date.

again thanks for your help

Cheers
Russ
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Modbus Problems
« Reply #5 on: August 05, 2002, 08:54:49 PM »
We have just received a Taian OP26L HMI unit for evaluation. We have successfully used the MODBUS RTU slave driver to interface to our T100MD+ PLC. In fact it works better then OMRON mode because the OP26L HMI uses an obscure OMRON hostlink command "@01KCXX*" which is not supported by the M-series PLC.

For more details about MODBUS driver for Taian HMI, please download application notes from the following link:

http://www.tri-plc.com/applications/TaianOPS6.zip
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Machinery-Automation Ltd

  • Guest
Re: Modbus Problems
« Reply #6 on: August 08, 2002, 10:55:23 AM »
Hi,

Just recieved your file from ICC in the UK

I have tried the file and this works fine, however i am trying to use an xy graph in the ops6 software which requires a trigger and reset flag to be set. i cannot get the PLC to correctly tell the HMI that this bit is set.

Any thoughts on how to do this?

This a serious head scratcher..

Thanks for any help you can give.

Russ Clifford
Machinery-Automation Limited
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Modbus Problems
« Reply #7 on: August 08, 2002, 12:36:56 PM »
We haven't tested the X-Y graph. Without setting up the full work to test the X-Y graph command, I would like to suggest the following for you to try first:

A trigger flag and a reset flag are most likely internal relay bits. You can define an internal relay as a trigger flag and another internal relay as a reset flag and define their corresponding modbus bit address into the OP26's XY graph position.

You can then use on-line monitoring via RS232 to manually turns on and off the "trigger" relay and the "reset" relay to see their effect on the X-Y graph.

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Machinery Automation Ltd

  • Guest
Re: Modbus Problems
« Reply #8 on: August 08, 2002, 01:51:31 PM »
Hi,

I have tried your sugestion, but the software will only let me set a PLC word as the trigger and reset flag.

It says i need to set the following

in workstation setup i need to give a control block address (PLC Word) of minimum 2 words long

then in the XY Chart, i need to specify which Reset and Trigger flag to use. for that chart.

The Chart is triggered by setting certain BITS of the PLC word.

Trigger flag word bit
BIT 8 -  Reset Flag 1
BIT 9 -  Reset Flag 2
BIT 10 -  Reset Flag 3
BIT 11 -  Reset Flag 4
BIT 12 - Trigger Flag 1
BIT 13 - Trigger Flag 2
BIT 14 - Trigger Flag 3
BIT 15 - Trigger Flag 4

is it possible to set the word bits within the T100 PLC to do this?.

If so, can you help me look into this...i've tried a number of ways to do this, without success.

Thanks for all the help you have given me

Russ Clifford
Machinery- Automation Ltd
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Modbus Problems
« Reply #9 on: August 08, 2002, 02:43:17 PM »
You can specify any DM address as the control block. IN our example we use DM[3991] and DM[3392] as the control block (correspond to MODBUS word address 44991 - add 41000 to any DM index to get the modbus address), and when we change the value of DM[3991] the screen also changes.

In TBASIC you can set or clear any bit position in a DM using the SETBIT and CLRBIT command. E.g:

  setbit DM[3991],8

will set DM[3991] bit position 8 to '1'.

  CLRBIT DM[3991],12

will clear DM[3991] bit position 12 to '0'

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

noopur

  • Guest
Re:Modbus Problems
« Reply #10 on: August 23, 2004, 08:19:51 AM »
plz send me information for HMI for PLC .

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus Problems
« Reply #11 on: August 23, 2004, 08:52:18 AM »
Some information about HMI can be found at:

  http://www.tri-plc.com/dataentry.htm

We actually have application notes for download for some of the HMI models mentioned in the above web page.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS