Sign in to follow this  
Followers 0
penguin0456

BSR and DINT Arrangement

3 posts in this topic

Hello,

 

So I am kind of stuck on how I should handle this issue. I have a project I am working on, this machine is indexing a part, and every so many degrees it triggers a camera to check the part. When the trigger is done, I am BSR the BOOL results into a DINT, this gives me the data results from the part. I plan to display this on a HMI, and send it up to the network to log the results. The main issue I am having is because of how I designed this machine, I cant start at feature one on this part. so I start in the middle of the part and index around. For this to make sense to a operator or someone looking at the data on the network I need to be able to re arrange the data, for example. the features that are BSR are 2, 1, 8, 7, 6, 5, 4, 3.  and I need them to be 1, 2, 3, 4, 5, 6, 7, 8. I have multiple parts I'm running in the machine, so the exact order will change per part.(this is just an example)

 

Thanks,

Tim

Share this post


Link to post
Share on other sites

I wonder if the BTD {Bit Field Distribute} would work if combined by an inspection definition array.

Using the same example as you we do the following:

1.  InspectionOrderArray SINT[32] is loaded as InspectionOrderArray[1]=2,  InspectionOrderArray[2]=1,  InspectionOrderArray[3]=8,  InspectionOrderArray[4]=7,  InspectionOrderArray[5]=6,  InspectionOrderArray[6]=5,  InspectionOrderArray[7]=4,  InspectionOrderArray[8]=3.

2. Create 32 alias SINT Tags named Inspection1, Inspection2,  .... Inspection32  linked to InspectionOrderArray[1], InspectionOrderArray[2], .... , InspectionOrderArray[32].

3. Your BTD Instruction would be your Inspection Result BOOL , Your Part Result Tag and Point to Bit Inspection1, or Inspection2 or whatever.

Hope it makes sense.

Share this post


Link to post
Share on other sites

I was thinking of something similar to BobLfoot's suggestion with arrays. When you get the result of the first inspection, you look in the first element of the setup array  to see which bit in the results word to set. So, using your and Bob's examples, when the first inspection completes, you refer to InspectionOrderArray[1], whose value is 2, so you set/reset bit #2 in the results word.

I wish I had a PLC at my desk I could play with again...

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0