View Full Version : Omron CX-Programmer query from PM

April 7th, 2006, 05:13 AM
I was wondering if you would be willing to give me a few pointers on using cx-programmer. Im mostly an AB guy, and ive just started a program for a CJ1 plc. I came across a post you had on sub-routines, and thought id give you a try. Anyways, you say you dont use them, how do you get the program to scan the diffent sections? ie, I have a main section, a Z1 heat section, door sections, ect. I just want the program to scan all the sections from top to bottom. Does it do this automatically? No need to use SBS calls?

One more question, if you dont mind. How do you address analog inputs and outputs? I see that the digitals are 0.001, 1.002, etc. But where does the analog data end up? Thanks alot. You can email me at webmaster@jlbecker.com if you dont want to use the plcs.net interface. Thanks again.


Hi Matt
Sorry to have been so long responding but I just checked a few things while working out of town and have just returned. Snail mail is pretty painful when accustomed to cable broadband and I try to use it as little as possible. The other problem is that I normally do my checks after dinner and a bottle or 2 of "big" Ozzy red wines. Usually pretty mellow by then.

I have placed the enquiry in the open forum as many more people may contribute and/or learn from the exchange. I do not have a problem with you contacting me though as I may miss a topic otherwise due to work pressures and locations.

CX-Programmer offers a multitude of programming options and at first these can be confusing. When you speak of sections I presume you mean the "sections" that can be named with routine or process names down the left hand side of the page.
These sections are just a way of breaking up the program into organised "chunks" if you will. They are not sub-routines, tasks or anything else but program broken into usable pieces. Quite useful - I normally start with a setup section for writing values to be used in the program (values into data memories on the first scan flag). I then normally write my shut down alarms into the next section etc etc. The program is scanned from top to bottom section by section as if the whole program was in a very long block. It is a way of "structuring" the program into like routine blocks and is quite useful for another person when trouble shooting a machine or process. I must say that I came up with DOS software and was used to a very long program in one section, although I still structured the program into similar blocks in the very long section of ladder.

Another useful way of programming provided is "tasks". Tasks can be turned on and off and are only scanned when turned on, thus reducing scan time to only the running tasks.

Sub routines are similar to other PLCs in that the sub routine is only active when called. A little like tasks I guess.

With respect to analogues and the I/O map, if you set up an I/O table in the "IO Table And Unit Setup" section in the left hand section of the screen, CX-Programmer will automatically place "I and Q" in front of inputs and outputs for you. In the symbols editor the input/output is also shown with the rack and slot position. This is determined by the setting up of the I/O table. In the tools section you can change this repesentation to "X and Y" if you prefer. The package is extremely configurable to work the way you want to work but, like the first time with any software, a bit daunting at first. Say you set up the first rack with a 64 bit input card, a 64 bit output card and then an anaolgue card address "0", the first 4 channels (0-3) will be inputs, the next 4 channels (4-7) will be outputs.

Analogue cards are "special" cards and are allocated to another area of memory. If the rotary switch on the first analogue card is set to "0", the channel address starts at channel 2000. When you set up the I/O table the channel setting with be displayed in the I/O setup area.

If you can post your I/O layout here (32 bit input, 16 bit output, 8 x analogue input etc) I will lay it out in CX-Programmer and post some pictures here to show all how it is done. I will also send you a program file directly with the I/O table set up and some notes as they would be far to extensive to place on the website.

Look forward to further exchages here with you as you "battle" your way through. I do expect, at the end of the day, that you will quite like your first experience with Omron after many hours of frustration learning how things work. I am just going through the same experience with the latest version of Siemens software. Have not used Siemens for about 8 years.

Hope this helps a little.

Matthias von Zorn
April 7th, 2006, 07:55 AM
Thanks. Another quick question, to address area 2000, so I label it with something for datatype? Q:2000 I2030? say, in a mov instruction? How about PIDs? The help doesnt list a datamap for it? ie, where CV is, where the gain,rate, and reset are in it. Also, is there a PID function block? Thanks again.



Here is the help for PID. It takes 2 words for input and out, and contains the starting word for the control data block. But no C+ list to show where everything is in the block? How long is the block? Thanks.

PID(190) - PID Control




When the execution condition is ON, PID(190) carries out target value filtered PID control with two degrees of freedom according to the parameters designated by C (set value, PID constant, etc.). It takes the specified input range of binary data from the contents of input word S and carries out the PID action according to the parameters that are set. The result is then stored as the manipulated variable in output word D.

Operand Data Areas:


Input word

CIO, W, H, A, T, C, D, E, E?_, @D, @E, @E?_, *D, *E, *E?_, DR, ,IR


First parameter word

CIO, W, H, A, T, C, D, E, E?_, @D, @E, @E?_, *D, *E, *E?_, ,IR


Output word

CIO, W, H, A, T, C, D, E, E?_, @D, @E, @E?_, *D, *E, *E?_, DR, ,IR

April 7th, 2006, 08:29 AM

I would strongly suggest you download the CS1/CJ1 Programmming Manual, #W340. Use this link (http://oeiweb.omron.com/DocumentLibrary.asp) . Enter W340 in the Partial Document number box. This is a huge manual, broken into 3 separate files. However, it will fill in the details that the online help leaves out.

You may also want to download the W339 manual. It is the Operation Manual and will help with things like the memory map and addressing, including "Special I/O" modules like analog.

Hope this helps. Let us know if you have any questions.

April 7th, 2006, 03:12 PM
The manuals take a bit to get used to, as does the way that Omron does things, which is probably different to what you are used to. But once you get used to it, you will find that it is quite useful, and you can do a lot with it.

I am currently working through a project at the moment, have not had anything done this morning yet, as have not left the website!

The PID has certain quirks, but as gtsupport suggests, you need programming manual, the info you posted looks like what you get when you click on instruction help, the manual gives more comprehensive info on each and every instruction.

April 7th, 2006, 06:09 PM
Definately down load the manuals - waste of time without them quite frankly. Check with your local Omron rep and see if you can get a copy of the Digital Library CD - that has everything on it.

With respect to addressing issues, they are fully covered in the manuals as well. The CX-Programmer manual covers the software pretty well and then there is another manual for FBs.

Matthias von Zorn
April 13th, 2006, 01:17 PM
Another Question. Scaling the analog outputs. Ive set the output to 4 - 20 ma, and have wired it to be 4-20 (as opposed to 1 - 5). I cant seem to find the scaling info for it. It seems to imply that for 4 - 20, +/-32000 is the scale. Ie, -32000 is 4, and 32000 is 20. Is this correct? Thanks alot.


April 13th, 2006, 01:43 PM

Manual W345 covers the CS1/CJ1 Analog modules. I don't remember you saying which module you are using, but it looks like the 4 - 20ma analog output range is 0000 - 0FA0 hex (0 - 4000 decimal). 4ma would equal 0, 20ma would equal 0FA0.

Hope this will help. Let us know any other questions.

Matthias von Zorn
April 14th, 2006, 07:50 AM
It did. I do have the manual, and had spent 40 mins or so looking for this info. Now that I could search for it, I found it right away. Thanks again, I probally would have spent another 30 mins looking for info instead of coding if not for the great help. The manuals have helped alot. Its too bad the online help is so terrible. Really, to not have data block breakdown for functions in the online help is inexcusable in modern, expensive software.

Thanks again everybody!!


Matthias von Zorn
April 14th, 2006, 10:21 AM
How is the CJPN suppost to be postioned? No matter where I put it, I get a CJPN is not postioned correctly error. The manual shows it simply on a line by itself. But, as the manual shows it, I get that error. Ive tried putting on a line by itself, at the front of the rung, at the end of the rung, with contacts in front, contacts behind, with coils, and without coils. Everything gives me that same error. I really cant think of any more ways to place it or combine it with contacts and coils to make this go away. Thanks in advance. Again!


April 14th, 2006, 11:03 AM
May need more information on this.

The CJPN will be at the end of the rung (where a coil would go). It will require a contact before it for the conditional requirements. The instruction must have a "number" pound sign X (#X) to designate it.

There must also be a JME instruction later in the logic, with no contacts in front of it with the same #X to designate the end of the jump "zone".

I did enter it into CX-P and once I put in the pound signs, no error in compile.

Hope this will help.

Matthias von Zorn
April 14th, 2006, 11:47 AM
A CJP is the jump, the CJPN IS the JME, so its the JME that is the problem, the actual jump (CJP) has no errors. I have used the #x in the jump number.

One would think that the JME (or in this case CJPN) could pretty much just go anywhere, and that it can be the first insturction in a rung, but it cant.

Ive included a picture, according to programmer, non of these are legal placements of the CJPN

Matthias von Zorn
April 14th, 2006, 11:53 AM
second try at pic


April 14th, 2006, 12:14 PM

I think there is a misunderstanding here. From the manual "CJPN and JME are used in pairs" The CJPN is NOT a paired instruction with the CJP, it is a different instruction.

See attached CJPN_Text file below. There is a typo in the second paragraph it should indicate CJPN not CJP.

April 14th, 2006, 12:19 PM
In reference to your picture, these would not be correct. The bottom one is close, but will require a contact(s) ahead of the instruction.

Also from the W340 manual:

Matthias von Zorn
April 14th, 2006, 12:48 PM
Ugh. Thanks again. I looked at the diagram 100 times and never noticed that it was JME and cot CJPN. That explains everything. Thanks again, obviously im having issues with my eyeballs.

April 14th, 2006, 12:58 PM
No problem, it is Friday afternoon.

Hope things are working now.

Matthias von Zorn
April 14th, 2006, 01:24 PM
It looks as if SET and MOV require a contact in front of them to work? Can you have just a set or a move by itself in the coil position? So far, to do this ive simply made an always true bit and have the contact for it in front of the set and movs, but this seems like it should be unnecessary. Thanks again.

April 14th, 2006, 01:39 PM
You are doing it correctly! In Omron, a rung must start with a LD instruction (back to mneumonic code on that one!).

Therefore it is common (and necessary) to use the Always On contact as you are describing. In the CS/CJ instruction set there are a FEW instruction (LD<, LD=, etc) that can connect directly to the left power rail, but not many.

Hope this will help.

Matthias von Zorn
April 20th, 2006, 12:53 PM
Another programmer question! Yeah! I cant seem to locate the value of a timer. It looks as if the T0001 and such can be used for timer done, but where are the accum and timing outputs? Thanks again.


April 20th, 2006, 01:21 PM
I think you are trying to duplicate what you can do in AB, and maybe other brands that have the same feature.

For the Accum, what you can do is move the value of the timer to an address, and that will display the current value of the timer. For timing, you might have to create a latching timer, and use the latch as you timing bit.

Not ideal, especially when used to AB, but there is always a work around.

If your processor supports FB, maybe you could build you own generic timer with all the functions that you require?

Matthias von Zorn
April 20th, 2006, 01:37 PM
Thats the problem, I cant access the timer value at all. It doesnt seem to exsist anywhere. The TIM function is given a timer number, and it has a done bit T000x. But thats it. I cant find anywhere the current value of the timer. It has to be somewhere tho.

April 20th, 2006, 03:37 PM
The SV and PV are shown in the timer block in the ladder when on line. You can see the timer timing down.

The timer number can also be inserted into the watch window nd the PV will be present there.

I hope this is what you need. If not, repost and will be back.

April 21st, 2006, 02:24 AM
Thats the problem, I cant access the timer value at all. It doesnt seem to exsist anywhere. The TIM function is given a timer number, and it has a done bit T000x. But thats it. I cant find anywhere the current value of the timer. It has to be somewhere tho.

Hello Matthias,
T0001 is the Boolean contact of Timer 1.
T1 is the Present Value of Timer 1.
T1 has data type CHANNEL (generic), and can be used within other instructions simply by using 'T1'. E.g. MOV T1 D0 - will move the PV of Timer 1 into memory area D0. (CX-Programmer knows the difference between using the bit of T1, and the PV of T1).

Hope this helps

Matthias von Zorn
April 21st, 2006, 06:33 AM
Yes it does. That explains why I didnt get an error when I used Tx in that greater than instruction. Thanks again for all the help. This whole omron package is slowly coming together. Couldnt have done it without you guys.


Matthias von Zorn
April 21st, 2006, 09:02 AM
This omron plc is making me feel like an idiot. :)

Can someone explain why I can do this

*F W110 0.0239 W112

W110 and W112 are set to real in the data table. I get an out of range for 0.0239

Ive tried doing #0.0239, but that doesnt work either. I get a non hex error on that one.

What am I doing wrong? I tried to use W114 and MOV to place 0.0239 into W114, but that gives me the same error. Am I specifing the constant wrong?



April 21st, 2006, 10:12 AM
Hello Matt,

The constant value needs either a '+' or '-' before it, to indicate that it is a floating point value. (Don't include the quotes!)
*F W110 +0.0239 W112

Matthias von Zorn
April 21st, 2006, 10:45 AM
Thats it! Thanks.

Matthias von Zorn
April 24th, 2006, 08:00 AM
Will the plc automatically space the memory area out? For example, if I assign W100 as type REAL, do I need to skip W101 (because real is 32 bits) and use W102 next? Or will it adjust the memory space to allow W101 to start at the end of the real W100? Thanks


April 24th, 2006, 08:08 AM
No, you will need to "space" it out. You will have problems if you try to use W101.

April 24th, 2006, 04:59 PM

You have to space the double words yourself. If you use long, do not forget to space 4 words.

Similar to GE-Fanuc and a lot of others PLCs in that.

paraffin power
April 25th, 2006, 12:53 AM
Going back to the timer...

Gives you a timer FB with the current value, timing bit and done bit.

Matthias von Zorn
April 25th, 2006, 08:03 AM
Thanks alot guys. I grabbed the scale off there too, as its a bit nicer than the scale I wrote. It does kinda suck that the memory space isnt dynamic. It really should allocate the memory space pointers dynamically, so that W110 points to the start of W110, even if W109 was a long real. Oh well, I better go back and check my data for every thing. I take it then, that if you have a DINT output from a scale to an INT that its going to spill over into the next variable as well. Wow, I feel like im doing assembly again. Its like 1988 all over again. :) Thanks for those function blocks. I didnt even realize that the timer was a BCD, I assumed that it was int.

Matthias von Zorn
April 25th, 2006, 08:56 AM
One more thing, what about the "channel" data type? Does it dynamically allocate the memory for this? Can you write both ints, reals, etc to a "channel"? Thanks


Matthias von Zorn
April 25th, 2006, 10:29 AM
Also, whats up with TIMX? Its all over the manuals and help files; but, it is not available as an instruction? Its not on the list to pick from, and if I enter it manually I get an "invalid instruction". Is this instruction not actually in programmer? I am using a supported PLC according to the docs. Any ideas?

Nevermind, I found it. I need to click "set timers / coutner to binary" under the PLC properties. Thanks.


April 25th, 2006, 10:41 AM

Channel data type will show the hex value of the memory location. This is the way the data is actually stored in the plc. The other data types are really only for the programmers benefit for displaying values.

Guessing a little here, but TIMX is referring to timer instruction TIM (standard timer with set value XXX.X seconds). The X refers to the timer "number". All timers and counters must have a number assigned to them, to differentiate which timer/counter is being used.

Hope this will help.

Matthias von Zorn
April 25th, 2006, 11:36 AM
No, there is actually a TIMX instruction (see my post up above, I answered my own question). If you click on the processor, select properties, and click "binary timers/counters" it will remove all TIM instuctions and replace them with TIMX(X stands for binary in omron land somehow). Now, of course, I need to go back and change all my TIMs (about 60 of them) to TIMX. Joy. Thanks for all the help tho.


Sleepy Wombat
April 25th, 2006, 04:38 PM
Thats correct Matt, the TIMX uses a decimal value for the SV, actually it is 0 - 65535. And yep, you found out how to use them via the PLC properties dialog.

In regards to replacing all instances, have you tried find and replace ? You can find and replace mnumonics ie TIM to TIMX i believe.

Matthias von Zorn
April 26th, 2006, 06:59 AM
Yea, thats what I did. Im glad that worked. Things are getting pretty far along now. Still finding crazy things like MOV and MOVL. I would never have guessed that using mov on a real only moved half the data untill I stumbled onto movl while looking around the manuals. Every vendor does everything a bit different, thats for sure.

April 26th, 2006, 01:33 PM
A problem I have found, is that if I want to move a floating point value(fixed) into a word, that it cannot be done.

MOVL +9.2 D1

Is not allowed, so what I have to do is

+F +9.2 +0.0 D1

Not sure if there is another way, but this works anyway.

Matthias von Zorn
April 26th, 2006, 01:51 PM
Or, that there is no unsigned add! You cant add two unsigned ints without getting warnings! I assume that it should still work as long as they are in range. Or, that signed int * signed int yields a 32bit number, but can only be of type int?!


Sleepy Wombat
April 26th, 2006, 08:14 PM
int * int results in lint (Long Integer result taking up two words.

Sleepy Wombat
April 26th, 2006, 08:17 PM
MOV works on a single WORD
MOVL works on two consectutive words (LONG WORD)
XFER will move a specified number of words from Source to Destination etc
XFER could be likend to File Copy in AB

Matthias von Zorn
April 27th, 2006, 07:09 AM
Yes, but if you put a LINT in there, it gives an error! So, its a 32 bit output, that must have a 16 bit variable! Actually, it gives a warning; and, I assume that you can safely ignore this warning. Just like im ignoring it for using UINT with the * instruction and all the greater than less then instructions. If I dont, I have no ability to add or subtract UINTs!!

Sleepy Wombat
April 28th, 2006, 12:40 AM
Sorry should have been DINT not LINT.
Yep I ignore these types of Warnings...
BTW you have < > = <= >= but if you want to compare signed INT's then use <S >S <=S >=S etc.

September 13th, 2007, 06:02 AM
Please send me the sample program of connecting analog I/O'S TO OMRON PLC.

September 13th, 2007, 05:06 PM
Read the manual for the analogue card and all will be clear.

February 1st, 2009, 09:25 AM
Hi, This is my first time using a form, so not sure how they're used. So I am just gonna post my question and see how it goes.

I am a college student and for my final year project I am using a servo motor for one of the applications. I have never used a servo motor before, and I have to use it through Omron PLC, which I have never worked on before. I have figured most of the things about Cx programmer on my own and by the help of reading the previous posts on this form.

I still need to know how do i program the servo motor through Cx programmer, I know there are additional softwares for servos but i have heard that the application I am using it for will not require me to use them. So does anyone know how do I get my motor to start when I press the start button, and slow down when it comes across one sensor and stop when it reaches the next sensor. I can figure the ladder logic myself, I mostly need help with what command to use in the Cx programmer to talk to the servo motor.

I am using:
Prgrammable Controller- CS1G-CPU44H
Module- C200HW-NC213
Servo Motor - U20030LA-S1
Servo Drive - R88D-UP12LA
Program - Cx Programmer 8.01

I have it all wired up according to the manuals, but have no idea how to program it, any help will be greatly appreciated.
Thank you