Thor Hammer

Omron CP1E Serial Comms and Checksum Calc

6 posts in this topic

So I have never setup serial communications before. I have learned a lot in my research the past few days but I am new to this so...go easy on me.

I have an Omron CP1EN40S1DR-A with built in RS485 port. And an Omron NS series 5" color touch screen. I need to send and receive commands with a Thermoscientific Recirculation/Chiller bath. The communications protocol in the Chiller manual is listed as NC Serial Communications. All data is sent and received in Hex according to the manual. No ASCII conversion allowed or utilized.

I believe I would set my PLC to communicate in No Protocol mode but this option is not available in the pull down list on the Serial Options Port tab. I don't know what settings to use. I have been through the CP1E manuals and all it shows is RS232 and Modbus Easy Master.

Any help greatly appreciated.
 
I have started to populate my MOV instructions with the command string in Hex. I am stuck on how to handle the Checksum. The chiller will not send a response without the checksum attached. According to the manual it is a bitwise inversion of the sum of the bytes in the checksum region. I take that value and XOR it with FF hex to get the bitwise inversion value.
 
Can this be done with simple add instructions in ladder logic? Then perform an XOR? what instruction for that? Even if I can generate my checksum value how do I then add it to my command string? And what do I compare it to? Wish I could just leave it off!
 
Manual pages attached and  my code so far (Serial_Comm) file. I have a long ways to go. All I want to do in this instance is read alarms, send a value for temp setpoint in 5 recipes and read the current setpoint. Pretty simple, but challenging to implement!

NC Serial Thermofisher 2500.pdf

8262_PLC_V5.cxp

Share this post


Link to post
Share on other sites

Oh and if I am not mistaken CX-Protocol does not support CP1E series. Only CP!H. Is that correct?

Share this post


Link to post
Share on other sites

It looks like the Thermofisher has a proprietary protocol. You would be better off to test commands using a Windows terminal program. This way you could test your checksum calculation. Once you know the math it will be easy to do from the PLC ladder program.

The PLC instruction set has all the math you'll need as well as any logical instructions like XOR. To do the addition in Hex you'll need to specify any constants with a preceding "#". This will denote the value as Hex. Preceding with a "&" will denote the value as Decimal.  

When you assemble the Hex values in consecutive order you can then use the TXD(236) instruction to send it out the serial port. If you are expecting a response then you can use the RXD(235) instruction to read it. CX Protocol will not be needed.

 

 

Edited by IO_Rack

Share this post


Link to post
Share on other sites

Thank you for the reply! I spent a lot of time on this yesterday. I have done exactly as you suggested. I created a subroutine for calculating the checksum and then moving that to a DM location at the end of my hex command string. All in consecutive order. I understand the difference in CX-Programmer #. & hex/decimal.

 Do I need a start and end code? I think that is optional. Or is it required?

Thanks again!

Share this post


Link to post
Share on other sites

The start and end code will be a requirement of the Thermofisher.

The options you see in the port settings are there for a convenience. If you set them, they will appear in every frame going to the Thermofisher. Alternatively, you write these values in your hex string.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now