Help - Search - Members - Calendar
Full Version: CJ1M and PMCR command
Forums.MrPLC.com > PLCs and Supporting Devices > Omron > CX-Programmer
GregaG
first a little warning i am still a student, doing now practical schooling, so i am unexperienced, so pls take that in consideration

i am using CJ1M with SCU 41-V1, communicating with dixell xr 110c throught protocol macro

now i have already made the basic communication working as it should, having only have to setup the control words in PMCR while leaving First send word #0 and First recive word #0

how ever the problems start when the company wants me so they can specify slave number and register in program and also storing the the reply in a register they want, by setuping it in CX-Programmer or eighter throught scada or touch panel, basicly setuping it in program and not by writing macro in Cx-Protocol

i have been looking at ModbusPM Operation Manual from this forum, and i managed to make the First send word to work, i mean the Request from omron to dixell is working fine and also dixell Response looks fine judging from trace, how ever i cant make it to store the response data in register specified in First recived word in my case W10 or D800

i tried instead of ~(R(1),1) at slave numer with fixed 01 didnt hlp i then tried athleast to make it so i can specify the slave number and register number and number of registers i want and leaving recived macro to store it to D10
[img=http://img19.imageshack.us/img19/352/recive1.png]
now the interesting thing is when i have first recived word as #0 it doesnt stores to D10, while if i have First recived word W10 it stores to D10

i am sorry for any gramar mistakes, since english isnt my primary language
and i hope i wrote it enought understandable

i attached the XR110C documentation, actually the way it communicates is on site 1, since at the moment i only need to read a register
i also attached the basic communication program and protocol
as well as when i specified everything in PMCR(program and protocol)
PMCR
GregaG

Great job on starting out with PMCR. This is not an easy topic to try on your own, but it is very powerful.

Attached is a modified PMCR that will allow you to execute function codes 03,06, and 10 in Modbus.
There is an Excel sheet included that shows how to setup the data. I have not tested this on an actual Modbus device, but I do believe that it is correct.

There is a tool that you will find very useful in troubleshooting Protocol Macros.
Each port has a buffer to record the data send and received on the port.
CX Protocol can trace this data.

While online, select the SCU that you are using in the tree view of CX Protocol.
[attachmentid=7503]
Then click on Trace 1 (this is for Port 1) exactly where I circled in red, and then right click and select Start Trace, Continuious Trace. Run the PMCR, then on the toolbar, click the Upload Trace icon, and click Yes or OK to stop the trace and upload the data.

[attachmentid=7504]
[attachmentid=7505]




BobB
The Modbus RTU PM on the sitre works very well and I use it regularly.
You will find with Modbus that sometimes addresses are shifted in the impelmentation in the device.
For example, I have just finished a job where the GE-Multilin protection relay addressing was correct - word 1 was word 1.
However, the Caterpillar engine addressing had to be shifted 1 address to the left.
This is quite common.
Another common problem is bytes and words reversed from some devices.
You sometimes have to swap bytes and words to get the information correct.
Hope this helps.
GregaG
ty both of u for helping

@BobB I did encounter such thing already, where user parameter are shifted by 1 instead of beggining at adress 768, they start with 769

@PMCR i am aware of trace option, there are 2 mistakes i have found in code the send and recive codes in protocol macro are missplaced at sequence and when writing single register it has to be 4 words otherwise there is an error since ur not reading the data u wanna write if i m not mistaken

actually i have 3 things i wanna ask if it is possible to explain
1.)ill just paste from excell

FUN06 Single Register Write

Send
+0 Number of words in table (always 4)
+1 Modbus Node Number
+2 First Modbus Register to write (In HEX)
+3 Data to write

i am interested in "Number of words in table (always 4)" what exactly do i specify?
at what i imagine now u specify the number of DMs u are using including the DM where u have the number of words writen

2.) the logical port in PCMR command atm i have it set 0110, which means logical port is 0, is it important for anything else except of using it for flag (example for logical port 0, we have A202.0, which tells us when we can transmit and recive)
could it be that if i used rs485 and rs 232 at same time i would have to have 2 diffrent logical ports or can u still use same logical ports?
and also if i would use 2 scu41-V1 moduls can u use same logical ports for both cards at same time and if so does every modul by that i mean scu 41 has its own logical ports(if i use logical port for first scu 41 and logical port 0 for second scu 41, they arent actually same ports ?)

3.) where can i find annotations, i mean how the hell u insert them ?
BobB
I find with Caterpillar engines I have to go 1 to the left. Then do a heap of floating point maths because of the stupid CAN format to get an answer.

Have a look at this
http://forums.mrplc.com/index.php?autocom=downloads&showfile=259
It is the PM that I use all the time for Modbus RTU. There is a manual that explains the structure etc and a spreadsheet to sort out the addressing in the PLC for the serial card.
IT WORKS!!!
PMCR
GregaG

Sorry about the mistakes. I did not get a chance to test, and I made some copy / paste errors.

1. You are correct about the first word of the Send table. This is the size, in words, of the table, including the first word (which is the size). So, where I have 4, this is 1 word (size), 1 word (node number), 1 word (register) and 1 word (data). If the table started at D1000, then you would simply do a MOV(021) #0004 D1000 in ladder.

2. Logical ports. There are 8 logical ports on the CJ1 / CS1 (64 more on CJ2). These are really buffers between the CPU and a communications module (DeviceNet, SCU, ETN21, EIP21 etc). They are only used when you want to send something from ladder out a module (Explicit message for DeviceNet, PMCR or TXDU / RXDU for SCU, FINS Send for ETN21, etc).
Your understanding is correct, in that the #0110 goes with A202.00, #1110 goes with A202.01, etc. Nothing more.
I typically use 1 logical port per physical port, unless I have more than 8 ports.
So, I would use
SCU 0, Port 1 -> Logical Port 0
SCU 0, Port 2 ->Logical Port 1
SCU 1, Port 1 -> Logical Port 2
SCU 1, Port 2 -> Logical Port 3
SCU 2, Port 1 -> Logical Port 4
SCU 2, Port 2 -> Logical Port 5
SCU 3, Port 1 -> Logical Port 6
SCU 3, Port 2 -> Logical Port 7

You can share logical ports across multiple physical ports, but only 1 physical port can use the logical port at a time, so you could not start 2 PMCRs (on different physical ports) at the same time if they share the same logical port.

3. Annotations. I assume that you mean the annotations in ladder. Simply right click on a any ladder element (contact, coil, instruction, timer, counter, etc) and select Properties. Enter the annotations there.
Also, make certain that 'Show rung annotation lists' is enabled in the Options of CX Programmer.

[attachmentid=7511]


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.