Omron PLC CQM1H-CPU21

A

Thread Starter

Ali

Hi dear sir,

I want to write a program with Omron PLC model "CQM1H-CPU21". In this program I need to send a message like "010347F4000411F4" on RS232C port of the PLC. If I use PLC in "Host-Link" mode the message that plc sends is like this: "@00EX010347F4000411F458*" .

I want a message without any start code and end code, so I tried to use the PLC in "no-protocol" mode. As I know I need to adjust some parameters in order to use my PLC in "no-protocol" mode, so I adjusted the following parameters:

DM6645=1000
DM6648=0000
DM6649=0000
Pin 5 of the Dip-Switch = off

After adjusting these parameters I could not connect my PLC anymore. In other words, when I set the DM6645=1000 while I am connected to the PLC with a computer and then try to turn off the pin 5 of the dip switch, my connection will fail and after that I could never connect to the PLC, else I turn pin 5 on again. I also have tried different communication settings in order to connect to the PLC when pin 5 is off, but I could not connect it.

Firstly would you please say what is the problem with my adjustment that I cannot connect to the PLC in no-protocol mode.

Secondly, would you say how I can send a message without any start and end code with Omron PLCs? Because I want to receive data from/send data to a device when its communication protocol is "MODBUS" and I need to send some data without any start and end code (actually send datas with time intervals).

Thanks in advance,

Regards,
Ali Niknezhadi
 
J

Jerry Miille

Why not just use a protocol converter to do what you want. Very easy and not expensive. See our Omnii-Comm http://www.miille.com/din266-p00.pdf for more details. Essentially it will take care of the Modbus communications and read/write data directly to DM memory in the Omron. No PLC programming is required.

Jerry Miille
 
N

Nico Andersson

Dear Mr. Niknezhadi,

I just had the same problem a couple of days ago.
I am working with the CMP2A and CP1L PLCs and the problem was solved on both systems the same way. However - I am not sure if the solution will also work with your controller. Here is my solution.

As soon as you turn the "no protocol" mode on the PLC will only count incoming transmissions as valid if the transmissions meet specified conditions. The conditions are either a specific start code, specific end code, a specific amount of bytes or everthing together. If the incoming word does not match these conditions nothing happens.

In the CX-Programmer you have to specify the conditions. Otherwise the PLC will always look for 256Bytes as one transmission by default (as I understood it with my PLCs). Under "SETTINGS->Host Link Port" you can set the Start-code or the dataword length or the the end code by yourself. In your case you would probably just adjust the length of the expected dataword since you do not want any start or end code. And do not forget to send the settings over to your PLC too!

Now you may wonder (like I did) why you set a number of bytes to read in the RXD instruction anyway. This number just tells the PLC how many bytes from all received bytes it is suppose to store at the specified memory space. So by default the PLC will read 256 bytes of data and will only write the number of bytes (specified in RXD instruction) if these 256 bytes were received.

However - by setting your own start and end code - these will be generated during TXD instruction by the PLC automatically. The amount of bytes to send specified in the TXD command will be pure data bytes without start and end bytes.

Maybe I did not explain everthing right - but in the end I used to develop analog and digital electronics and just started programing. Therfore I am sorry if there are some errors. At least - that is the way I understood how it works.

Hope that helps,
Nico
 
Top