In over my head (ladder logic) Horner PLC, serial Barcode scan

Following on the previous post, with this method it is possible to also check for the length of the received code

The [RX Count] will normally be 29 when the carriage return is found as the last character.

That said, the baud rate is 9600, or around 10kbits/s. With the serial port configured for 8N1, there are 10 bits per character (8 data bits + 1 start bit + 1 stop bit), so 10kbits/s / (10bits/character) = 1kcharacter/s or 1ms/character. Scan times may be as low as 1ms, but not much less, so the PLC will be receiving as many as 1 character per scan.

Since it takes two scans to execute a rising edge on a rung, it will take two scans to de-activate and re-activate the RECV instruction, and the video claims that that will clear the internal (UART?) receive buffer, so characters could be lost.


All that is prelude to saying that perhaps the code should test for no less than 28 or 27 characters in a valid code.
 
As we have seen there is a mountain of missing information.


I will echo what @parky says here. For example,

  • We still have no idea how the process/PLC is supposed to handle the case of an invalid bar code. From the little we do know, it appears the stop cylinder should be left extended. But if that it is the case, and it stops the product from passing (to position 2?), what then? I assume this is some kind of conveyor system (although there is no way for us to know with the information provided), so if one product is stopped, what happens when the next product comes along? Perhaps the "stop" cylinder is actually a diverter?
  • We still have no idea how the stop cylinder works. There have been hints of an extend solenoid, a retract solenoid, a spring return solenoid, and cylinder position sensors. It is unlikely that all of those are actually present, and the actual configuration will determine how best to code the control of the cylinder.
  • We have no idea what triggers the barcode scanner to attempt a read. At one point OP mentioned the Gryphon device is in Serial Online Mode, which means some character or characters need to be transmitted out the serial port to trigger a read; presumably that would be triggered by the PART_POS1 bit and use the SEND instruction. Note that my code does not use PART_POS1 at all, because detection of the carriage return is all that is needed to respond, and if the scanner were instead set to scan automatically when an barcode comes into its field of view, then PART_POS1 would have no use, except perhaps to detect that no code (or carriage return) had been received before some timeout since a part arrived at position 1.
Anyway, OP worked on this for all of last week and they did not have it running by Friday morning, and at that point they were frazzled. OP is new to this, and programming can be - no, make that is - confusing and overwhelming if one is not used to it, so there is no shame in how it's gone so far; many of us, certainly myself included, have been there.

But is it arrogant to suggest that a better outcome might have been possible, and much sooner, if more complete information had been provided here?
 
The easy way to fix the not enough information, is don't start writing the code for the OP until her gives the full scope, your only making a rod for your own back.
Then as you aware after you do all the work for the OP, 80% don't even have the courtesy to come back and thank-you for a job well done, or return to say how the process worked and a big thank-you. Parky and DRBB have been outstanding recently for doing all the coding for the inexperienced and deserve a pat on the back, would l put in the time for the OP, no way, l have better things to do in life than write code for someone, that doesn't even understand the process they are trying to write code for with no or limited experience, least of all any safety factor's they are unaware of, because again, they are doing something the don't understand.
The OP's could put some effort into understanding PLC's, but it is much easier to start a thread and watch someone else do it for them, occasionally posting some answers to questions, other times someone does it for them and they never even respond to there own thread, ha
 
PLC, I do agree, but both DR & I, cannot leave it alone, DR because he recently got the PLC bug (hope that is a good description without offending), me I'm retired, but like the buzz & keep my hand in lol.
 
Or he could of just paid an SI 2 to 3 hours work and had it running by now.


Agreed. That would be nice, if i could have found someone available in less than 6-8 weeks....




As far as some of the missing info.


Stop cylinder should be left extended.


On a good read, it retracts.


Then the operator slides the part through the station, until it makes Part_POS2.




The solenoid is a 5/2 spring return unit.


The barcode unit is as said previously in serial online, which i agree, likely needs a trigger, currently i assume it is just firing when i code shows up. Which seems to work alright as well.



@PLCNOVICE61 Appreciate the concern for me not learning the material, but that's why i didn't login to PLCNOVICE61talk.net, There wasn't willing help there.


As for the guys that have dug in to help, I'll pay for their time, if that's what THEY want. This was a place to come for assistance that did give me info that is helping me learn. If i wanted to not learn, I would've just paid someone and waited 10-14 weeks for a result or gotten the code written from Horner and walked away. I do apologize for not being thorough on info or sequence.
 
Stop cylinder should be left extended.

On a good read, it retracts.

Then the operator slides the part through the station, until it makes Part_POS2.

The solenoid is a 5/2 spring return unit.

That simplifies things some, there is no need for my rungs at the end using feedback from "cylinder extended" or "cylinder retracted" prox inputs, and the code can simply write a 1 or a 0 to the output controlling the solenoid valve directly on the start/stop circuit that retracts the cylinder when a valid code is read. Cscape has a [Normally Closed Coil -(/)-] instruction, as well the the usual [Normally Open Coil -( )-], so it does not matter whether 1 extends and 0 retracts, or vice versa, but the seal-in branch of my start/stop circuit would have to change if an output of 0 retracts the cylinder.

We still need to know what input changes will cancel the red light; perhaps the operator removes the part and the position 1 prox input returns to 0?
 
@DR: lol, all wives are like that, if it's not their thing.
@Ted Z: hope we have managed to help, don't be put off, we all had to learn, some had it a little easier. Yes the more information the better, your not the worst by any means I have seen things like "I have an error on my PLC", short but totally useless description.
As I said earlier, before you even start coding, write down a description of how you expect it to work, this will help you & if posting for help gives others a better description of what you are trying to achieve. For example:
The system comprises of 2 conveyors( Infeed (1), Bar code check/ reject (2) Conveyor 2 has two photocells, one to trigger signal to the reader (PE01) & one after the diverter PE02 to release the divert back to divert position.
The operator places a box on the end of conveyor 1 making sure there is a gap of at least 100mm from the last one. Conveyor 1 will run providing conveyor 2 is running (build back function), however if a reject is in operation then conveyor 1 will continue to run even if conveyor 2 has stopped until reject has completed.
PE01 will trigger the coder to read the barcode by a hard wired digital signal, the position of the photocell is within the range of the coder scan. When a bar code has been read, the data is evaluated to see if it matches the stored barcode, if it is a match then the diverter solenoid operates, the green lamp illuminates, when PE01 Clears the diverter releases back to the divert position and extinguishes the green lamp. if the bar code is the wrong code then the part is also rejected, if a bad read has been detected this is also rejected, along with a no read.
Should 3 consecutive bad reads, wrong bar codes or no reads are detected then the system stops and alarms.
Also give the model of PLC & other equipment & any other relevant information.
Most of the above can also be used as a basis for writing your code.
 
That simplifies things some, there is no need for my rungs at the end using feedback from "cylinder extended" or "cylinder retracted" prox inputs, and the code can simply write a 1 or a 0 to the output controlling the solenoid valve directly on the start/stop circuit that retracts the cylinder when a valid code is read. Cscape has a [Normally Closed Coil -(/)-] instruction, as well the the usual [Normally Open Coil -( )-], so it does not matter whether 1 extends and 0 retracts, or vice versa, but the seal-in branch of my start/stop circuit would have to change if an output of 0 retracts the cylinder.

We still need to know what input changes will cancel the red light; perhaps the operator removes the part and the position 1 prox input returns to 0?


I think that the operator removing the part to reset a red light is likely the best option, as they have to fix the label so it will read
 
I think that the operator removing the part to reset a red light is likely the best option, as they have to fix the label so it will read

In that case, it sounds like a [NO Contact PART_POS1] should be added to the Stop portion of the Start/Stop circuit for the RED_LIGHT.
 
@PLCNOVICE61 Appreciate the concern for me not learning the material, but that's why i didn't login to PLCNOVICE61talk.net, There wasn't willing help there.

I like it:beerchug:
As some of the retired guys on the forum have found, you can spend your retirement helping people with PLC problems, some of these now retired guys have also realised, or more likely their wives have highlighted to them, that they aren't going to have endless healthy days to do all the things they had thought they would like to do when they don't have to earn a $.
So people are spending longer trying to help OP's because of a lack of info, all well and good, until they realise they are using up the limited number of days left breathing they have.
Now as a person asking for help you don't care they are using up there limited days breathing, you want your problem solved. Me l want to do the things l wanted to do when l gave up work, not do things l had to do to earn a $. So all the best to those that help OP's, l just hope if you can answer truthfully to yourself or your loved ones, "I just spent the X amount of hours helping someone l don't know, fix a problem they are getting paid for and YES, l would rather do that than go for a walk/trip what ever, with my loved ones" if that is their answer well all is good, but l doubt people can truly answer that with a yes.
Me l have far to many enjoyable things to do, with my limited number of healthy days left before l die.
It saddens me to think there are maybe people out there that have nothing more enjoyable for them to do, than fix PLC problems for people charging some else for said problem.
So yes you were right, you wouldn't have found any help at PLCNOVICE61talk.net
 
So why are you on this forum ?. I thought the idea of this site was to help people not put them down. Everybody has their idiosyncratic ways, that's their choice.
 
@PLCNOVICE61 No-one will be sad if you see yourself to the door... @Parky, you're right. Theres no need for that in a forum. I help people constantly on 3D printing forums and on Inventor CAD forums. I've never once sat back and though, Hmph, what am i wasting my life for, buncha sods.


I surely just lost valuable minutes reading your crappy human attitude having a tantrum going on about who knows what didn't get hugged enough or some ****. I could have been walking in a park or enjoying the sunrise or taking a dump, Good luck with those numbered days, not helping anyone but your smug *** self. Nothing left to see here. Good day.
 
Last edited:

Similar Topics

Good Afternoon , I'm sure there are many Ishida Muti-Head Weigh Systems . We have a Ishida CCW-M-214W Multi-Head system . We are...
Replies
1
Views
505
Hi all, have a project which requires reading a weigh head weight over ASCII. Never really touched ascii so struggling a bit. The weigh head is in...
Replies
11
Views
1,234
Good Morning , We have a Ishida Multi-Head Scale . I had experiece with them for chips , crackers , etc. , but now we are using them for...
Replies
7
Views
452
Hello expert I have migrate legacy project that use Applicom OPC DA with 3rd client and S7-400. I see in client code add item string call...
Replies
0
Views
360
Got another one a whole team of us and the OEM cannot figure out. Powerflex525, 20HP VFD, commanded over Ethernet won't turn a motor it's turned...
Replies
32
Views
7,865
Back
Top Bottom