Modbus communication

S

Thread Starter

sunil

I am trying to communicate with ENERCON CONZERV ENERGY METER EM6434 having RS485 2 wire connection using SCHNEIDER TWIDO PLC and RS485 card inserted in port 2. Energy meter memory words are of float type, so instead of %MW I am using %MF for Modbus program in PLC but with this no communication is happening. Instead if I use %MWs and starting address as 4001, I am getting some response in the reception table, only slave ID and number of bytes to read.

Please guide me to achieve the communication.
 
This is an extract from the manual:

"Single, double length and floating words are stored in the data space in one memory zone. Thus, the floating word %MFi and the double word %MDi correspond to the single length words %MWi and %MWi+1 (the word %MWi containing the least significant bits and the word %MWi+1 the most significant bits of the word %MFi)."

Make sure that when reading %mf0 that you aren't using %mw0 or 1 in your software. I would as a test create a new test program with nothing in it except reading one floating variable just to test.
 
A

aggattapauer

First: you MUST read %MW because of the Modbus protocol.

Second: In the Help of Twidosoft, you will find all explanation about how to configure EXCH2. Search for "Modbus standard request", or in the summary search for software referring guide -> special functions -> communications -> modbus standard request.

Anyway...

LD1
[%MW0;=16#0106] 01 SEND/RECEIVE 06 NUMBER OF BYTES OF THE MODBUS STRING
[%MW1;=16#0300] 03 OFFSET (ANSWER) 00 OFFSET (TRANSMISSION)
[%MW2;=16#0103] 01 SLAVE ADDRESS 03 READING WORDS
[%MW3;=16#0000] 0000 START ADDRESS
[%MW4;=16#0004] 0004 NUMBER OF WORDS TO READ
LD1
AND %MSG2.D
[EXCH2 %MW0:11] FROM MW0 TO MW4 TRANSMISSION + MW5 TO MW10 ANSWER

THE ANSWER WILL BE:
%MW5 = 16#0103 ECHO OF THE FIRST WORD TRANSMITTED
%MW6 = 16#0008 00 BYTE ADDED (OFFSET = 3RD BYTE OF THE ANSWER) 08 NUMBER OF BYTES OF DATA IN THE ANSWER
%MW7 = 16#XXXX FIRST WORD
%MW8 = 16#YYYY SECOND WORD
%MW9 = 16#ZZZZ THIRD WORD
%MW10 = 16#WWWW FOURTH WORD
 
Thanks for your reply. With the above program I am able to get

%MW5 = 16#0303
%MW6 = 16#0008

but no data in %MW7 and above.

In place of ENERCON METER, if I connect another Twido as slave, then I am able to read the data.

I hope you understand the problem and can guide me.
 
OK this work but if this is the only one request to take values from the slave device. if i want to get more values, then what procedure i should follow as if i change the start address then i couldn't get the values exist in the corresponding register.
???
 
Top