I am trying to support a family of applications that were originally created on the DL205 hardware, but later versions have been switched over to using mostly the BRX platform. The previous method of supporting these systems has been to have multiple code lines, one for each major platform. But in an attempt to streamline the code support process we are trying to incorporate the code lines into a single program that can be maintained, built, and distributed to all machines via DMLoader. Even if the final build between the H2 and BRX must be separate files, that is much better than making the same changes across many programs and built for all of them, and distributed based on the specific product to be updated. Logic and IO assignment wise this has not been too much of a problem, but I am running into one hard issue: I have the @IntSerModbusClient on the DL205, and The @POM server on the BRX for using MRX MWX instructions. In the end, that is one of the only things that I cant just make work in a single program that could be built for either PLC as the @POM doesn't exist on the DL205.
The DL205 and BRX PLC use the Modbus for slightly different things, so the logical code for each of those only need to activate depending on which PLC this is installed on, and I can additionally pull the actual MRX and MWX instructions into their own program, so if need be I can just copy/paste that single program into the final project right before build.
I am trying to think down a couple different paths right now:
1) A painfully obvious suggestion that deals with this in a way that I am overlooking.
2) Some method of indirectly referencing the hardware to be used by the PLC that either I can have a single referenced address that is resolved at runtime to get the right device set up and used.
3) Some kind of automated method for inserting code blocks into a program that doesn't necessitate the manual use of the Copy/Paste tool, as I want to avoid errors by a human. One way that seems usable would be to use the import/export functionality create the "Core" project, export it, and then import the code into the "DL205" "BRX" projects to be built. If there are command line capabilities that I could create a script to help do these actions directly from DMD would be ideal. I can also work with Mnemonic files and: Export - run script that adds programs and CALL instructions - Import. Again, command line or automation of any type that could help this process would be wonderful.
If there are any suggestions or methods for doing this that I could use as an example, thank you.