Hello Everybody,
I have a big problem and I'm currently stuck in how to solve it. I'll try to make it clear as much as I can but any question is welcomed! So:
A client of my company has this workcell controlled by a OMRON PLC. What this workcell does is: identify a part, print a label (sending a network request to a server), then checking the applied (by an operator) label and finally release the part. I'm in charge of introducing a modification regarding the printing part: instead of send a network request to a server I've implemented a serial com algorithm in order to print the label directly from the PLC (an industrial printer is attached to the front serial port of the PLC). So basically I haven't changed deeply the code, just introduced an independent print routine which doesn't influence the rest of the code. So, this is what I'm working on.
My problem is: I want to speed up the serial TX (theoretically 1.5 secs) without executing all the PLC instructions but just only the printing routine (which is basically buffering the data to send to the printer cycling through a logical path based on the cycling ability of the PLC itself). So I've inserted a JME(005) at the beginning of my printing routine (after the initialization part) and a CJP(510) at the end with its condition transitioned from OFF to ON at the end of my printing routine (last logical state, when the routine is finished). What I'm expecting is, once the printing routine is entered, the PLC cycles only through the printing routine jumping all the rest of the code. What I get is "probably" (not really sure it works) jumping the rest of the code and when it encounters the termination jump condition the PLC simulator breaks down, literally crashes! No clue about why!
I went through the documentation of the CJP instruction and found this passage:
"When JME(005) precedes the CJP(510) or CJPN(511) instruction in the program, the instructions in-between will be executed repeatedly as long as the execution condition remains OFF (CJP(510)) or ON (CJPN(511)). A Cycle Time Too Long error will occur if the jump is not completed by changing the execution condition executing END(001) within the maximum cycle time."
which is a little bit obscure to me. If I got it right, how can I complete the jump with an END instruction if the END instruction is outside of the code I'm executing??
Hope anyone can help, even just clarifying the documentation or explaining to me how jump instructions work on a PLC. My background is more classical software programming so it's probably I'm not following the real Ladder Logic paradigm.
Thank you so much
LP
I have a big problem and I'm currently stuck in how to solve it. I'll try to make it clear as much as I can but any question is welcomed! So:
A client of my company has this workcell controlled by a OMRON PLC. What this workcell does is: identify a part, print a label (sending a network request to a server), then checking the applied (by an operator) label and finally release the part. I'm in charge of introducing a modification regarding the printing part: instead of send a network request to a server I've implemented a serial com algorithm in order to print the label directly from the PLC (an industrial printer is attached to the front serial port of the PLC). So basically I haven't changed deeply the code, just introduced an independent print routine which doesn't influence the rest of the code. So, this is what I'm working on.
My problem is: I want to speed up the serial TX (theoretically 1.5 secs) without executing all the PLC instructions but just only the printing routine (which is basically buffering the data to send to the printer cycling through a logical path based on the cycling ability of the PLC itself). So I've inserted a JME(005) at the beginning of my printing routine (after the initialization part) and a CJP(510) at the end with its condition transitioned from OFF to ON at the end of my printing routine (last logical state, when the routine is finished). What I'm expecting is, once the printing routine is entered, the PLC cycles only through the printing routine jumping all the rest of the code. What I get is "probably" (not really sure it works) jumping the rest of the code and when it encounters the termination jump condition the PLC simulator breaks down, literally crashes! No clue about why!
I went through the documentation of the CJP instruction and found this passage:
"When JME(005) precedes the CJP(510) or CJPN(511) instruction in the program, the instructions in-between will be executed repeatedly as long as the execution condition remains OFF (CJP(510)) or ON (CJPN(511)). A Cycle Time Too Long error will occur if the jump is not completed by changing the execution condition executing END(001) within the maximum cycle time."
which is a little bit obscure to me. If I got it right, how can I complete the jump with an END instruction if the END instruction is outside of the code I'm executing??
Hope anyone can help, even just clarifying the documentation or explaining to me how jump instructions work on a PLC. My background is more classical software programming so it's probably I'm not following the real Ladder Logic paradigm.
Thank you so much
LP