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?
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.
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.
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.
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!