CX-Programmer - How to use challenge

MonsterTR

Member
Join Date
Oct 2023
Location
Earth
Posts
6
Hi everyone,
I am working as a technician at a automotive factory. Recently, we had same quality problem several times on a workpiece. I had a sollution idea to fix the problem, worked on it and done. Working very vell. But i want to upgrade it to myself and my job. So i'm going try to explain what was the problem, my idea, how to did it and what i want to do. If you share your valuable opinions it would be greatfull to me.
Firstly, we are using Omron PLC whole factory and we are using CX-Programmer.
The problem was; date mark! Every workpiece must have a date mark. We are using a dot peen marker to do it. The marker have a controller and marking head. Marking head two motors to write character in two dimension x-y and a pen to third dimension z. The pen is working pneumatic. If a problem occurs during marking progress some thing like gear sticking on motors then controller sens the problem and send fult signal to PLC. Every thing is normal until now. But, if marker pen sticking occurs because of seize, metal dust or dirt etc. and that moment if there is no faulty signal om the motors, the controller send cycle end signal as a succesfull operation. Because there is no control method on marker pen movement during operation due to it is pneumatic. My idea was, seperate the marking head from the jig. The jig linked the 0 VDC terminal to power supply. Through the seperation, every knock of marker pen to work piece, i can get this signal by the marking head body. So, i decided to to use a CP1L-EM30 cpu to do this. Setted the PLCs input 0 as a high speed counter input with lineer mode and increment puls parameters selected. Wrote the ladder, upload the program and worked very well.
Counting PV varies depending on the character type, so i monitored the every marking cycle, i set a min. value to compare, if counting PV can't reach the compared value during on cycle, the program set a bit as a faulty cycle.
The problem is the compared value. The counting PV has huge varies depending on the character type. Min. Value like 900 BCD and max value is like 1500 BCD. I set the compare value 850 BDC.
this is enough for now, but i want to upgrade it.
In the forthcoming days i will measure the PVs of every single character.
I want to store these counted values in the PLC, and i want to know every cycle counter PV before the marking operation. I want to change the comparing value every cycle to keep close enough whole marking operation's counter PV values.
Bu i don't know how to do it easly and effectively.
I need a way to do it. How can i do it or how should i do it. I am stuck.
So what is your opinions guys.
Thanks in advence, stay in peace
 
One thing comes to mind, how do you know what character is being printed, is this coming from the PLC ?. if the PLC knows the character then it would be a two dimentional lookup table, I.E. do a loop search of the table until the character is a match then load the count stored in the 2nd value of the table.
i.e.
Table:
Register [Char,Char]

0 A, 900
1 B, 870
2 C, 890
& so on....
so if you know the character to be printed is B then if known character is B
loop through table starting at reg 0 & compare it if not increment the position & check the next, once found then load the value in the 2nd dimension of the table.
Not sure if CX Programmer has User Data types but if so you create a UDT that has 2 variables
My_UDT
Char_Val // This is the char value i.e. "A" or if decimal 65 or if hex H41
Char_Len //this is the value PV for that char
Then create a variable My_Array as an array of the Structure data type
This gives you a 2 dimensional array of structure type
You can access these indirectly like My_Array[My_Pointer].Char_Val or Char_Len
If you find UDT a bit of a struggle then just use 2 arrays of a length to contain all characters & their PV length.

Array.png
 
The Answer to first question is not this way. the character type does not sending to controller from the PLC. You can set the characters as a last digit of the year, last digit of the month or day, and hours or minutes etc. what ever you want to the selected digit of the mark. These datas stored on the controller. You configured the controller, how much digit to write, what is the type of data to wrtie on selected digit. I am sending to a phisical signal to chose a job number, and cycle start signal. For example, i can configure the marking controller this way; 8 digit to mark. First of it last number of the year, second is last number of the month, third is day with two digit and hour and minute. This is a configured job that has number 0. On this configuration if i send the 0000 to select job 0, and set the start input to 1 then marking operation starts. The Controller sends to PLC the running signal, the cycle end signal or fault signal in phisically. I remember the thing as known "data matrix" from my high school days. I don't know can i receive actual value of date datas from controller. Lets say i can receive this data, and sync the PLC's date depending it, so is there way to create a data matrix to know what will be the counter PV after marking and chose the data easly some thing like demux value in the data mateix. I don't know can i explained it. Sorry about my english.
 
your English is certainly better than any other language I can speak so don't worry, from what I can gather you only send a job number from the PLC to the printer so you do not get any idea of the characters that will be printed.
The only things you get are the number of pulses from an encoder(s).
What you want to do is when the printer prints a character for example "A" or a or any character to check if the cylinders move a given distance based on the size of the character, so as an example print "A" normally takes a count of 950, if the count does not reach this figure i.e. the print head did not move to the required position of 950 within a given time then it becomes a fault, this would be done for all characters printed so lets say the character "a" was 850 you need to compare with 850 instead, unfortunately if you do not know what characters are being printed then how cn you know what the count should be ?.
as you mention it seems it acts like a xy plotter so you have two countsthen it would be a 3 dimentional array that would be required, however, without knowing whar characters are being printed it is almost impossible to know what the counts are meant to be, I have never seen anything like this, the only things I have worked with are verification i.e. bar code printers, where the verification is done by reading the printed bar code & rejecting if wrong or not read (bad print), the other was optical recognition, where a camera took a picture of say a date & possibly a part number printed & verified it.
 
One thing I am not clear about: does the PLC know the individual characters to be printed each time, or does it only send a job number to the controller? In the last post by OP (@MonsterTR), it seems they may be able to get the individual digits into the PLC. If that is the case, then it should be possible to create a data table - perhaps an array of integers - with the number of peening events for each character. E.g. say 100 for ".", 500 for "ü", 900 for "A", 1200 for "W", etc. The Google tells me that the Türk alfabesi has 29 characters, plus digits of course, but let's assume that fits into a 7-bit ASCII code system, in which case the table (array) would have 128 entries (array elements), with the number of expected events at each offset. E.g. "A" is ASCII code 65, so the 66th table entry (at offset 65 from the first entry) would be 900. So the questions become

  • how do we convert an individual letter from the controller to its corresponding ASCII code, which is the offset into the table for the number of expected input events?
  • how does Omron do indirect addressing, i.e. how do we use the the ASCII code/table offset to get the number of expected input events from the table?
Once we answer those questions, we should be able to sum the expected number of events for each job and compare that to the detected number events when the controller sends its cycle complete signal. Or, if there is a signal from the controller as each character is finished, then we could count and compare the number of events for each character individually.




===============================



Perhaps we can look at it a different way.

Once a "job" is sent to the controller, there should be a steady stream of pneumatic-induced events detected. The longest pauses might be between characters when the motor moves to the next character e.g. from the bottom left of a "5" that just finished to the top right of another "5" (assuming the peening events start at the top of each digit).

If we know the duration of those longest pauses, then we could run a timer while the event input is 0 and reset the timer each time the peen event becomes 1. If the timer exceeds the longest expected delay between peen events, then it is possible the marker has seized, so throw a fault.

The problem would be if there were a short sequence of missed peening events that did not last as long as the longest expected pause. A similar problem would occur if the missing peening events occured at the start or end of a letter, and are not detected because they are contiguous with the expected pause between characters.

OP said they are using a high-speed counter to detect the events; it may be that the events are coming in too quickly for this timer-expires-if-no-event approach above. In that case, set a repeating timer for say 10ms, and detect the incremental increase of events at each timer expiry.
 
Last edited:
The Answer to first question is not this way. the character type does not sending to controller from the PLC. You can set the characters as a last digit of the year, last digit of the month or day, and hours or minutes etc. what ever you want to the selected digit of the mark. These datas stored on the controller. You configured the controller, how much digit to write, what is the type of data to wrtie on selected digit. I am sending to a phisical signal to chose a job number, and cycle start signal. For example, i can configure the marking controller this way; 8 digit to mark. First of it last number of the year, second is last number of the month, third is day with two digit and hour and minute. This is a configured job that has number 0. On this configuration if i send the 0000 to select job 0, and set the start input to 1 then marking operation starts. The Controller sends to PLC the running signal, the cycle end signal or fault signal in phisically. I remember the thing as known "data matrix" from my high school days. I don't know can i receive actual value of date datas from controller. Lets say i can receive this data, and sync the PLC's date depending it, so is there way to create a data matrix to know what will be the counter PV after marking and chose the data easly some thing like demux value in the data mateix. I don't know can i explained it. Sorry about my english.

@DR, it appears from post #3 the PLC does not know what the characters are it just sends a job number so the printer/plotter only gets a number from 0 to xx to select the print jab.
 
Originally Posted by MonsterTR
...I don't know can i receive actual value of date datas from controller. Lets say i can receive this data, ...
@DR, it appears from post #3 the PLC does not know what the characters are it just sends a job number so the printer/plotter only gets a number from 0 to xx to select the print jab.
Yes, but then they wrote that statement in blue above, which seems to suggest it might be possible ...

Maybe they plan/hope to model the controller, so the PLC "knows" that job 0000 contains "YmdHH:MM" and can generate same in the PLC if the clocks are synced. It's a Heath-Robinson to be sure, but who knows?
 
if the clocks are synced.
I know I suggest it, but I dunno about that.

E.g. consider the instantaneous transition in minutesfrom HH:10 to HH:11:

  • when does the controller obtain the time to write?
  • when does the controller trigger the "starting" signal to the PLC?
  • when does the PLC see that starting signal?
PLC programming is primarily about time, i.e. about when, not what.

Even my "measure the pauses" approach has edge cases that would be very difficult to handle.

Also, since the peening events are pneumatic-driven, how fast can they be occuring? 10Hz (100ms)? 100Hz (10ms)? 1kHz (1ms)? And what is the cycle time of the PLC?

This is not going to be easy. It might be simpler to contact the local university and see if any students doing work with cameras and OCR would be interested in a real-world project; after all, I assume the issue is legibility, not the actual number of events per character.

P.S. to @MonsterTR: my wife and I very much enjoyed Kara Para Aşk.
 
Yes after reading the posts a little more it does apppear that the printer/plotter does not return anything useful, what is not clear but I suspect the print will contain some other characters or why would you send a number from 0-xx to selelect just a date/time stamp
So on the surface it does sound like the printer has a recipe type db with pre-configured prints & possibly adds the date/time to the end. for example:
recipe 0 = ABCXYZ 20/06/23 10:48:05 so the PLC will not know what the characters are unless it had in the array a copy of the preceeding chars.
This is of course we are understanding all this correctly.
I suspect if it was a date/timestamp if it was numerical only i.e. then the char spacing would be constant as such but if the month field was 3 digit like JAN, FEB, MAR, APR providing the font type was capitals & in a mono fixed width font.
On the note about pneumatic timing & possible interlock signal timing that is just another hurdle to jump over.

I think the poster needs to post typical print messages & handshaking timings so we can understand properly.
 
Sorry for late answer, Yesterday we celebrated my country's 100th Republic Day. Going back to the topic; I want to share with you something I learned today. The controller that I mentioned has a serial communication port :) I don't know why, but I guess they didn't choose this method because they preferred the easiest way. My plan according to the new current situation is this; I will count the average value of each character, record each one, and send the characters to be written to the controller by PLC in YMddhhmm format. I will have full control over the controller via serial communication anyway. If i know the average counter value of each character and send the characters to the controller through serial communication, comparison will be very easy. If I get stuck on something or if I reach a success, I will keep you informed.
 

Similar Topics

Hi all dear fellows... I'm sure any of you might have seen any of my posts in this forum, almost always going around the same topic : PID, PIDE...
Replies
12
Views
4,748
bonjour je souhaiterais savoir si c'est possible de faire communiquer Cx-programmer ( logiciel de programmation des automates Omron ) avec...
Replies
2
Views
157
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
150
I need a good website or tutorial to learn plc programming Thank you
Replies
10
Views
510
Hello ! I am trying to use an omron cj2m-cpu33 with a CP1W-CIF01 plug in serial connector to talk to a zebra ZT610 printer. I am getting the data...
Replies
8
Views
379
Back
Top Bottom