Boolean Add Binary Code RSLogix

old_cadger

Member
Join Date
Oct 2010
Location
NC
Posts
2
Hello everyone,

First time posting here.

I'm working on a CompactLogix (RSLogix 5000) program for a machine that inspects bottles. There is an array of 6 cameras on a conveying system that perform inspections for multiple failures. The cameras will be sending the inspection results to the PLC via Ethernet as a binary string. Each camera will send a string that will look like this :
1000000100

Since there will be 6 cameras I would like to do a boolean add on the PLC side to compress the overall inspection results. So it would look something like this:

1000000100
1000000100
1000000000
1000000000
1000000000
+ 1001000100
---------------
1001000100

Does anyone know of a function in RSLogix 5000 that would do a boolean add like this? And/or a particular Data Type & Style that would be best for this type of information.

Also, I'm using FIFO to track the inspection results and kickout failing bottles. This is my first time using FFL and FFU instructions. Does anyone have any words of wisdom about these instructions, pitfalls, best practices ect?

Thanks and I look forward to your replies.

-JP
 
If that is representative of the operation you're wanting to do, you're not adding them, your ORing them.

You could simply OR the first words together, putting the results into a temporary word, then OR that result with the next word putting the results into a temporary word, ... until you get to all of them having been OR'd together.
 
Use the Bitwise OR (OR) instruction. You will have to use many of them (number of items minus 1). I rarely use a compute instruction. Maybe someone can jump in on the use of that. If the item are in an array possible a use of the FLL instruction would suffice.
 
What kinds of decisions are you expecting to make based on the six pieces of camera data? In other words, do you know what the data should be under a "good" condition? And if any of them are "not good" do you know what actions to take? I would think that you would have to examine the six words separately. How does combining them help you to better achieve your goals?
 
Furthering Godfrey's question, does each camera string give a pass/fail indication or some relative acceptance value.

If they give pass/fail info, does a single camera station failure mean a bottle reject or do you need a certain number of stations to give a failure before rejecting a bottle?

From the description so far it seems like they give pass/fail info and a single bad inspection will reject the bottle. In this case you only need a single bit to track each bottle. The bit starts out as a 1 or true signifying a good bottle. This bit follows the bottle through the machine. At each inspection station, create an inspection result bit of 1 or 0 based on pass or fail. This inspection bit gets ANDED with the tracking bit. If this sounds like what you want to do I would just use a bit shift instruction operating on a file big enough to repesent the number of bottles in the machine up to the reject station.

When the bottle goes in the inspection area a 1 goes in the first bit location. If the 1st camera is where the 10th bottle is, then the 1 or 0 from that camera gets ANDED with the 10th bit in the BSL file. Then if the 2nd camera is at the 16th station, it's bit gets ANDED with the 16th bit in the BSL file and so on. Then, perhaps the reject station is where the 37th bottle is so you inspect the 37th bit in the file and if it is still 1 you let the bottle continue and if it is 0 you reject the bottle.

This presumes the bottles are always at set stations and there are always a fixed number of bottles or at least possible bottle positions within the inspection area. If there are a variable number of bottles within the area then I think you will have to implement a series of variable length FIFOs, one for each zone but the idea is the same, to have a piece of data follow the bottle through the machine and wherever you do an inspection, manipulate that data and pass it down the line so that when it gets to the reject station you can determine whether the part is good or bad.
 
Thank you guys. Very good information here.

I'll give the Bitwise Or a shot.

We have 6 cameras that are inspecting the bottles for various defects. These cameras are at a couple of stations on a conveyor system. After each inspection the camera will product a binary code that represents the pass/fail results. We want to be able to store the failure types into counters and then pass that information up to the SCADA system at the end of each shift.

Lets say a bottle has a crack that can only be seen from two camera angles. The bottle exiting the system would have a code that looks like this:
1001000000, 1001000000, 0000000000, 0000000000, 0000000000, 0000000000
What we a interested in is overall inspection results and that this failing bottle has a crack. We are not interested in how many times we detected the same crack. So I thought it would be easier to extract the inspection results by compressing the the results into one short string. We will then dump this into counters something like this:

Total Bottles - 1
Pass Bottles - 0
Fail Bottles - 1
Fail Type 1 - 0
Fail Type 2 - 0
Fail Crack - 1
Fail Type 4 - 0
Etc

Also this is on a conveyor system and there is no way to absolutely guarantee a set number of bottles in between the first inspection station and the eject station. So I will have to use FIFO instead of bitshift.

Thanks everyone for the incite. And if any of you guys have any other words of wisdom for how I am planning on tracking this data please feel free.

Thanks again

-JP
 

Similar Topics

Hi. I haven't touched an Allen Bradley PLC for more than 10 years and I'm kind of rusty. I want to do something really simple in a FBD section...
Replies
5
Views
853
All, i nto fully get it. I read trough some froums but not finaly make it running. so I try to ask. Hopefully anybody has the kindness to answers...
Replies
7
Views
1,195
Example: Take this boolean algebraic expression: note: I'm using a single quote to denote negation as I can't place a bar over the letter. (CA +...
Replies
9
Views
2,834
I was just curious if there is a way to search for a description of a boolean contained within a DINT/INT. For instance, I have a DINT[1] named...
Replies
6
Views
2,263
I have a pump with ON off status in PLC micrologix 1400 my question is how I can calculate working hours base on ON/off status How I can use the...
Replies
5
Views
2,422
Back
Top Bottom