Modicon M340 Addressing and Modbus Question

tonofsteel

Member
Join Date
Nov 2008
Location
Sask
Posts
2
Hello all,

I working on laying out I/O for a program in a M340 processor with remote Advantys IO drops. I am more familiar with a momentum processor and this is my first project with a M340.

For the momentum all I/O needed to be mapped to specific addresses (0000x 1000x 3000x 4000x) Then you could use 0000x addresses for bit data that could be read and written to from an iFIX HMI, and 4000x addresses for word data that could be read and written to from an iFIX HMI.

I notice that there are %I, %Q, %M, %MW (and many more) in Unity and from another post I had obtained this information:

Vijeo wants the address in modbus format (0xxxx = outputs, 1xxxx = inputs 4xxxx = registers)
so
address in unity %qxxxx and in vijeo 0xxxx(+1) for example %q0008 would be 00009
address in unity %ixxxx and in vijeo 1xxxx(+1) for example %i0008 would be 10009
address in unity %mwxxxx and in vijeo 4xxxx(+1) for example %mw0008 would be 40009
The offset is because modbus addresses start at 1 while iec addressing starts at 0


If I try to use %Q for internal bits it will not allow me. If I try to use %M for internal BOOL bit data it will not let me, however I can use EBOOL which I am not familiar with so I have no idea what the consequences would be.


I am confused about which addressing I should be using and which data types I should be using. I have been reading what I could find on these topics but what I have found was patchy.

From what I have read and a bit of experimenting it seems that I can use %MW for everything and the HMI can read and write to this area in words. However the problem that it creates is that in the past we used 0000x for bit data to simplify HMI programming, and iFIX cannot address individual bits in word in a easy manner. (You can but when dealing with 200+ bit addresses its much easier to write '1' or '0' rather than '0' '1' '2' '4' etc and keept it all straight since we need only 1 bit per device on HMI screen)

If someone could give me an addressing breakdown for the M340 related to internal PLC operations and modbus operations and what each area is typically used for it would be GREATLY appreciated.
 
I have been doing some digging and I found out that the objects map to the modbus registers as follows:

%MW = 4x memory area
%M = 0x memory area
%IW = 3x memory area
%I = 1x memory area

As well I have found out that the bool type is a byte, a word is two bytes and the ebool type is 3 bits.

Now my main problem is I want to create variables that are 1 bit in length. I have a switch for an input and I need to be able to read one bit for the status of this switch.

Are there no variable types in unity pro that allow for a single bit variable?

From what I read the only variable that can be created in the %M area is an ebool which is 3 bits in length. I need a variable that is a single bit.
 
Last edited:
In UnityPro, all digital values are in EBOOL or BOOL type. EBOOL is 3 bits, as you said, which stores the value of variable in one bit, then force status in another bit and then third bit for storing the rising edge or falling edge status.

BOOL is a byte out of which only the LSB bit is used to store the status of variable.

Unlike older platform, all new platforms uses byte or word to store the status of bit, may be formaking it faster to process. You can notice that Rockwell RSLogix also use DINT (32 bits) to store the value of a BOOL type.
 
hi dear all
i have modicon m340 and i buy a new memory to put it and right new project .
how i can find guide to write small program and load it to plc .
is unity pro has a ladder web to right as siemence ??
please help me .

[email protected]
 

Similar Topics

Hello, Considering the M340 as a Modbus slave, and another device attempting to access internal memory of the M340 using the standard holding...
Replies
2
Views
6,508
Hey all, I am having an issue concerning the Modicon System Responsible for the operation of our Generator System. (Particularly Dresser-Rand...
Replies
5
Views
2,533
Hello, I'm having a hard time understanding how to get a Modicon M340 to pull a Modbus address from an ABB Totalflow via Ethernet. I set up a port...
Replies
5
Views
1,139
Hello. New to Unity and had a couple quick questions. Can a Modicon M340 output to a small multiline LCD screen and not a full HMI?
Replies
4
Views
957
Hi, I'm configuring the M340 controller with ATV320 inverters via Canopen. Everything was fine until today, when after starting the electrical...
Replies
1
Views
1,319
Back
Top Bottom