Sign in to follow this  
Followers 0
Jamey

Student advice

39 posts in this topic

There has to be a solution that:

(a) Identifies the three types of items.

(b) Stores the data correctly in the bit shift register.

Agh!

Share this post


Link to post
Share on other sites

Sorry, I can't look at a youtube video right now. I'm really not just ignoring it...

2 hours ago, Jamey said:

A pic of the code is clearer.

 

part 1.PNG

Do IP3, IP4, and IP8 operate simultaneously? In other words, if an assembly passes by, do all 3 inputs turn on and off at the same time?

If the 3 inputs are synchronized, try changing rung 11 so that it only turns on R1.15 when IP4 is on AND IP3 is off. Eliminate rung 12. Then shift the data. You may need to use the other state of IP4 to shift it properly.

I see an RES instruction and a "U" instruction. Both seem to be used on individual memory bits. What is the difference between them?

 

Share this post


Link to post
Share on other sites
1 hour ago, Joe E. said:

Do IP3, IP4, and IP8 operate simultaneously? In other words, if an assembly passes by, do all 3 inputs turn on and off at the same time?

No they do not all operate simultaneously.

ONLY IP3 and IP8 operate simultaneously.

So, both assembled items and pegs are identified and labelled 1 (rung 12 changes the assembled item's label from 1 to 0 thereby avoiding rejection).

ONLY AFTER IP3 and IP8 operate, THEN, IP4 operates.

 

1 hour ago, Joe E. said:

If the 3 inputs are synchronized, try changing rung 11 so that it only turns on R1.15 when IP4 is on AND IP3 is off. Eliminate rung 12. Then shift the data. You may need to use the other state of IP4 to shift it properly.

They do not all operate simultaneously. IP3 and IP8 operate simultaneously BUT IP4 operates a split second AFTER them.

Not sure how to implement this.

 

1 hour ago, Joe E. said:

I see an RES instruction and a "U" instruction. Both seem to be used on individual memory bits. What is the difference between them?

Rung 12 - This corrects the assembled items being labelled 1 (rejection). Because IP3 and IP8 operate simultaneously assembled items are ALWAYS labelled 1; so, the 1 has to be changed to 0 to avoid rejection. That is the function of this rung.

Rung 14 - This rung just tidies up the register - from location 13 onwards, bits are not required.

Rung 15 and 16 - the rejection rungs. An item labelled 1 in location 14 in the register triggers the rejection piston O3. It seems to work.

 

IP5 = Detects ALL items in the rejection area.

OP3 = Rejection pistion.

----R1|  |14-- = When a 1 is in location 14 in the register it energises this NOC.

 

Also, thank you for taking the time to read this. It has been very stressful!

 

rej.PNG

Edited by Jamey

Share this post


Link to post
Share on other sites

Ok...

With there being a lag between IP3/IP8 and IP4, that does complicate it somewhat but not unduly...as long as there's a gap between the parts. If there's sufficient gap between the parts, you can use a latch or seal-in to record IP3/IP8 when they come on. Generally, using a seal-in is preferred, but a latch will work. Then, when IP4 comes on, you check the status of the bits that IP3/IP8 set/sealed and make a decision at that point whether or not to set the bit in the shift array.

So...

In the instant that IP4 comes on...if IP3's latch/seal is OFF, the item is not an assembly, so you reject it. If IP3's latch/seal is ON, the part is an assembly so you don't reject it. In either case, you set the input bit status and shift the register, either when IP4 comes on or when it goes off. After you shift, you then clear the latches/seals from IP3/IP8 and you're ready for the next part. For just this purpose, where you're trying to reject everything except assemblies, you don't need IP8 at all. You just care that something's there (IP4) and it is/isn't an assembly (IP3). It may be useful at a later date to track pegs and rings separately, but that's beyond the scope of what you're asking here.

My other question was merely curiosity about why there are two different instructions that appear to do the same thing: write 0 to a bit. In the AB world that I'm used to, the RES instruction is used to reset timers, counters, etc. while the U instruction unlatches a single bit.

Share this post


Link to post
Share on other sites

In LADSIM:

RES is also used to reset Timers, Counters and Register bits.:-)

The Latch and Unlatch instruction are used on Outputs and a single bit too!:-)

There is no Latch or Unlatch instruction for INPUTS and no 'Seal In' at all!:burn:

 

Do I have to rewrite the code relating to IP3/IP8 and IP4 completely?

At the moment:

Rung 11 without IP4 - I can detect Assembled Items and Pegs but not rings - and the register works correctly.

Rung 11 with IP4 - I can detect Assembled Items and Pegs and Rings - BUT the register increments errors - I suspect because the use of IP4 twice causes a double count to occur.

Again, thank you.

Edited by Jamey

Share this post


Link to post
Share on other sites

Do you really care about the rings per se? As I understand it, you only care if it's an assembly or not. If it's an assembly (latch/seal for IP3 = 1), don't reject it. Otherwise, track it and reject it. For that purpose, IP8 is redundant. It doesn't give you any information you need, at least to solve this particular problem.

However...

In my experience, "they" will always want to know more than good/bad; they will want to track why it's bad. To do that, you could set up a tracking array for each defect (2 in this case). Use one array to track pegs (easy, IP4 = 1 while the latch/seal for IP8 = 1) and the other to track rings (harder but not too bad, IP4 = 1 while the latches/seals for IP3 and IP8 are both 0). Then you'd reject if either array has a "1" at the reject position and you could also accumulate a count of each type of reject. Both arrays would shift at the same time. If you get many more defect reasons, you probably won't want to stay with bit shifts but use word shifts, where you have an array of integers. Each integer represents a "position" while each bit within each integer represents a defect cause.

Also: will there ever be more than one part between IP4 and the reject station? If so, will the number of parts ever change? If so, you will likely need some sort of FIFO arrangement instead of a bit shift array. That will be a problem for another day...

 

Share this post


Link to post
Share on other sites

To recap, I need to write code to identify Assembled Items, Pegs, and Rings.

I ONLY want to keep Assembled Items.

Pegs and Rings must be rejected via the piston OP3.

These are stored in a Bit Shift Register as 1 or 0.

A 1 bit triggers the rejection piston.

A 0 bit does NOT trigger the rejection pistion.

Assembled Item = 0

Peg = 1

Ring = 1

Edited by Jamey

Share this post


Link to post
Share on other sites
2 minutes ago, Joe E. said:

Also: will there ever be more than one part between IP4 and the reject station? If so, will the number of parts ever change? If so, you will likely need some sort of FIFO arrangement instead of a bit shift array. That will be a problem for another day...

The distance between IP4 and the rejection station can accommodate TWO  of any combination of items.

However, so far, the identification method and mechanism designed can cope with a stream of any combination of items.

Share this post


Link to post
Share on other sites

To recap, I need to write code to identify and differentiate between Assembled Items, Pegs, and Rings.

And store, the results as bits in a Bit Shift Register.

This will be used to Reject (1) or Accept (0) them.

Edited by Jamey

Share this post


Link to post
Share on other sites

I think I understand what you're trying to achieve. Based on what I see, if you see a part that is NOT an assembly, set the bit in the reject array. If it is, don't set the bit. Whether it's an assembly or not is determined solely by the status of IP3. So, if you see an item at IP4 without IP3 being on, set the reject bit. If I'm missing something or misunderstanding, I'm sorry. I have to leave now and will take another look in the morning.

Share this post


Link to post
Share on other sites

Hey, thank you so much for all your advice and insights, Joe! :-)

Share this post


Link to post
Share on other sites

Any advice would be most appreciated!

Share this post


Link to post
Share on other sites

Sorry, I got caught up in work stuff and couldn't take a look yesterday. Today isn't looking good either.

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