Modular I/O swapping

Mewescott

Member
Join Date
Aug 2005
Location
Kansas
Posts
1
I don't normally ask for help but this one has me stumped.

We are designing a machine with 4 stations each have a 24 pin connector with 6 inputs and 6 outputs at each station. We will have an HMI to configure which station has what module on it. There will be 12 possible modules. All the modules will be able to plug into any of the stations. Once configured on the HMI that the module is in the new station all the physical I/O for that station will need to point to the right tags in the code for the module.

I am using a 5069 series CompactLogix controller. I only have two input and two output cards. So the swapping I/O will be inputs 0-5 to 6-11 or 0-5 on the next card etc. I can't seem to just use a copy instruction to write to the I/O for some reason. I can't seem to treat the I/O like an array at all. Has anyone done something similar? Any advice on a simple way to do this dynamic internal rewiring within the PLC code?
 
Mewescott,

I would suggest that you have the 24 pin connector tell the PLC which module is currently connected, bypassing the HMI entirely, say be using 3 additional inputs and making a binary->decimal conversion for your different hookups. From there the PLC will know what module it is based upon its decimal value, 0->7 in this case, and can then be used to point to the needed IO for that given module.

You are correct the IO cannot be treated as an array, but for your case might I suggest the BTD (Bit field distribute instruction). IE: If the connector tells the PLC it is module 2 then the BTD will copy inputs 4->6 over the first IO card to a DINT/INT/UDT for your use throughout your logic.

I hope this helps, and I hope I understood your need correctly.

-Nathan
 
It sounds like in module 1, input 1 is say "part in place" but for module 2, input 1 is say "rabbit detected in lettuce".
Similarly for module 1, output 5 might be "open part discard chute" but for module 2 it is "release the 'ounds" (clearly module 2 has a West Country accent.)

So you have two distinct problems. Let's start with the inputs.
If you want to give an alias or description to input 1 it is "not yet defined input 1".
So it is important to decide what happens to the inputs for the code you're not using. All always off, All on, off or on depending on the signal, or don't care because you use the "module X selected" bit to make sure your code does nothing when not selected.
So at the start of your module 2 code you will have something like:
XIC(MODULE_2_SELECTED) XIC(INPUT_1) OTE(RABBIT_LETTUCE);
Similar for the other modules. The trick here is to make sure your code does what you want it to do when it's not selected: simply turning all its inputs off doesn't gaurantee all your counters

Now the outputs are a bit easier because you don't have to think what to do for a module that's not selected.
Have a routine that gets called after the code for all modules:
[XIC(MODULE_1_SELECTED) XIC(MODULE_1_OPEN_DISC),
XIC(MODULE_2_SELECTED) XIC (MODULE_2_RELEASE_HOUNDS)] OTE(OUTPUT_5);

Please excuse my way of writing ladder logic. It's AB's non default input when you double click the rung.
 
You can create a DINT lets say named Gi_iCLX1_x(slot #).x (Bit #) write a multi-branch run moving each Ptxx.Data from the 5069 Input modules to your user program then manipulate your data from there. BTD or what ever works for you. The outputs can be done the same way just reverse the order Go oCLX-x(Slot#.x(Bit#) := O.pt00.Data etc.

You could modularize your code for reuse and use parameter passing in and out of your Programs. Taking the Global Dints created and moving bits around to the correct order then move into a paramater linked to the routine you want to use based off of the configuration.

GI_data-> user selection code -> Selected input Paramater -> Module x routine -> execute -> Output Paramater -> user code selection->GO_data.

something close to that depending on what else needs to be accomplished in your solution.
 
Last edited:

Similar Topics

I've used AOI and User Defined Data Types, but I haven't created one yet. I have a lot of repetitive MOV commands to take a select number of...
Replies
4
Views
380
Hi all, First post on here. I'm an automation engineer and I have plenty of experience with Allen Bradley, Siemens and Fanuc etc. Constantly...
Replies
4
Views
2,951
All, I am looking for some modular PB boxes that I can screw a cable in to hang in on the fence and call it a day. Fortress interlocks makes some...
Replies
4
Views
2,240
Hi all. Using a Red Lion Graphite® 15" Modular HMI and crimson 3 I have a few programs run in the background. The last one I added gets called...
Replies
3
Views
2,196
Dear sirs I'm using Red Lion products and now I have 2 problems to ask you here. 1) I use CSMSTRLE as a protocol converter [Modbus RTU to...
Replies
0
Views
1,284
Back
Top Bottom