Internet PLC Forum
General => Technical support => Topic started by: BC SYSTEMS on August 31, 2006, 07:19:22 AM
-
Hi,
I'm using the following code to read some Modbus ASCII data no problems
READMB2 3, 5, 101, DM[3],4
When I change the code to Modbus RTU I get no comms
READMB2 13, 5, 101, DM[3],4
I'm assuming that Comm 13 is COM3 RTU?
I'm using Wintech's modsim32, which works fine when configured as ASCII protocol but when I change to RTU, I get no data.
I use the setbaud function on a first scan
SETBAUD 3, &h03 ' SET COMM 3 RS485 8,1,N 9600
I would like to use standard RTU, as this is the most commonly used protocol in our control panels
Marcus
-
READMB2 3, xx, xx,xx,xx uses MODBUS ASCII to read from slave. If it works, it means your slave is using MODBUS ASCII.
We are not familiar with MODSIM. Is it a modbus SLAVE emulator? If you define it as MODBUS RTU slave, then you should be able to use READMB2 13,xx,xx,xx,xx to read from the modbus slave. It is probably a setting issues between the PLC and the slave. Continue to play around until you get all the settings correct and it should work.
-
Hi,
yes it is a slave emulator (www.win-tech.com).
The only settings are via a "tick box" wait for DTR from master, and wait for CTS from master. each having a adjustable time delay (ms)?
I use the same program without the boxes ticked for the READMB2 3 command i.e. com3 ASCII with no problems?!?!
Do I need the CTS & / or the DTR for Modbus RTU from the T100?
Marcus
-
T100MD+ PLC don't use RTS/CTS at all. Is there a setting for the protocol type to determine whether the emulator is using RTU or ASCII protocol mode? The emulator must be an RTU slave in order for READMB2 13,xx,xx,xx,xx to work.
-
Hi,
Yes. when I select ASCII - no problems. when I select RTU, I get no comms?
Can you recommend a slave emulator?
Marcus
-
We don't use MODBUS slave simulator so I don't know of any I can recommend. The best way is to use a true MODBUS RTU device to test. You can use another T100MD+ PLC as modbus slave if you don't have other RTU devices on hand.
Win-Tech also made Modscan program which is the MODBUS master program (both ASCII and RTU are supported). We tested Modscan and works well with T100MD+as RTU slave.
-
Hi,
I also use Modscan for testing most slave modbus devices.
used this on the T100 to look at the data tables in RTU no problem. I just can't get it to work as a master in RTU -ARHHHH.
The quest continues.....
-
We have quite a number of users using the T100MD+ as MODBUS RTU master to talk to other devices (e.g. energy meter, M-70xx DAQ devices) so the T100MD+ has no problem acting as RTU master.
Did you try READMODBUS and WRITEMODBUS in RTU mode? These two commands work on one register at a time.
-
Hi,
I tried this string with no luck.
DM[3] = READMODBUS (13, 5, 101) COM3 RTU
I tried this string and it worked straight away!!!!!!
DM[3] = READMODBUS (3, 5, 101) COM3 ASCII !!
I think need to find a device.
Marcus
-
Hi,
I tried another RTU simulator with no luck
http://www.codeguru.com/dbfiles/get_file/mod_RSsimEXE.zip?id=5401&lbl=MOD_RSSIMEXE_ZIP&ds=20060825
Marcus