Array Shift Left

Join Date
Nov 2006
Location
CHICAGO
Posts
12
Trying to put together an array to do the following

Dial has 8 positions
Each position can have a status of 0,1 or 2. 0-not present 1-OK 2-Not Good
Each station can modify the value unless it is a 2, then it just shifts the value to the next station every time the rung is true.

Have tried bsl and ratcheting the logic with a series of COP statements and an index.

Not working. Can anyone help?
 
Ringwood Starch mix,

#1. what type of plc are you using? brand name and model.

i will be using ab plc for the discussion.

#2. the bit shift instruction shifts bits in a word, that word typically being 16 bits. A bit can only have the value being a "0" or a "1".

when you say that the dial has 8 positions then you will use a single word to shift the bits.
WHEN you say that each position can have the value of "0", "1", or "2" you are now talking integers and you must use integer registers for your shift.
while running, you place a value of 1 into position 0 and move the rest of the registers down using a series of move commands.

replace int 8 with int 7.
replace int 7 with int 6.
and so on.
then run the next part.

somwone may post a better solution.
hope this helps,
james
 
I'm not clear what you want to accomplish, so, my suggestions may be all wrong. Perhaps you could use two BSL instructions in parallel. The 1st BSL stores the "0" value and "1" value in it and the 2nd BSL stores the "not 2" value of 0 (false) or a "2" value of 1 (true). Then, on another rung use additional logic to block the output of the 1st BSL if the 2nd BSL has a "2" value.
 
Thanks

I am using AB 1769-L27ERM-QBF1CB and coding using RSLogix5000 Ver 21.

I would like to shift an integer instead of a bit. The BSL/R command did not work for this reason.
 
jrwb4gbm, sounds close to what I would like to do. I have seen something done similarly. Can you show me an example of how this would be used?

Using the value of 0,1 and 2 to control a Color animation on the HMI (Panelview Plus).
 
Last edited:
What James suggested I think would work good and thats how I would do it.
Remember to shift before you assign a value to integer0.
 
jrwb4gbm, sounds close to what I would like to do. I have seen something done similarly. Can you show me an example of how this would be used?

Using the value of 0,1 and 2 to control a Color animation on the HMI (Panelview Plus).
I don't have an example, sorry. I am retired with no access to RSlogix5000. Perhaps one of the other members of the forum could make an RSLogix5000 example for you based on what I described in my 1st post. If you would like, I can try to develop an example using RSLogix500.
 
Last edited:
How does this look?

[XIC(STA1.OK)OTE(TableIndex[1].1),XIC(STA2.OK)XIO(STA1.OK)OTE(TableIndex[1].2),XIC(STA3.OK)XIO(STA2.OK)OTE(TableIndex[1].3),XIO(STA2.OK)OTE(TableIndex[1].4),XIC(STA5.OK)XIO(STA3.OK)OTE(TableIndex[1].5),XIC(STA6.OK)XIO(STA5.OK)OTE(TableIndex[1].6),XIO(STA5.OK)OTE(TableIndex[1].7),XIC(STA8.OK)XIO(STA6.OK)OTE(TableIndex[1].8)]; [XIC(STA1.PRESENT)OTE(TableIndex[0].1),XIC(STA2.PRESENT)OTE(TableIndex[0].2),XIC(STA5.PRESENT)OTE(TableIndex[0].5),XIC(STA8.PRESENT)OTE(TableIndex[0].8)]; XIC(AutoMode_IND)XIC(IndexerInPos_IND)ONS(ONS_Temp)BSL(TableIndex[0],Ctrl_1,Part_Present,?); XIC(AutoMode_IND)XIC(IndexerInPos_IND)ONS(ONS_Temp1)BSL(TableIndex[1],Ctrl_2,OK_NG,?);
 
Are there 8 positions total on the dial? Load Station + 6 Work Stations + Unload Station? Then Make an Array[9] this gives you 0-8

Then Make your Load Station Array[7] and Always Move 0 into Array[8].
That Way when you index you'll always reset Load Status. Then if Part Present at Load Station then set Array[7].0 then when your Dial indexes Copy Array[1] to Array[0] for a Lenght of 8. This will copy all values in 1-8 and move them to 0-7. So if you had Part Present in the Load Station when the Dial Indexed the 1 in Array[7] will be copied to 6 and the Zero in 8 will be moved to 7. Then as task are performed you can make you decision to change the value at each station. Set the value Then when dial indexes Copy Array.

Always Zero = Array[8]
Load Station = Array[7]
Work Station 1 = Array[6]
Work Station 2 = Array[5]
Work Station 3 = Array[4]
Work Station 4 = Array[3]
Work Staiton 5 = Array[2]
Work Station 6 = Array[1]
Unload Station = Array[0]
 

Similar Topics

Hey all, was wondering if it was possible to shift values in an array of strings? I have a database that I am loading up with "Users" in the...
Replies
2
Views
294
I'm still a little remedial with my Step 7 classic knowledge. I'm working on in Simatic Manager 5.5, SP4, and I need a little insight of how to...
Replies
10
Views
2,688
I have searched quite a bit, but I'm struggling to figure this one out. Any assistance would be greatly appreciated. The COP and MOV instructions...
Replies
6
Views
2,032
Hello all, I find myself writing some new logic and I am storing records of analog values so that it will be possible to look back on them and...
Replies
7
Views
3,160
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
1
Views
79
Back
Top Bottom