READ_VAR Modicon M340 and PM-5500 Module

rogerkohler

Member
Join Date
Aug 2012
Location
Canada
Posts
4
Hi,

I'm having some issues with the READ_VAR instruction.
I want to read 84 registers in my device (PM-5500) starting at register 3000. I Have already been able to communicate with my device when i had 52 registers configured, but i need some more now. Those registers are consecutive in the device. I have a timeout of 2 seconds in Register [2] of the Gest Table ARRAY[0...3]OF INT. I've removed that 2 seconds once and put the register to 0. I know that if this register is at 0 there is no more timeout applied (rather the one physically of the card), but now it's back to 2.

I get a 16#02 Incorrect response on the Operation Report in the Gest [1] most significant byte. I see my Activity bit Gest[0].0 triggering and i already tried to Cancel the transaction by triggering the bit 1 of the Gest[0].1 . But it doesnt want to get back on track :mad:

I've already read all of the post here on this site and my concern is that the solution seems to be to restart the PLC, but that is not convenient. There has to be another way to make this READ_VAR back to life.

READ_VAR.JPG
 
Welcome to forum

If read_var block works with 52 words but not with 84 then the issue is on device side.

Check from device manual how many consecutive words can be readed with one modbus query.

Adding another read_var is maybe needed.
 
if you use Qmodmaster https://sourceforge.net/projects/qmodmaster/ to request 85 registers from the PM-5500 does it work?

Try a packet capture with wireshark to see what is the difference between what qmodmaster sends to the PM-5500 and what does the M340 send.

did you change the size of the array when the number of inputs changed?

Can you delete the READ_VAR block and put in another one with the same parameters and a new GEST state array and does it work with 52 as NB?

Also see this thread on using READ_VAR, I think it uses a "cancel" block to reset the READ_VAR state: http://www.plctalk.net/qanda/showthread.php?t=81026
 
Last edited:
Thanks for the quick response.

Lare :
It has worked with 52 in the past. I've tried with 84 and it doesn't work. I've retried with 52 after that and it don't work anymore. I've even tried to read only 2 registers after and it doesn't work too. (by changing the array size and the NB).

V0N_hydro :
1)I can't go/connect on the network of the device to diagnostic, it's not close to my area.
2)Yes i've changed the array size to 84 when i asked for 84 register at NB.
3)I've tried to delete the READ_VAR, create a new one, create a new Gest array too and tried with 52 at NB and still nothing , i'm getting the same 16#02 code.
 
You have timeout value of 200ms. What is hardware timeout on hardware settings?p
Software timeout needs to be bigger than timeout on card settings (timeout x repeats)
Also activity bit should be off before calling com block (check with and block and if activity bit is off then call com block)

It is also good practise to zero all management parametres before calling write/read block.
(Dont zero timeout)
 
Last edited:
Lane:
I followed the transaction in the animation table and put the management register to zero right after a transaction (I saw the Activity bit go high (1) then back to low(0)). It doesn't change anything. The activity bit is always at 0 before the block is called again.

I don't know where to look to find the timeout of the card. It's a NOC-401.
I've tried with a value of 50 on the Timeout (5000ms=5s), but no change.

It looks like the card block/halted/lock that connection.. ?

I already have other READ_VAR in this program reading on the CPU Ethernet Port and i have the same 200 ms delay.(See joined pictures).

READ_VAR_3.jpg READ_VAR_2.jpg
 
I just read in the M340 Datasheet, that when reading modbus , you need to substract 1 register to the target register of your device.

That mean instead of reading from register 3000 of the Device, i should read from register 2999.
I've changed the start register of the device on my READ_VAR to 2999 and i get some value now.

I guess that when it was working with 52 as NB, the value of the start registers was 2999. I didn't pay attention to that at the moment.

Thanks for the support guys !! :)
 

Similar Topics

Hi, I am trying to use READ VAR function block in Modicon M251 to read data from 1 unit of Modbus RTU slave. However the READ VAR return error...
Replies
0
Views
798
Hi Guy's, I have fully configured all my reads writes and sequeneced them as per my usual setup. However while configuring my code I found that...
Replies
3
Views
4,014
Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
136
Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
126
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
237
Back
Top Bottom