Programming Modicon M340 modbus TCP

Buscom

Member
Join Date
Jul 2013
Location
paris
Posts
78
Hello,

I am currently working on a project on Modbus TCP communication between a Modicon M340 PLC and an electronic card with a DSP Texas Instruments.

My goal is to establish communication between the card and the Modicon M340.

I've successfully done addressing to a single slave, i.e do the exchange between the M340 (client) and my electronic card (slave).


Now, I must make addressing to several slaves, i.e the exchange between the Modicon M340 and many other electronic components or boards.

How do you think I can do that from a methodological point of view? someone you have an idea please?

thank you
 
Are you using an BMX NOE or BMX NOC card? If so, then IOScanner is pretty straightforward to setup. Otherwise, what are you doing now - READ_ VAR blocks?

Provide some detail and someone should be able to help you.
 
Hello,

thank you for your reply,

In fact, I use the BMX NOE. now, I've managed to read and write in the DSP of my electronic card with the M340 with the function blocks READ / WRITE. but that was the exchange with a single slave. Now, I try to read and write to multiple slaves and I want a help of instruction to do it please
 
Please find attached program section from unity version 6.0 to query multiple TCP slaves from M340 without NOE module. I used this when data is just being displayed on HMI or logged and is not an input to any controls. Very similar for multiple modbus RS485 slaves on the serial port.

I have also attached the M340 modbus serial master logic. I recall it took a long time to find the proper format for the address input to the ADDM block.

for my next project I bought NOE module since the inputs are several kilometres away I have no choice but to read them over ethernet. NOE module is definitely faster and if there is some problem with the communications there is no logic of mine for anybody to question.

note I had to rename the file from .XBD to .txt for some ridiculous reason, so you may have to change the extension back to XBD before importing this program section.
 
Hey!

Take a look in this video (isn´t mine, credits to the author).

He show how to configure the IO scanning.

It´s very easy. Million times easier then use READ VAR / WRITE VAR.

But this fuction just work on BMX NOE and BMX NOC cards. In ETH port of CPU we don´t have this function

youtube.com/watch?v=nnJaMonT-WM
 
Ok, thank you very much for your answers :)

I think all your answers will help me greatly!

Thank you very much :)
 
Are you using an BMX NOE or BMX NOC card? If so, then IOScanner is pretty straightforward to setup. Otherwise, what are you doing now - READ_ VAR blocks?

Provide some detail and someone should be able to help you.

pls explain me how to assign the internal bit address (%m,%mw) in modicon m340 (schneider)
 
modicon m340 schneider

Are you using an BMX NOE or BMX NOC card? If so, then IOScanner is pretty straightforward to setup. Otherwise, what are you doing now - READ_ VAR blocks?

Provide some detail and someone should be able to help you.

pls explain me how to assign the internal bit address (%m,%mw) in modicon m340 (schneider)
 
pls explain me how to assign the internal bit address (%m,%mw) in modicon m340 (schneider)

Not sure exactly what you are looking for, but maybe this is it: when declaring tags, you can 'locate' them in the variables table if you want (not required, but possible if you want access to these variables via standard Modbus commands).

Variables.jpg
 
reply

thank you for ur reply sir
but i want to know. in your pic you put the address for variable error bit %m23
.this is thing i ask for example input module we give the address %i0.1.11 rack,module and port pin.same like how to give the internal address in %m and %mw .


details:

my boss make the program for synchronizing panel .he give the generator_1_priority in %i0.1.11 input module pin
and also he assign one variable it name is load_g1.he give the address for load _g1 is %m100 .when ever i turn on the generator_1_priority the load g_1 is also turn on .that why i ask how to give this address %m and %mw pls explain me details pls
 
@V0N_hydro

Thanks for the code, VON. That was really helpful to me (via another thread).

A bit funny that when you use a M340 to READ_VAR from another M340 starting at 125, it actually starts reading at %MW126.
 
@V0N_hydro


A bit funny that when you use a M340 to READ_VAR from another M340 starting at 125, it actually starts reading at %MW126.

So you get it allready working?

I think that there was system word for if memory starts from zero or one on M340.

p.s look system words %SW139 and %SW141 if it makes difference
 
Last edited:
So you get it allready working?

I think that there was system word for if memory starts from zero or one on M340.

p.s look system words %SW139 and %SW141 if it makes difference

Thanks for the extra tips. I did get the Ethernet version running and was very excited about that. I need to sort out the wiring on the Modbus and then I will test that as well. Might not be until next week though - see how much progress I can make on my HMI before I get back to it. Cheers,
 
Thanks for the extra tips. I did get the Ethernet version running and was very excited about that. I need to sort out the wiring on the Modbus and then I will test that as well. Might not be until next week though - see how much progress I can make on my HMI before I get back to it. Cheers,

If you use M340 CPU's inbuild serial port, then you maybe need TWD XCA ISO adapter for biasing RS485 line.

On NOM-card you can directly use port without extra stuff.
RS485, pins 4,5
RS232, pins 1,2,8
 

Similar Topics

Hello. I know nothing but Allen Bradley Products. I know need to program a Modicon M340 PLC. I need to purchase the software package but I am...
Replies
1
Views
4,894
I was wondering if there is a way to convert the PLC code sections .XBD into excel, edit them, and reimport them.
Replies
1
Views
1,179
Hi there, Anyone familiar with Modicon Quantum PLCs? What programming software is required for the 45PLQUA series and what is the latest...
Replies
4
Views
1,920
Hi, I have 0 experience with Modicons. A friend asked me if Im able to help him out with simple programming of Modicon 512/612 PLC. I believe...
Replies
3
Views
1,742
In need of some help modifying some Modicon 984 programs. Please PM me if you're local in Detroit and have Proworx 32 or NXT and could do some...
Replies
0
Views
1,636
Back
Top Bottom