READ_VAR from TSX premium to M221

JEANST

Member
Join Date
Jun 2015
Location
PARIS
Posts
68
Hello Dear Experts


I have to read 2 words (%MW300 / %MW301) in a M221 plc (TM221ME16R/G) which have a embedded ethernet port.


the reader plc is a TSX premium TSXP572634


i will use a read_var instruction for this and i wonder if the syntax i use is good.


[FONT=ArialRoundedMTforSE_Latin]IF RE(Top_1s) AND NOT TableGestion[0].0 THEN[/FONT]
[FONT=ArialRoundedMTforSE_Latin] READ_VAR(ADDM('Ethernet_1{10.199.14.130}'),'%MW', 300, 4, TableGestion, TableReception);[/FONT]
[FONT=ArialRoundedMTforSE_Latin]END_IF;[/FONT]


I would like to have your opinion about this, because i must go to the customer and i would like to have some background before.


Thanks in advance
 
Nope, addm{ip) won't work on P57 series. It would work on newer M340 and M580 range.



On P57 command is addr.



But, on P57 you can't address ip address directly to command.

This is probably as P57 didn't have ethernet for start on PL7 series and only serial was supported.



For using read_var and write_var blocks and ethernet address you need to address IP address to "virtual" xway address on xway table on PLC, then you can use addr(x.y) for blocks.

You virtual x.y xway address is then pointing pointing to IP addres and this virtual xway address needs also to point outside of normal xway addressing range. It was maybe offset of 100 to stations over normal xway range and was sayed somewhere on manuals. (xway and IP addresses is configured on ethernet card, messaging page)


As it is 2634M series with inbuild ethernet card, you can also use IOscanner. There you can directly put ip addresses and PLC is communication without any code to PLCs.


p.s

P57 with inbuild ethernet supports IOscanner.
Newer M340 PLC supports IOscanner only if seperate ethernet (NOE) card is used.
 
Last edited:
On pretty old Unity 5.0 help files

Connection Configuration Parameters

Correspondence Table

This table is used to:
- list the remote devices for which the local modules wish to open a TCP connection and for transmission (with the module operating in client mode)

- provide correspondence between the X-Way address {network, station} and the IP address


- The network number must be less than or equal to 127.
- The station number is between 0 and 63 for a UNI-TE connection or between 100 and 163 for a Modbus connection.










So offset of 100..163 was for modbus communication with xway addresses. You need to specify



P57 xway address like 0.0, 0.1 or 1.0 or which you want to use.
First one is network number and last is station number

Then specify from same network address group
PLC 1 = network.101 whit IP a.b.c.d
PLC 2 = network.102 whit IP a.b.c.?

on code side

PLC1 comms
Addr{network.101}?? for address.


from ?? part not sure if it needs to be sys or 1.sys or something else like 1.mbs for M221 PLC communication. Pretty many years allready when needed these syntax on P57 series.




p.s

As this is ethernet you can use different management paramters for blocks (and use two different TCP sockets)
or you need to counter which enables only one communication block if you use same management parameters for both PLC communications. (only one TCP socket is open to outside of PLC)
 
Last edited:
Hello Thank you for this complete informations
I give you a liitle feedback in order to help those who can have the same kind of job to do.

you were absolutely right
on the Premium side: instruction is ADDR (ADDM is refused by Control Expert so it's easy to make a choice :)
the communication has running with (1.1xx)SYS
i read that SYS mean "i want to talk to the modbus server" of the station

on the M221 side
in Machine Expert Basic "Configuration tab" below where you set the IP address of the PLC you have a checkbox "activate Modbus server" only check this.

that's true there are many syntaxes depending on the hardware you have on both sides.

Thanks again for your help and have a good day :)
 
Thanks.
This isn't writed anymore at least on 14 and 15 Control expert help files anywhere.
But P57 is allready pretty old PLC platrform so this is only problem on changing or modifing old codes. ;)


M-range PLC is easier on ethernet coms to others PLCs.
 

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
810
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,036
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
161
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
261
Back
Top Bottom