Twidosuite moving words from PLC to PLC

jechlu

Member
Join Date
Feb 2010
Location
Atlantic Provinces
Posts
23
Hi I'm currently trying to figure out how to send words from one plc to another.

the command:

C_RDNW_ADDR1 X := MW
C_RDNW_X X2

What im trying to figure out is how does the plc know who its communicating with? I will only be using two plcs that are ethernet radio linked together.

here's an example from a old program my boss had. He is on vacation so I can't ask him. I program in Ladder Logic.


program on plc #2
-[C_wrnw_addr1_2 := 200]
[%MW1197 := 200]

-[C_WRNW 2 10]


this writes to mw200 and the other 9 next words? on a radio linked plc #1


This program has three radio linked plcs Now how does the code reference the proper plc?

Hope you can understand what Im saying
 
And the most important thing before anyone can answer, provide:

Manufacturer: "insert here"
Model: "insert here"
Software: "insert here"
Transportationprotocol: "insert here"
etc.
 
On twido PLC you can use two methods for modbus master communication.

First method is that you use so called com-macros (on example which you writed, this is also easier). If you use comm macros, you don't need to take care of modbus query syntaces, because comm macro will do it automatically on plc program.


Second method is that you write every command to plc program via operate blocks. If you use this method, you need take care of bunch of parameters, modbus query function, how many bytes will be transferred an so on...



Com macro is lot of easier to use than second method. Com macros can configured on plc program if you doubleclick com macro

ex.

C_RDNW_ADDR1 3 := %MW200
C_RDNW3 48

means use of com macro number 3. Read N words starting of address %MW200 (from slave which is configured on comm macro)

Second line calls com macro3 and 48 number tells to com macro read 48 words from slave.

If you want see real code for comm macro, select first list editor and after that from tools ->Display real code equivalent fo com macros..


ex. code for
C_RDNW_ADDR1 3 := %MW200
C_RDNW3 48




6 (* -- READ N WORDS FUNCTION -- *)
7 LD %MSG1.D
8 [ %MW400 := 16#0106 ]
9 [ %MW401 := 16#0300 ]
10 [ %MW402 := 1 ]
11 [ %MW402 := SHL( %MW402, 8 ) ]
12 [ %MW402 := %MW402 + 3 ]
13 [ %MW403 := %MW200]
14 [ %MW404 := 55 - 7 ]
15 [ EXCH1 %MW400:55 ]




line8 = Exchange command number and length send 6 words (modbus query lenght for reading multiple words)
line9 = Reception offset
Line10 = Slave number (slave = 1)
Line11..12 = Shift left and adding of 3 => %MW402 =16#0103 slave number and modbus function 3 (read multiple words)
Line13 = Starting address (Address of first word to be read on slave plc)
Line14 = Transmission lenght
Line15 = Exch1 inscruction (Use port1 to communication, %MW400..%MW454 is used for this command. (Variable %MW407 has value of first readed word (slave's word %MW200 value, %MW454 has value of slave plc memory address %MW248
variables %mw400..%MW406 is used for modbus query)



Same for write multiple words:


C_WRNW_ADDR1_3 := %MW100
C_WRNW 3 48

= Write 48 variables to slave which is configured on com macro number3. First memory address were to write is %MW100 on slave plc.


Real code for this on plc is :


20 (* -- WRITE N WORDS FUNCTION -- *)
21 LD %MSG1.D
22 [ %MW604 := 57 - 9 ]
23 [ %MW605 := %MW604 * 2 ]
24 [ %MW600 := 1 ]
25 [ %MW600 := SHL( %MW600, 8 ) ]
26 [ %MW600 := %MW600 + %MW605 ]
27 [ %MW600 := %MW600 + 8 ]
28 [ %MW601 := 16#0007 ]
29 [ %MW602 := 1 ]
30 [ %MW602 := SHL( %MW602, 8 ) ]
31 [ %MW602 := %MW602 + 16 ]
32 [ %MW603 := %MW100
33 [ EXCH1 %MW600:57 ]


Line 22 = Lenght in words
Line 23 =Lenght on bytes (allways words*2)
line 24...27 = Send command and calculation of total bytes for send = 48 mw*2 +8 bytes for query =>%MW600 =16#0100 + 104 =16#0168

Line28 =transmit offset
Line29..31 = slave 1 and modbus function 16 write multiple words => %MW602=16#0110 (dec 16 = hex 10)
line33 = %MW100= Address of first word to write on slave plc
line34 echance 1 command = send via port1...

master plc uses now %MW600..%MW605 for modbus query, %MW606... is used for writing values to slave plc.


so this is pretty easy ;)

take a look to twido's help files, search exch3 instruction and comm macros...

also http://www.global-download.schneide...on?OpenAgent&L=EN&App=Schneider&p=533&c=69,98#

and S1035 example
 
PLS, I need help. I am using a twido PLC
Manufacturer: "Telemecanique"
Model: "Twido TWDLCAE40DRF"
Software: "Twidosuite V 2.20.11"
Transportationprotocol: "Ethernet Modbus/ TCP"
I want to read the Current value of Power Meter PM750 through the modbus using the PLC, how can i do this pls using a micro comms.. i hope u understand what i mean.

thanks in advance,
 

Similar Topics

Hi all, I tried to install Twidosuite on windows 10 but after installing i have the registration link which is not working and also i get with...
Replies
0
Views
574
Is there any guys on here that know how to use Schneider electric plc's and twidosuite. When I try to analyze my program I get an error saying...
Replies
5
Views
1,433
I just started using Twidosuite and did a backup on a PLC, just because it's old and to be able to convert the program to whatever (new) PLC there...
Replies
8
Views
2,255
Hi I'm working with twdlmda20drt twido PLC. I can work with the pid but i can't work with autotune, i read the whole instruction sheet but it...
Replies
2
Views
2,481
Hi I'm working with twdlmda20drt and i was wondering if there is a move instruction in twidosuite cause i cant find it and i may need in the...
Replies
6
Views
2,054
Back
Top Bottom