Omron CX-Programmer query from PM

BobB

Lifetime Supporting Member
Join Date
Jun 2002
Location
Sydney
Posts
4,550
Bob,
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 [email protected] if you dont want to use the plcs.net interface. Thanks again.

Matt

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.
 
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.

matt

Edit:

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




Variations:

None.

Purpose:

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:

S:

Input word

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

C:

First parameter word

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

D:

Output word

CIO, W, H, A, T, C, D, E, E?_, @D, @E, @E?_, *D, *E, *E?_, DR, ,IR
 
Last edited:
Matt,

I would strongly suggest you download the CS1/CJ1 Programmming Manual, #W340. Use this link . 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.
 
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.
 
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.
 
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.

matt
 
Matt,

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.
 
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!!

matt
 
CJP and CJPN

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!

matt
 
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.
 
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
 
Last edited:
second try at pic


cjpn.JPG
 
Matt,

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.
 
Last edited:
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:
 
Last edited:
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.
 

Similar Topics

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
365
I am using a function block that has a in/out parameter that is a structure. The structure has an array as one of the elements. I can index the...
Replies
1
Views
729
Is there a way in CX-Programmer to call Ladder Instructions from a structured text program? I can see several functions in the autocomplete...
Replies
3
Views
1,921
Is there a way in CX-Programmer to call functions from a structured text program? I have found this manual that seems to describe the process...
Replies
1
Views
1,040
Is there a way in CX-Programmer to initialise an array? Set all values to zero or false depending on the data type Solutions in Ladder and...
Replies
2
Views
1,255
Back
Top Bottom