You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 7th, 2010, 10:00 AM   #1
Raptor666
Member
Netherlands

Raptor666 is offline
 
Join Date: Feb 2010
Location: Gorinchem
Posts: 5
m340 modbus

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.
  Reply With Quote
Old February 9th, 2010, 02:45 PM   #2
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,025
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.)
  Reply With Quote
Old February 10th, 2010, 04:29 AM   #3
Raptor666
Member
Netherlands

Raptor666 is offline
 
Join Date: Feb 2010
Location: Gorinchem
Posts: 5
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?
  Reply With Quote
Old February 10th, 2010, 01:50 PM   #4
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,025
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).
  Reply With Quote
Old February 10th, 2010, 02:52 PM   #5
Raptor666
Member
Netherlands

Raptor666 is offline
 
Join Date: Feb 2010
Location: Gorinchem
Posts: 5
Thank you,

Iam going to try this asap
  Reply With Quote
Old July 13th, 2010, 12:42 AM   #6
dimmitrisd
Member
Greece

dimmitrisd is offline
 
Join Date: Nov 2009
Location: Athens-Greece (MSN:dimmitrisd@yahoo.gr)
Posts: 10
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
  Reply With Quote
Old July 13th, 2010, 03:11 PM   #7
Raptor666
Member
Netherlands

Raptor666 is offline
 
Join Date: Feb 2010
Location: Gorinchem
Posts: 5
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?
  Reply With Quote
Old July 13th, 2010, 03:32 PM   #8
dimmitrisd
Member
Greece

dimmitrisd is offline
 
Join Date: Nov 2009
Location: Athens-Greece (MSN:dimmitrisd@yahoo.gr)
Posts: 10
Quote:
Originally Posted by Raptor666 View Post
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 ! 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!
  Reply With Quote
Old September 19th, 2011, 02:23 PM   #9
AleArg
Member
Argentina

AleArg is offline
 
Join Date: Sep 2011
Location: San Nicolas
Posts: 1
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?
  Reply With Quote
Old September 22nd, 2011, 03:40 AM   #10
dimmitrisd
Member
Greece

dimmitrisd is offline
 
Join Date: Nov 2009
Location: Athens-Greece (MSN:dimmitrisd@yahoo.gr)
Posts: 10
Cool

Quote:
Originally Posted by AleArg View Post
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)!!! 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.
  Reply With Quote
Old January 20th, 2015, 04:32 PM   #11
Vlad1990
Member
Romania

Vlad1990 is offline
 
Join Date: Jan 2015
Location: Pitesti
Posts: 3
Question 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?
  Reply With Quote
Old October 1st, 2015, 12:14 AM   #12
manishyg
Member
India

manishyg is offline
 
Join Date: Sep 2015
Location: Mumbai
Posts: 1
Smile 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.
  Reply With Quote
Old October 2nd, 2015, 12:59 AM   #13
chud
Member
South Africa

chud is offline
 
chud's Avatar
 
Join Date: Oct 2007
Location: KALAHARI
Posts: 861
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
  Reply With Quote
Old October 2nd, 2015, 01:19 PM   #14
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,025
Old thread alert

Hopefully OP get it working allready on year 2010

Vlad, it is maybe useful to start complety new thread
  Reply With Quote
Old October 5th, 2015, 12:50 AM   #15
chud
Member
South Africa

chud is offline
 
chud's Avatar
 
Join Date: Oct 2007
Location: KALAHARI
Posts: 861
manishyg Posted In this old thread on the 1st so I was trying to help him
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Modicon M340 Addressing and Modbus Question tonofsteel LIVE PLC Questions And Answers 5 December 12th, 2013 07:42 AM
Can't cancel Modbus master comms on M340 rogerval LIVE PLC Questions And Answers 2 June 29th, 2011 08:15 PM
Modbus RTU Master Comm from M340 northwest_trail LIVE PLC Questions And Answers 1 December 10th, 2008 10:16 AM
Modicon M340 Modbus TCP and Modbus Serial? northwest_trail LIVE PLC Questions And Answers 1 December 3rd, 2008 06:09 AM
Mitsubishi Q Series Modbus TCP module QJ71MT91 set up help req'd... Pocko LIVE PLC Questions And Answers 0 July 30th, 2006 02:45 AM


All times are GMT -5. The time now is 02:05 AM.


.