M340 Read_Var limitations?

Krauly

Member
Join Date
Oct 2016
Location
Cape Cod
Posts
13
Hello, I am new here. Thanks ahead of time if anyone can help.
I am setting up communication between an M340 (Master) via rs232 serial communications using a "Read_Var" block polling another M340. I can't seem to get more than 4/8 %MW words.

My old "XMIT" block could easily ask for 60+ words

When I ask for 4 it works great, when I increase to 5 it seems to ignore the request and NO data gets transferred
 
Are you sure the 5th address exists on the slave? A tag will have to have that %MW address assigned to it.

Is there an off-by-one situtation where the first register being read is actually the second, and there is no tag configured at the 6th memory address in the slave?

I normally start every modbus slave map with registers
ALWAYS_1
ALWAYS_2
ALWAYS_3

so I can tell when I am off by one

I have used read_var for more than 4 registers so I don't think that is the problem
 
I can change the Start register from 0 to any other number and read the next 4 registers without a problem.

I did notice that the Read_Var block throws a 7 for an error code when reading more than 4!?!

Not sure why
 
Hi Krauly,

What does error 7 mean and what clues does it give you? doesn't make much sense to me given you can change NUM and reads the next consecutive values.

There is a program called Qmodmaster which is great for making sure the slave can respond properly and initially determining if the problem is with the PLC request or the slave capabilities.

what is the timeout period in the management table?

After an unsuccessful read have you used the cancel bit in the management parameters or the cancel block to cancel the exchange?

Are you executing the read_var block using a trigger so it executes for a single scan only or otherwise preventing the execution of the block when the activity bit is high? I think this is how the example in the documentation is programmed

here is a thread with some examples
http://www.plctalk.net/qanda/showthread.php?t=81026

I recently provided essentially those examples to a colleague who modified it and didn't include some parts (cancelling failed exchanges) and then when it didn't work we basically changed the program until it exactly matched the example, and also made a new instance of the READ_VAR block and then away it went.
 
Apparently a #7 Error code has to do with:
16#07 Problem in sending to the destination
or
16#07 Addressing error

Doesn't make sense seeing as long as I only ask for 4 words or less there isn't a problem. Even if I ask for different words, as long as it is 4 or less.

I'm going to try playing with the timing in the NOM module

attachment.php


Read_Var1.jpg
 
Apparently a #7 Error code has to do with:
16#07 Problem in sending to the destination
or
16#07 Addressing error

Doesn't make sense seeing as long as I only ask for 4 words or less there isn't a problem. Even if I ask for different words, as long as it is 4 or less.

I'm going to try playing with the timing in the NOM module

attachment.php

Your RECP range is wrong, you need to move the data into an array, you are trying to write to a bit on a word, should be %MW300[16] if you want an array of 16 words, same with your management words, should be an array of 4

Also are you sure you can even use the NOM with a READ_VAR ?
 
Last edited:
Write/Read blocks can be used with NOM card.

%MW300:16 is also right. 16 words starting from %MW300. So you can now read maximum 16 words form slave.

What is hardwire timeout setting on NOM card. I see that you have programmed timeout 50 on GEST array.
So you need less than this on NOM card (Retries 3*1000ms = 3s for starting.

What is sta-parameters (address)

It shouls be something addm('0.1.NOM_CH.slave_numb')

('Rack.Card.Channel.slave')
 
For erros you need to divide 2nd gest parameter to two bytes.

Low byte is Communication report and High byte operation report.
You have now value 16#07 on %MW4581 so it tells that Operation report have value 16#00 and Communication report 16#07. (Problem in sending to the destination)

This give a clue that sta1-variable have incorrect addressing. If it is string-variable, keep in mind that on defaul it can save only 16 characters. Address can be longer.
 

Similar Topics

Hi All, I need to read some data from a Rockwell 5380 PLC to a schnieder m340 PLC. What hardware will i require for both systems? on the M340...
Replies
12
Views
5,281
hi there! i am trying to read modbus registers in M340 PLC from a Turck BL20 Gateway. I have done this with a Emerson Gateway and everything...
Replies
1
Views
1,949
Hi all, Is it possible to read the amps of a motor from a connected TesysU over Modbus 485 using Unity Pro software?
Replies
2
Views
1,412
Hi everyone, i have a situation with a Modicon M340 PLC. I need to measure an external magnitude with a digital input. I'll be receiving pulses in...
Replies
4
Views
1,820
Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
185
Back
Top Bottom