Multiple modbus messages with a Twido

N

Thread Starter

Natasha

I'm trying to establish communication between a Twido working as a master and two generic Modbus devices working as slaves, but I have problems using the EXCHx and MSGx functions.

I can only send the first message to the first Modbus device using the EXCHx function. After this, the value of MSGx.D never goes back to one and so the next message using another EXCHx function can’t be sent. It keeps sending the first message and receiving an answer from the same slave over and over again. I configured it in the same way it’s described in the TwidoSuite V2.0 Programming Software Online Help in the in the description of the Exchange Control Function Block (%MSGx) – Transmission of Several Successive Messages.

Can anyone please send an example in wich a Twido acts as a master and sends multiple messages to slaves?

My email is nalonso @ lsi. com. ve

Thanks in advance.

Natasha
 
G

Gilio Gestri

I have a program that is working. I wanted to send it to you but your mail is incorrect. If you are interested I could send it to you.

Best regards,

Gilio Gestri
Tritec
Bolivia, South America
 
A
Hello,

I have the same problem described by Natasha, could you send me the Twido example? I am trying to use the rs485 port as communication port.

Thank you.

Aida Parada
 
I
Hi, this is iman rozati.

I have a problem with connecting between Twido and Modbus system too. Please send me your program. Thanks very much.

Best regards,
IMAN
 
hi golio,
Can you send me the sample program.
Im using TWD NAC 485T port to communicate with generic modbus slaves.
Thanks in advance,
kb
 
Gillio,

i have the same issue. i am trying to talk to a remote telemechanique plc through modbus. i was wondering if you have the same sample program or just to get an idea

Best regards,
sam ilio
australia
 
G

Goran Vuckovic

Below is example that copies 3 words from slave 1 to same addresses at slave 2. Take a look at bit %M50 which is responsible for good multiple sending.

SECTION 1
(*SECTTITLE:READING 3 WORDS FROM SLAVE 1 (REGISTERS 0000,0001,0002) TO SLAVE 2*)
(*SECTCOMMENT:*)
LD 1
[ %MW100 := 16#0106 ]
LD 1
[ %MW101 := 16#0300 ]
(* SLAVE NUMBER, FUNCTION CODE *)
LD 1
[ %MW102 := 16#0106 ]
(* ADRESS *)
(* STARTING REGISTER *)
LD 1
[ %MW103 := 16#0000 ]
(* NUMBER OF WORDS *)
(* NUMBER OF WORDS TO READ *)
LD 1
[ %MW104 := 16#0003 ]
LD %MSG2.D
[ EXCH2 %MW100:10 ]
S %M50
(* WRITING 3 WORDS FROM SLAVE 2 (REGISTERS 0000,0001,0002) *)
(* LSB= (8+(2*NUMBER OF WORDS TO SEND)) *)
LD 1
[ %MW200 := 16#010E ]
LD 1
[ %MW201 := 16#0007 ]
(* MSB=SLAVE NUMBER, LSB=FUNCTION CODE *)
LD 1
[ %MW202 := 16#0216 ]
(* REGISTER *)
(* STARTING REGISTER *)
LD 1
[ %MW203 := 16#0000 ]
(* NUMBER OF WORDS *)
(* NUMBER OF WORDS TO WRITE *)
LD 1
[ %MW204 := 16#0003 ]
(* 1ST WORD (COPY FROM SLAVE 1) *)
LD 1
[ %MW205 := %MW208 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW206 := %MW209 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW207 := %MW210 ]
LD %MSG2.D
AND %M50
[ EXCH2 %MW200:10 ]
R %M50

Goran Vuckovic
Kinetic d.o.o.
Serbia
[email protected]
 
G

Goran Vuckovic

To reply to myself. I made an error, because I wrote directly.

Instead of:
-----------------
(* 1ST WORD (COPY FROM SLAVE 1) *)
LD 1
[ %MW205 := %MW208 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW206 := %MW209 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW207 := %MW210 ]
------------
should be:
------------
(* 1ST WORD (COPY FROM SLAVE 1) *)
LD 1
[ %MW205 := %MW108 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW206 := %MW109 ]
(* NUMBER OF WORDS *)
LD 1
[ %MW207 := %MW110]
--------
 
Top