Hello Guest it is January 22, 2022, 10:11:36 AM

Author Topic: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D  (Read 18325 times)

0 Members and 1 Guest are viewing this topic.

CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« on: January 16, 2009, 02:44:19 PM »
I am trying to interface a Teco SG2-20VR-D (user manual here: http://www.bb-elec.com/bb-elec/literature/manuals/SG2PLR_UserManual_0707m.pdf and modbus manual here: http://www.bb-elec.com/bb-elec/literature/manuals/SG2_V-typeModbusProtocol_0807.pdf) with Mach3. 

Here is what I've done so far:
*  Configured the unit to have slave address "02" using the "LAD Version 1.9" using the RS-232 interface (separate from 485)
*  Installed 120ohm resistors on the 485 line
*  Configured a USB to 485 adapter to COM6
*  Under the "Modbus Confugration" screen, Port Num: 6, Baud Rate: 38400  8-2-N, Do NOT use RTS for transmit, Timout of 1500ms
*  Click the "Test Modbus" button
*  Port Num: 6 and Baud Rate: 38400, Slave Addr: 2, Start: 100 (hex), Num Regs:1, input registers
*  Click "Open" and it responds "No error"

Here are my questions:
*  Why is there no option for stop, parity and data bits on the "ModBus Serial Control Monitor" page?
*  Why would you need to re-enter Port Number and Baud Rate again on the monitor page if it's on the Configuration page?
*  What does the slider bar under Discrete Input(s) do?
*  What is occuring when you click "Report Slave ID" and "Read Excp Stat" buttons?  When clicking "Report Slave ID" mach3 returns "receive timeout".
*  Why do I get "CRC Error" when I attempt to read?
*  Is there a difference between slave address "1" and "01"?
*  My PLC uses RTU, not ASCII - is Mach3 using RTU or ASCII?  Is it configurable?
*  Is there any simple way to peek at the data on the 485 serial line?

On a side note... I've watched the modbus videos and read everything I could find on the mach site with the word "modbus".

Thanks!
Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #1 on: January 17, 2009, 09:54:09 PM »
Dmoore,

I scanned thru the pdf doc on the SG2-20VR-D on controller and what I see is the modbus is used to communicate between the base and expation I/O units only
because the base unit is a master and the expation units are slave with mach and modbus mach3 has to be the master so I don't think that it can be done thru mach


Adam
Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #2 on: January 17, 2009, 10:01:25 PM »
Dmoore,
did you get the SG2-MODBUS communications module for communicating modbus
also what are you using for the USB converter
Adam
Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #3 on: January 20, 2009, 07:03:52 PM »
did you get the SG2-MODBUS communications module for communicating modbus
also what are you using for the USB converter

I have so far tried three different USB to 485 converters - the current one is a $160 unit from B&B Electronics - if theirs doesn't work I'd really be suprised.

I scanned thru the pdf doc on the SG2-20VR-D on controller and what I see is the modbus is used to communicate between the base and expation I/O units only
because the base unit is a master and the expation units are slave with mach and modbus mach3 has to be the master so I don't think that it can be done thru mach

Can you tell me where in the doc's you read that the PLC is a master?  On the first page of the documentation I linked (the MODBUS protocol one), it shows a diagram with the "controller" PLC/ HMI or PC) and then shows the "SG2" (the PLC in question) as the slave.  It even says in the first line "SG2 series PLC can be communication controlled by the PC or other controller with the communication protocol, Modbus RTU Mode, RS485".  So I'm pretty sure that Mach3 as the master should have no problem obtaining data from the PLC.  Any thoughs?

Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #4 on: January 20, 2009, 08:40:19 PM »
I am trying to interface a Teco SG2-20VR-D (user manual here: http://www.bb-elec.com/bb-elec/literature/manuals/SG2PLR_UserManual_0707m.pdf and modbus manual here: http://www.bb-elec.com/bb-elec/literature/manuals/SG2_V-typeModbusProtocol_0807.pdf) with Mach3. 

Here is what I've done so far:
*  Configured the unit to have slave address "02" using the "LAD Version 1.9" using the RS-232 interface (separate from 485)
*  Installed 120ohm resistors on the 485 line
*  Configured a USB to 485 adapter to COM6
*  Under the "Modbus Confugration" screen, Port Num: 6, Baud Rate: 38400  8-2-N, Do NOT use RTS for transmit, Timout of 1500ms
*  Click the "Test Modbus" button
*  Port Num: 6 and Baud Rate: 38400, Slave Addr: 2, Start: 100 (hex), Num Regs:1, input registers
*  Click "Open" and it responds "No error"

Here are my questions:
*  Why is there no option for stop, parity and data bits on the "ModBus Serial Control Monitor" page?
*  Why would you need to re-enter Port Number and Baud Rate again on the monitor page if it's on the Configuration page?
*  What does the slider bar under Discrete Input(s) do?
*  What is occuring when you click "Report Slave ID" and "Read Excp Stat" buttons?  When clicking "Report Slave ID" mach3 returns "receive timeout".
*  Why do I get "CRC Error" when I attempt to read?
*  Is there a difference between slave address "1" and "01"?
*  My PLC uses RTU, not ASCII - is Mach3 using RTU or ASCII?  Is it configurable?
*  Is there any simple way to peek at the data on the 485 serial line?

On a side note... I've watched the modbus videos and read everything I could find on the mach site with the word "modbus".

Thanks!


Hi,

The answer to your questions;

*  Why is there no option for stop, parity and data bits on the "ModBus Serial Control Monitor" page?
- It is on the previous setup page.

*  Why would you need to re-enter Port Number and Baud Rate again on the monitor page if it's on the Configuration page?
- Decause that's the way it is. :) The page is probably copied from an appication supplied by the Modbus library provider,

*  What does the slider bar under Discrete Input(s) do?
- It allows you to continuously read the data, instad of having to press the read button. The further to the right it is the fast uit reads.

*  What is occuring when you click "Report Slave ID" and "Read Excp Stat" buttons?  When clicking "Report Slave ID" mach3 returns "receive timeout".
- It is sending the Modbus command Report Slave ID. Your device does not implement it, so it does not respond, hence the timeout.

*  Why do I get "CRC Error" when I attempt to read?
- Excellent question. This is the cause of your problem most likely.

*  Is there a difference between slave address "1" and "01"?
- No.

*  My PLC uses RTU, not ASCII - is Mach3 using RTU or ASCII?  Is it configurable?
- Mach is only RTU. Does not do ASCII

*  Is there any simple way to peek at the data on the 485 serial line?
- Not really. What you could do is download the trial version of Modbus Poll and try to use that to talk to your devicce. It can display what is being received and may help in solving your problem.

Cheers,

Peter.



----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #5 on: January 20, 2009, 11:05:23 PM »
Cheers,

Peter.
Peter -

Thank you very much for your information - it's been a great help!

What you need to know about Modbus and Mach3
« Reply #6 on: January 21, 2009, 04:30:13 PM »
I finally got MODBUS working with Mach3.  Listed below are some of my tips for things that may not be obious if you are new to ModBus:

* First, understand what a bit, byte and word are:  http://en.kioskea.net/contents/base/binaire.php3
* Second, download ModScan32 and get it working BEFORE you work with Mach3.  ModScan32 allows you to see the actual input and output coming from the mobus device.  It can be found in a demo version here:  http://www.win-tech.com/html/modscan32.htm
* Third, within ModScan32, know that "Address" is decimal, so 0259 is 103 in hex - enter your address in decimal within ModScan32.  This is also true for length which is in bytes.
* Be careful to read your modbus device's instructions - you will be required to only request a certain amount of data from a given functiion code (say, 01 or 03) - if you get it wrong, the data will not be returned (or was the case for me)
* I like Mach3 - a great program but there are some really weird UI things that just don't always make sense.  This applies to modbus also.  When you are in the "Modbus Serial Control Monitor", you have to re-enter the com port and baud rate (for reasons no one seems to know).  Now, you see that "format" hex/decimal option?  Has nothing to do with the slave/start/number of registers you are pulling - that is ALL entered in decimal, even if you have hex selected as the format.  The format radio button is only for the output that is returned.  Know that "Holding Registers" is really modbus function code 03.

Some specific information about the Teco SG2 unit:
* You NEED to get the serial cable - the unit can not be programmed via the MODBUS
* I've not yet found a way, out of the box, to change the baud and control, so make sure everything you intend to use can talk 38,400-n-8-2.
* Under the SG2 programming software/Operation menu bar/Module system set - The "Current ID" is the modbus slave ID.  That "remote I/O" option with None/master/slave?  Yea... it can be a slave even when it's set as "none" which is it's default setting.  Better yet, set it to Slave to just be sure.  Also, if you don't have any add-on modules stuck in the side of the SG2 - I/O Num should be 0.  And... make sure you are connected over serial when you read all these settings....

Best of luck!

Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #7 on: January 21, 2009, 05:28:53 PM »
Hi Dave,

I'm glad you finally got it working.

Cheers,

Peter.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: CRC Error with Modbus Test on RS485 against a Teco SG2-20VR-D
« Reply #8 on: April 30, 2010, 04:09:12 PM »
hi  Dave &  peter
i'm working on Teco Modbus...
I tried pull out data from third party Modbus data- Not succesfull.
Happy that u got things right with this earlier

I want to pull the plc data to a hmi(Proface or Ge panels) , Where TECO should be slave.
Can u plz guide me in the address mapping (40001 blah blah  etc) i dont find the manuals to convert DR to 40001 series at all..

i have to complete this by sunday..

help me out plz


And is it a must to use termination resistors een if we use only 1-1 connection in rs-485??
Thanks
Saran
« Last Edit: April 30, 2010, 04:13:16 PM by saran_ic »