Getting started with Modbus on a DL06

bluffit

Member
Join Date
Apr 2011
Location
Western Southland
Posts
33
Dear Forum reader,

I'm trying to connect my DirectLogic DL06 via Port 2 (RS485) using Modbus RTU to an RTU that reads PT100 sensors (CIT from Contrel). Attached is the comms manual for this device.

I've written a very simple ladder logic program to test it, but am struggling to see if it's actually working, or to get any data back.

I can step through the program, and see the states of SP116 and SP117 changing. However, I can't seem to specify the address of the slave correctly (the manual says read 8 x 2 byte registers starting from 0x0258 - see CIT manual attached), but I'm not sure how to specify the slave address in the RX command. It doesn't allow me add a K constant or O octal value?

Also, when I attempt to use the high bit of the LD command specifying the number of bytes to be read (i.e. set it to 8016) so I can change the Slave Function to diagnostic, nothing seems to work - i.e. it doesn't toggle the states of SP116 and SP117.

And as for the Master 'V' address to read the results, all I ever see is the first bit set.

Please forgive my lack of knowledge and newness to this field.

Attached are a screen dump of my simple ladder program, and the CIT Comms manual. Any help much appreciated.

ladder.jpg
 

Attachments

  • Communication Protocol CTT IM148-U v0.91.pdf
    163.2 KB · Views: 47
Did you happen to get the zip-link connector that goes on the 15 pin VGA style connector? It does a nice job at breaking the RS485 out into terminals. It's dooable other ways but it gets to be a real pain. Secondary commport setup is OK and all that. Attached is an example of the same type. You usually need to put a inter-message delay (0.100sec perhaps) because of the RS485 two-wire. If you don't the you may have devices staying in transmit and wrecking the next messaqe. Anyhow, see attached.
 
Last edited:
The MWX/MRX commands makes things much simpler. Here is a demonstration of interfacing to a drive but the concepts are similar.

You can enter their Modbus address (x258 = 600 decimal) directly. It's SOOOO much easier. the actual address works out to 40601 (I usually have to add 1 to the vendor's stated address).
 
Last edited:
I've written a very simple ladder logic program to test it, but am struggling to see if it's actually working, or to get any data back.

+ one for the MWX/MRX commands. Also because you are struggling you should set up two counters. One for the SP116 and one for The SP117. Try the example in the 06 manual (pages 4-67 and 4-68).

PS. It's also common to be off by one address when using modbus so keep this in mind.
 
Thanks for this, but I think it is still quite a way over my head.

I added a 100ms delay to the Comms on send, and rewrote the script using the MRX function. In order to access the memory area specified in the CIT manual I had to specify function code 01 and K600 (0x0258)

After stepping through the code, I see the same change in toggle states, but again, nothing is set in the Master memory, or Error memory other than the first bit.

When setting up the COM parameters I realised that it might be thinking that itself (i.e. the DL06) was slave #1 so I tried changing the slave number to 2. But still no joy.

Would be nice just get a bit of a handle on what is going wrong.

With regards to the cable, we had to make our own 2 wire solution so of course this part of the problem - but how do we tell!

Thanks in advance

ladder2.jpg
 
You know I started with this example, and the counters were working. But it seemed too complex as it had RW and RX commands, and they were being repeated - and I still didn't seem to get any data back into my registers!

Basically, I just want to get to Hello World!
 
Ok, thanks. Well, I've set the parameters for RX1 up again as you've recommended:

Port K2
Slave K1
FCode 03
Slave Mem. Addr. 40601
Start Master Mem. VC0
No. Elements 16
Ex, Register V400

This was of course in 584 mode, but we tried both modes (changing the slave memory address appropriately).

Again, same result. the 1s bit is set in the master addresses specified, but that's it. Of course it doesn't help that I'm a hardware phobe!
 
Last edited:
Check the contents of V400 and following. If non-zero then there may be an error indication.

Why are you trying to read a numeric register into a C register? Try something like V2000 instead of VC0.

If using Function 3 try 30601.
 
Last edited:
Thanks everyone for your suggestions. I guess the thing is I'm such a newbie in this field, I could easily be missing something stupid.

I'd be happy to contract someone to take a look at the problem - you could remote desktop in. One hour of an experienced person't time, might save a few weeks of mine!
 
This is a good question. In the Comms port setup for the DL06 it implies the the DL06 itself is slave 1! So I changed the slave address to 2, but exactly the same results. The pesky single first bit being set in both V400 and V2000.
 
I'm wondering if I'm doing something fundamentally wrong. If I step through the program once, should the values in V400 and V2000 be being set, or perhaps they are reset after running?

Also, are there any fail safe higher level debugging tools - i.e. a way of scanning the Modbus network and reporting all slaves - assuming the cable is correct.
 

Similar Topics

Hello all, this is my first time working with a PLC and dealing with hardware, so please have patience with me. I have an electric rod-style...
Replies
21
Views
3,014
Hey Guys, First post here and looking through, there are a lot of people that have different expierences and practices. A little bit of my...
Replies
14
Views
2,028
Hey Guys, I have plenty of experience with AB plcs . What is a good starting point to learn about fanuc robot programming. How to get started? Is...
Replies
5
Views
2,699
Hello guys, the company I work for has always worked with Allen Bradley, except for small applications with Siemens, which we would now like to...
Replies
16
Views
4,691
Hello PLCS.net! I have a CPU315-2PN/DP with a CP343-1 attached to it. What are the latest and greatest software associated with it? How do I...
Replies
17
Views
3,894
Back
Top Bottom