Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
80820members
346892posts

Determine M580/M340 from with its program

Solved
EMurphy
Crewman
Crewman
0 Likes
3
1060

Determine M580/M340 from with its program

I want to create a DFB that can be used on either a M580 or M340 using a READ_VAR.  The M580 uses the ADDMX, while the M340 uses the ADDM.  Is there a way for the DFB to determine its processor so that it can call the correct function?

Tags (1)

Accepted Solutions
Michael_Chan
Lt. Commander Lt. Commander
Lt. Commander
0 Likes
0
1043

Re: Determine M580/M340 from with its program

I'm thinking of a simple solution for you.

In your creation of DFB, create a BOOLEAN input pin to determine M580 or M340, e.g. Logical 0 = M580; Logical 1 = M340.

When a PLC programmer instantiate a DFB, he/she just need to setup a value to this input pin, logical 0 or 1.

Hopefully this solution is fine for you.

Michael Chan Kum Yuen

See Answer In Context

Tags (1)
JerryBartlemay
Ensign Ensign
Ensign
0 Likes
0
1026

Re: Determine M580/M340 from with its program

Actually, there is no need.  The ADDM works in both the M340 and M580; that's why it shows up in both libraries.  ADDMX is used for addressing at a serial link module port.  Check Control Expert Help.  It will show you the use cases.

See Answer In Context

Tags (1)
3 Replies 3
Michael_Chan
Lt. Commander Lt. Commander
Lt. Commander
0 Likes
0
1044

Re: Determine M580/M340 from with its program

I'm thinking of a simple solution for you.

In your creation of DFB, create a BOOLEAN input pin to determine M580 or M340, e.g. Logical 0 = M580; Logical 1 = M340.

When a PLC programmer instantiate a DFB, he/she just need to setup a value to this input pin, logical 0 or 1.

Hopefully this solution is fine for you.

Michael Chan Kum Yuen
Tags (1)
Richard
Lieutenant Lieutenant
Lieutenant
0 Likes
0
1033

Re: Determine M580/M340 from with its program

There are some status words that can also help with this.

 

%SW14 contains the commercial version of the processor.

%SW16 contains the internal firmware version number which is likely to be different between M340 and M580.

%SW146 and %SW147 contain the serial number of the SD card. The M340 requires a serial card but the M580 does not and will return zeros if there is not a card present. Obviously this method fails if your M580 has an SD card installed for logging data or other purpose.

 

These should give you what you want and a few other indicators for management of the program.

Tags (1)
JerryBartlemay
Ensign Ensign
Ensign
0 Likes
0
1027

Re: Determine M580/M340 from with its program

Actually, there is no need.  The ADDM works in both the M340 and M580; that's why it shows up in both libraries.  ADDMX is used for addressing at a serial link module port.  Check Control Expert Help.  It will show you the use cases.

Tags (1)