m340 modbus

Raptor666

Member
Join Date
Feb 2010
Location
Gorinchem
Posts
5
I am trying to connect a m340 p34 2020 (modicon) to a CVM power analyzer from circutor. I have red a lot of manuals now but i don't get a flashing serial com light on the m340. So no communication.:(

I configured the serial com port of the plc as master
19k2
modbus rtu and 1 stop bit.
The cable I use is 2 wire rs485

In the program i use the read_var function and the adress function. I gave the slave adress 2.
In the program I made it 0.0.0.2 (string)

May be i forgot something but i don't know what so if anybody can help me it would be most welcome.
 
What you have allready done in plc program?

Do you call read_var block via positive transition-sensing contact and to you also use activity bit as condition before you call block (ex. call block once in a second).

How about Management table/parameters, you have to init all management parameters before you call read_var block. (write zero values to managemet table parameters and after that you can set timeout value and call read_Var block)

If you don't get led to flash, there is something frong in plc code.


I have noticed that sometimes read_var and write_var blocks don't work in Unity, even if all communication parameters are correctly placed/configured. To correct this you have to cut read_var block from ladder program and paste it back, reload plc program and after that communications start to work. Read_var and write_Var blocks can corrupt somehow?

This only happens sometimes, but this have happend to me couple times. This have only happened when I have loaded program first time to plc, online changes don't cause this.

Take a look also to activity bit, it can sometimes remain logical state "1" and if this happens => no communication, if you use activity bit as condition before you call read_var block.

I usally use seperate "sub-program" to reset activity bits.
If activity bit remains it's true state ex. 10-20s => reset activity bit.
(Activity bit should return automatically to false state after timeout elapse, but this don't allways work, so you have take care of this on plc code.)
 
Thank you

Thank you Lare
Those were some prity good pointers.

When i looked online in the T_COM_MB_BMX parameter the cts bit was set to one and the protocol was a 6 for master the rest was zero. In the second integer of the management array was standing a 4.

I didn't reset the management words at start up. I just put the read block there with its variables.
But do I have to reset the management table everytime I'am going to call the read block?
After this I can set the time out values but aren't these set in the hardware?
And you are taking about a activity bit where is that located?

And the most important question of all in what manual I can find this or does schneider have example programmes?
 
Hi!

I reset all management parameters everytime before plc program calls read_var or write_Var block. I have used separate management
parameters to every read/write_var block, but using same management parameters to all read_var block is ok, if you don't call
multiple read_var blocks same time. (I think that you can call up to 8 read or write_var blocks same time, but I call only one
block at time. How many blocks you can call same time depends of hardwire)

Timeout value is also defined on hardware properties like you said, but you can set timeout value to smaller via plc
program/managemet parameters. If you leave timeout value to zero (Most significant byte of third management parameter) => PLC
program uses timeout value from hardware properties (same place, where you can change baudrate, parity etc.)

Activity bit is first bit of first management parameter. (least signifant bit of first parameter). You are right, activity bit
should automatically reseted back to "0" after timeout by read_Var block , but sometimes activity bit remais it's "1" state also
after timeout and communications magically stops, if activity bits are condition to call communication blocks. So I have programmed
separate reset for activity bit. (Force reset)
ex. hardware timeout is 1s, but if activity bit is true for 10s of some reason, which it shouldn't be possible => PLC program
resets activity bit and communication starts again.

Take a look to help files of Unity, if you look read_var help file from communications library, you can see example which is writed
on ST format, you can also use find command: "Example including execution check" and you should find example of using read_var
block... Anyway using read and write block on unity is little bit tricky, I have learned most of this by doing

If you search management parameters from help files, you should find documention, which tells meaning of every management
parameter.

P.s If second management parameter have value 16#0004 it means incorrect destination addrees error
(managemt parameters are mux of two different bytes, least and most signifant byte have different meaning, so you should divide
management parameters to seperate bytes before you look them. Second management is mux of communication report (least
significant byte) and Operation report (most significant byte).
 
Dear friends, I need your help.
Ι have a serious problem on site!

I have two Telemecanique MODICON M340 plc connected through serial modbus communication (master-slave) using the read_var function. Everything seems perfect but after about half a a day of perfect communication, master stops communicating with the slave! Communication freezes and the orange led (Ser com) is off! All I have to do is power off and power on the master plc and everything is ok again.

I don't why is this happening! The only thing I noticed is that in %sw125 of master has the message 16#DEF3 which means index overflows. But which index? I use an index for the NUM,GEST and RECP of read_var. Does it mean one of these or the problem has nothing to do with that? I thank you ALL very much in advance!

Dimitris Athens Greece
 
m340

Isn't it that you are asking too many bytes from the salve?
I also noticed that my activity bit stayed high and then my communication stopped as well. so now i reset my activity bit when i received my data.
Isn't it a possibility to reset youre communication automaticly when you get the error code?
 
Isn't it that you are asking too many bytes from the salve?
I also noticed that my activity bit stayed high and then my communication stopped as well. so now i reset my activity bit when i received my data.
Isn't it a possibility to reset youre communication automaticly when you get the error code?
Dear Raptor thank you very much for your response!Well, to be honest I haven't noticed whether my activity bit stays high the moment that the problem takes place so that's what I will try to notice once I come up with the freeze problem again!@ However you know, I can not succeed to "reset" the communication as you mentioned! I send a pulse and cut it off immediately at the EN of read_var, I set 1 and then 0 the activity bit by myshelf, but the communication does not mean to get "live" again, until I power the master plc off and on :mad:! I will try however to notice the activity bit as you said once more as soon as I get the problem -and try to set in 1 and 0 again by myshelf!- p.s I am not sure whether I have to set zero at all rows of GEST array of read_var every time I get the data and before the new master question takes place?This is something I am not sure about it so I do nothing but leaving the array blank.

Thank you very much again!
 
I have the same problem with an M340. But don't have a record in %SW125. It's blank. The serial communication is working fine, and after a day or two it stops, and the serial led in the CPU stays off, and the counters in the diagnostics are frozen. I get an error code number x07 in the Modbus management file. I tried cancelling the command, stopping and running the CPU again, but nothing. The only way to establish the communication again is powering off and on the CPU. Did you solve that problem?
 
I have the same problem with an M340. But don't have a record in %SW125. It's blank. The serial communication is working fine, and after a day or two it stops, and the serial led in the CPU stays off, and the counters in the diagnostics are frozen. I get an error code number x07 in the Modbus management file. I tried cancelling the command, stopping and running the CPU again, but nothing. The only way to establish the communication again is powering off and on the CPU. Did you solve that problem?

Well, listen. I visited the site a month ago.
First of all I noticed that accidentally I have forgotten to "check" the field in the cpu properties that says "start in run". This may have solved my problem (at least temporarily) as it claims that if a not crucial fault happens and plc stops and has to be rebooted (power on off) then cpu can start in run by itshelf after reboot.
However I'm not sure if this will have solved the problem as I don't know whether both plc's stopped of a crucial fault or not because as I've said I didn't find the cause that made both plc's to stop and I don't have a record in %SW125 in neither plc also.
The only clue I have is that the cable between the 2 plcs (master-slave) was not the one of standards. It was a totally wrong cable with no shield and no twisted running for more than 250m, so I knew from the beginning that this would cause a further communication problem in the future but couldn't imagine that it could make both plcs to stop (if this is the cause anyway). Furthermore this is not my own problem. Although I made both plc's run again, however I now have a problem with each one's comm port. Neither master's or slave's port communicates locally and individually with modbus anymore(I tried even with a blank project and with my laptop as a master asking the slave plc or the other way round with a blank project and my laptop as a slave being asked from the master plc)!!!:mad: So, I can't understand if the wrong cable did cause the plc to stop, but also destroyed the comm ports!! It is something I have to discover and make a further survey! For the moment I will change both cpu's with new ones and ask of the cable replacement with a new one of specific standards.
 
Modicon M340 to IGSS

Hello,
Regarding the Modicon M340 disscusion, I am having some problems regarding a BMX P34 1000 processor(version 1). I am trying to connect it to IGSS. Tje isue is the connection cable.
I would like to mention that I am using the "Modicon Modbus protocol driver" in IGSS, which requires a serial cable for the connection (RS232 point to point electrical interface).
Firstly, I am unable to select the RS232 connection in Unity Pro, only RS485. I do not understand why. My first guess is that I am forgetting something...
This wouldn't be a big problem. I am thinking to use a RS485 serial cable, and then connect it to IGSS through a RS232-RS485 converter....So my second problem is that I cannot find the right configuration for a RS485 serial cable...
Could somebody give me a few tips?
 
M340 Serial Communication usin NOM module

Hi,
The Serial link LED of com0 and com1 on NOM module flashes only if the configuration is correct and PLC is generating queries for slave device. Even if the communication cables are disconnected you should see this indication on the module.
In case the communication does not start from PLC, make sure the READ_VAR block management parameters are defined correctly and also the multiple READ_VAR block in case of multiple slave are called or enabled one after the other.
Diagnostic information can be found in Management table >> operation report.
 
Rs485 cable you just use pin 4 and 5 on the rj45 side (M340 side).

Also you are probably trying to change the port config when you are online. You have to change the port settings in off-line mode to change to rs232
 
Old thread alert

Hopefully OP get it working allready on year 2010 ;)

Vlad, it is maybe useful to start complety new thread
 

Similar Topics

I have 9 field devices, three METSEPM5110 power meters and six ACE949-2 rs285 interface modules. I want to read this Modbus rtu data through rs485...
Replies
8
Views
269
I'm using M340 (Schneider Electric) as modbus master. It works fine but if there is a disconnection with the slave, it stops working even after...
Replies
2
Views
382
Hello all. I am trying to read out the values from a Carlo Gavazzi EM340 energy analyzer via Modbus communication. The S7-1200 PLC has the CB1241...
Replies
29
Views
3,638
Hello, this is a message for specialists in Schneider, I am trying to establish communication in modbus tcp between a schneider M340 (P3420302)...
Replies
2
Views
1,574
Hi, I hope everyone's week is going great. I have ADAM-6217 Analogue module which supports Modbus TCP and I am trying to get the AI values of the...
Replies
2
Views
1,610
Back
Top Bottom