Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Productivity 3000 modbus communication problem

I have an Automationdirect P3-550 with a voltage analog input module and a relay output module for testing.

I have a function genetator on the first analog input outputting a sine wave at  0.1HZ to test the refresh response.

I have configured a TCP Modbus object in Lookout.

I am able to switch the discrete output on an off with a switch directed to a contact I made for the output coil (modbus1.000003).

However the analog input display is intermittent between working (slowly ~3updates/sec) and not working.

The analog input is mapped to Modbus registers 300001 & 300002.

 

Here is a synopses of my testing;

1) Inserted expression; Modbus1.300001 and it did not work.

2) I created a gauge object for Modbus1.300001 and neither worked.

2) I changed the gauge to Modbus1.300002 and the expression started working.

3) I created a hypertrend and included a trace for Modbus1.300001 and it did not work.

4) If I changed the other two to to a different number like Modbus1.300002 the hypertrend will work.

5) I deleted everything and started over and I could not get any ONE thing to work.

6) If I have JUST an expression, when I change from Modbus1.300002 to Modbus1.300001 it will show a snapshot of the value.

7) Now I can get the hypertrend to work if I have an expression and change it from Modbus1.300001 to Modbus1.300002.

 

Its like I need to jump start communication by making a change.

 

I was going to try the Modbus serial driver as I believe it will be much faster but this fancy new processor has a RJ12 RS-232 connection.

AD does not offer a RJ12 to DB9 and I can't find one online.

What the heck -- I have to make my own darn cable.

 

I need to walk away nowSmiley Mad

 

0 Kudos
Message 1 of 16
(10,206 Views)

You can make a log file on the Modbus communication. Select Option->Modbus Ethernet Option. Enable it and add a file path. The Modbus log file will tell us if it polls the slave at expected rate, and if it gets the expected data every time.

Ryan Shi
National Instruments
0 Kudos
Message 2 of 16
(10,180 Views)

Ryan,

 

I am attaching  the Modbus log file with regard to the Modbus TCP problem.

 

However, I expect to use a serial interface with a dedicated PC to this PAC as I want my poll rate to be as fast as possible.

Yesterday I made a RS-232 cable and created a test panel with Lookout 6.2 and a Modbus serial object.

This does not work at all, I get the red "x" on the test expression and contact.

The RXD, TXD and RTS on the P3-550 flash momentarily every five seconds or so when I start the application.

I will be contacting Automationdirect support shortly as I need to move forward with this installation.

 

Thank you for your support, you have always come up with the answers for my problems in the past.

 

John B

 

 

0 Kudos
Message 3 of 16
(10,173 Views)

The Modbus driver polls the device once every second. From 11:29:29 to 11:29:39, it reads the register without any problem. The data should be updating every second.

 

From 11:29:40, it starts to write coil. The writing is also correct.

 

But the problem is that the reading becomes bad from 11:29:40 to 11:29:58. Look at below codes

11:29:39.7 - Modbus1 ->
[00][75][00][00][00][06][01][04][00][00][00][02]
11:29:39.7 - Modbus1 <-
[00][75][00][00][00][07][01][04][04][1D][B8][00][00]
11:29:40.7 - Modbus1 ->
[00][76][00][00][00][06][01][04][00][00][00][01]
11:29:40.7 - Modbus1 <-
[00][76][00][00][00][03][01][84][02]

 

[04][00][00][00][02] means to read 2 registers from address 0.

[04][00][00][00][01] means to read 1 register from address 0.

 

[04][04][1D][B8][00][00] is good response

[84][02] means error

 

I don't think it should get error on reading one register. Just from the log file, I think the problem is in the slave device.

 

I guess you removed register 30002 in Lookout at 11:29:40, so it just read the 30001. When it read both 30001 and 30002, the modbus used one command to read them together. It was good. But when it just read 30001, it got error. It looks like the slave device doesn't allow reading 30001 individually.

At 11:29:58, I guess you added the 30002 in lookout again, and the response became good.

 

Ryan Shi
National Instruments
0 Kudos
Message 4 of 16
(10,148 Views)

Ryan,

 

I gave up on the ModbusTCP for this processor.

However, I want to get the ModbusRTU to work with my 6.5.

I have had tech support from Automation Direct and they don't have a problem with their version 4.x of Lookout communicating via serial.

Do you know what this means; "Garbled communication response from Modbus secondary(9):Incorrect secondary response"

 

Here is a snippet of email with AD;

Hi David,

I just got the PAC back from my colleague and he kind of has something working using the "Modbusslave" driver in Lookout 6.5.

He put modbus read and write rungs in the processor.
This is different -- he has to do remote URL in Lookout but it is working.

I had done exactly what you had suggested when I first set up this processor over a month ago.

I had a single rung with a contact connected to an output.
This worked fine with ModbusTCP for testing the output but then I ran into all the problem with reading the analog input.

I want to use a dedicated fast link with the serial but when use a plain modbus serial driver in Lookout, I get the "red X" on an expression.

The Lookout alarm reads; "Garbled communication response from Modbus secondary(9):Incorrect secondary response".
I have the com ports set up to match.

I bought a FA-ISOCON that I was going to try tomorrow with the RS 485 port.


I am on a two week evaluation extension  from AD as I bought this system August 10.


Could you download Lookout 6.5 and try it?

It has a 30 day eval.

Thanks,

John B

On 9/9/2010 1:49 PM, techbox@Automationdirect.com wrote:

If you are talking to a P3000 with Lookout, load a simple one rung ladder program containing a normally open contact going to an output. Download this ladder to the PAC and make sure it is in run. In the tag name database assign those two tags a Modbus address. Now in Lookout assign an object and make the connections to these two objects. Do they function correctly? No other ladder code is required in the PAC to allow this functionality. I have the same thing here set up and works fine with no issues.

 

Thanks,

David Bark
Technical Support Team
AutomationDirect.com

 

 

Thanks,

John B


 

0 Kudos
Message 5 of 16
(10,023 Views)

Ryan,

 

Automationdirect advised me to contact  lookout.support@ni.com

I did so but I get an automated reply that sends me to a NI web page and when I sign in it shows that I don't have a service program.

I would be willing to buy this but I have to send this processor back to AD by Friday.

 

I am prepared to give up on the serial communication with the P3000 and just go back to the tried and true DL205 K-sequence communication protocal that worked with my older versions of Lookout.

I see that 6.5 has the DL205 driver now as I used to have to buy that from AD.

 

If you have idea what this alarm means; "Garbled communication response from Modbus secondary(9):Incorrect secondary response"

I might be able to understand the P3000 communication problem.

 

Thank you,

John B

0 Kudos
Message 6 of 16
(10,008 Views)

The Garbled response just means incorrect response which cannot be understood by lookout. It doesn't tell us why.

You can try to increase the Receive Gap of the serial communication. In Lookout, select Option->Serial port, there is a parameter for each port called "Receive Gap". Sometimes if the receive gap is not enough, lookout modbus may get imcomplete response data. Increase it to 50 or 100.

 

Could you give me the serial log file of the modbus serial communication?

Ryan Shi
National Instruments
0 Kudos
Message 7 of 16
(10,001 Views)

Hello Ryan,

 

The receive gap did not fix it.

The Automationdirect support say that it works fine with the Lookout 4.5 presumably with the default settings.

 

I had a colleague consult on this and he came up with a way that used the modbusslave driver he had to add rungs in the processor for modbus reads and writes and had to use remote url connections for objects in Lookout.

 

I just upgraded to Lookout 6.5 but I am using 6.2 on this laptop in my home office right now.

I would gladly pay for tech support if need be.

 

Thanks,

John B

 

 

 

Download All
0 Kudos
Message 8 of 16
(9,990 Views)

Hi John,

 

I'm looking at the Modbus log file. It looks like the response from device is incorrect.

For example, we can see below codes everywhere in the log file

12:01:41.3 - Modbus1 -> [01][04][00][00][00][01][31][CA]
12:01:41.6 - Modbus1 <- [02][06][00][00][27][10][93][C5]

[01][04][00][00][00][01][31][CA] is sent by lookout. 01 is the Modbus slave address 1, 04 is the function code to read input registers, 00 00 00 01 means to read one register from address 0. The last two are the error check

 

According to the Modbus protocol specification, the expected response should be like

[01][04][xx][xx]......

 

But in the log file, the reponse is always [02][06][00][00][27][10][93][C5]

The response doesn't follow the Modbus specification. So if the response lookout gets is what the device sent, the problem I think is in the device.

You can ask the AutomationDirect based on the log data.

 

Here I have a Modbus utility for you to test.

Close Lookout first. Run the modscan32, connection->connect, select the port, and the parameters. Select the "04 Input Register", input 1 to Length, and input 1 to Address. You will see the individual register data. Check if it reads the input register correctly. Select Setup->Display Option->Show Traffic. You will see the data communication. Also select Setup->Display Option->Hex.

Give a screenshot of the traffic.

 

If the ModScan32 works, we can compare the traffic of the ModScan32 with the one from Lookout.

If the ModScan32 doesn't work, and shows the similiar incorrect response from device, I believe the problem is in the Modbus slave device.

 

Ryan Shi
National Instruments
0 Kudos
Message 9 of 16
(9,947 Views)

Well this figures.

All this time I have spent on this problem and I borrow another P3 processor from a friend and it works fine.

 

I am now optimizing the serial link for the fastes update.

Since this P3 processor has sub-millisecond scan times, I was hoping to poll at one millisecond.

 

I have the baud set to 115,200 and it does not seem to change my response changing the poll rate from 0:00.01 to 0:00.001.

I expect that the latter is not a valid setting.

Is 10ms the fastest I can poll?

 

I can live with that, I am just trying the get the most from this hardware.

0 Kudos
Message 10 of 16
(9,938 Views)