S2N1992

CP1E host link communication via serial port gives IC error code for Timer SV Read

28 posts in this topic

Hi,

    I'm trying to communicate Omron CP1E unit with PC via serial port using hostlink protocol.  I need to read the Timer/Counter SV value and write the timer/counter SV values to the PLC.  I'm able to use other C mode commands (like RC (timer/counter PV read), WC (timer/counter PV write) etc.) but when I give the command for Timer/Counter SV Read 1 which is R#, I get the response as IC (Undefined Command).   How do I write or read the timer SV Values? 

Example command and response :

@00R#TIMH001028*  (TIMH is the high speed timer, 0010 is the timer number and 28 is the FCS)

Response:

@00IC4A*

Is is that CP1E doesn't support these commands? If so what is the equivalent command that I should send inorder to perform this?

Please help.

 

Edited by S2N1992
1 person likes this

Share this post


Link to post
Share on other sites

I do not have a CP1E, but I just tried this with a CP1L and received this response:

@00R#00006433*<0D>

When I sent this command:

@00R#TIMH001028*<0D>

I used Timer 10 in a TIMHX instruction and the preset (and present) value of T10 is &100 (0064 Hex), so it works with a CP1L.

I cannot find anything in the Communication Commands Manual (W342-E1-15) that indicates that the CP1E does not support this instruction.  If you cannot get it to work for some reason, just use a P_On contact with a MOV instruction to move it to a Data Memory , or Work area address or something and then use the appropriate C-Mode commands to retrieve it from that address.

Share this post


Link to post
Share on other sites

Check to see if you truly have a TIMH 0010 in the program.  Also try using a TIM 1 and use @00R#TIM 0001 command

Share this post


Link to post
Share on other sites

I tried that Jay and it gives this error:

@00R#1636*<0D> 16 means "Command Not Supported", which is misleading....

It does not give the IC response.

Share this post


Link to post
Share on other sites

Did you include the space between TIM and 0001?  Also, does this have anything to do with BCD or Binary timers/

Share this post


Link to post
Share on other sites

I was referring to the fact that I issued the @00R#TIMH001028*<0D> command when the timer was a TIMX timer.  When I change the timer to TIMHX, it worked just fine.

I also tried @00R#TIM 001028*<0D> (with the space) and I received this response as well:  @00R#1636*<0D>.  When I changed the timer from TIMHX to TIMX, this command then worked:  @00R#TIM 001028*<0D>.

I did not try it with straight TIM and TIMX (BCD) timers. 

To summarize:  I tried both the TIMH and TIM(space) host link commands.  When a the timer existed for that number of the proper type (TIMHX and TIMX respectively), I received a valid response.  When I changed the timer in the PLC to the wrong type (TIMX and TIMHX respectively), I received the 16 error response.  I did not try with the BCD versions of the instructions (TIMH and TIM respectively).

Share this post


Link to post
Share on other sites

You've been busy...:-2

Share this post


Link to post
Share on other sites

Hello, I'm currently doing a project of using a HMI software (Indusoft Web Studio) to communicate with my PLC (CP1E-NA20) from my PC using PLC built in RS232 serial port. It would be a directly connected from my PC to the PLC via serial-USB cable (prolific).  Can you share with me your ladder code/program for C code/ FINS command for CP1E PLC? My Email is umar9876@yahoo.com.

Thank you

Share this post


Link to post
Share on other sites
On 5/24/2017 at 0:30 AM, umar9876 said:

Hello, I'm currently doing a project of using a HMI software (Indusoft Web Studio) to communicate with my PLC (CP1E-NA20) from my PC using PLC built in RS232 serial port. It would be a directly connected from my PC to the PLC via serial-USB cable (prolific).  Can you share with me your ladder code/program for C code/ FINS command for CP1E PLC? My Email is umar9876@yahoo.com.

Thank you

If you are asking me this question, I did not have any code.  I simply hooked my laptop up to the PLC and issued commands using a hyperterminal-like program.  The PLC responds automatically. @S2N1992 may have some code that he developed.  Not sure if he can share it or not.

Share this post


Link to post
Share on other sites

If you are using Indusoft, when not use the Omron driver?

Share this post


Link to post
Share on other sites

Hello, thank you for replying.

On 5/26/2017 at 2:43 AM, Michael Walsh said:

If you are asking me this question, I did not have any code.  I simply hooked my laptop up to the PLC and issued commands using a hyperterminal-like program.  The PLC responds automatically. @S2N1992 may have some code that he developed.  Not sure if he can share it or not.

Does that mean the PLC dont have to be specifically program with any ladder code/program to give response to  the C code/ FINS command from my PC? Does this mean I can send the command from hyperterminal (ie. Realterm) directly?

On 5/27/2017 at 6:47 AM, Jay Anthony said:

If you are using Indusoft, when not use the Omron driver?

I did tried with OMRON driver (OMETH and OMPLC) but both did not respond, and CP1E seems to be using a different header code for hostlink and FINS command, which somehow I cant change it. Will be waiting for the reply soon. (SOLVED)

EDIT: It turns out I dont need to change the header. It was all about the setting. I think it was I disable DTS in Advanced setting of OMPLC driver.

Thank you.

 

 

Edited by umar9876

Share this post


Link to post
Share on other sites
On 5/29/2017 at 2:37 AM, umar9876 said:

Does that mean the PLC dont have to be specifically program with any ladder code/program to give response to  the C code/ FINS command from my PC? Does this mean I can send the command from hyperterminal (ie. Realterm) directly?

Yes as far as not needing a program in the PLC to respond to a Host Link command, if the port is set up as Host-link, it will automatically respond to a proper host link command.  Yes, you can send the command from a hyperterminal - like program.

1 person likes this

Share this post


Link to post
Share on other sites

Hello, thank you very much michael for your reply to my question, it has help me alot. I tried looking into OMRON manual for serial communication (W342) and figured out the C code command I would like to try: @00RD0000001057*<CR> which is to read DM0000 to DM0009 area. My question is

1. Is that the right command code? and do I have to type that CR? 

2. Can I use a normal USB-RS232 cable (currently using Prolific USB-Serial cable) for serial host link with OMRON PLC or do I have to make some modification to the cable? or do I really have to buy OMRON RS232 cable. 

EDIT: I tried sending the command using RealTerm hyper-terminal, and I got a reply (PLC1). At first, it wasnt working until I clear RTS and DTR pin (PLC3).

 

 

Thank You

PLC1.PNG

PLC3.PNG

Edited by umar9876
1 person likes this

Share this post


Link to post
Share on other sites

So, you figured out that you need to make (or buy) a special cable.  Glad to see that you got it to work.

Share this post


Link to post
Share on other sites

By the way, here is a timely post similar to this discussion:

This is VB.net, but may be helpful.  

Share this post


Link to post
Share on other sites

You should check out the entire site.  It is awesome!  :dance:

http://www.accautomation.ca

 

Share this post


Link to post
Share on other sites

Hello, thanks everyone replying and helping, I was able to figure out the solution to my problem. It turns out I dont need to change the header for OMPLC driver in Indusoft. It was always working fine, so I figure the problem was with the setting which is the DTS pin. I was able to control my PLC from my Indusoft runtime and read its IO. The only thing to do now is to explore it even further. 

Thank You!!!

Best regards, Umar from Malaysia.

Share this post


Link to post
Share on other sites

Hi everyone,

I got difficulties to get a connection between PC an PLC CP1E using serial connection. 

Pc com1 port configuration: 9600, 7,2,E

PLC rs232 settings: 9600, 7,2,E - host link

cable configuration:

pc d-sub9 female---------plc d-sub9 male

housing---screen----housing

2----------------2

3----------------3

4-5           4-6

                 7-8

9----------------5

When i am trying auto online option I  can see that diode is blinking but connection attempt is failed in the end. What am I doing wrong? Please help.

pcPlc.png

Share this post


Link to post
Share on other sites

Your cable is wrong. Should be:

pc d-sub9 female---------plc d-sub9 male

housing---screen----housing

2----------------2

3----------------3

4-6                     4-5 

7-8

5----------------9

Share this post


Link to post
Share on other sites

i have cable like You described it , i put it wrong in previous post. But still doesnt work. please advice me smth. i bought cable to make sure that is not cable, also new serial port do pc and still nothing. how to proceed?

Edited by inteligo461A

Share this post


Link to post
Share on other sites

Have you connected to it via USB?

Upload the settings via USB then set then verify the serial settings. Set you connection serial settings to match. Default settings are 9600, 7, E, 2. Auto Online can be touchy sometimes (at least it used to be in older versions).

Share this post


Link to post
Share on other sites

That is excatly what i do, i have tried few configuration of port in PLC, and yes i am changing settings of com port in PC. Below is pic of com port scanner and there is some connection but it doesnt rcognize cpu, maybe this is a problem?

file.jpeg

Edited by inteligo461A

Share this post


Link to post
Share on other sites

Is your software up to date?

Run the Omron Automation Software AutoUpdate utility.

Share this post


Link to post
Share on other sites

Version of cx is 9.03. Below are settings I uploaded pic with and video of com port reaction while autoonline is on. cable is usb-com, i bought it to make sure that it isnt cable foult. And it seems that problem is on PLC side. But i have no idea what that can be. Its 3rd day i am fighting with this, i need some breaktrhu moment,  help me please....:D Video is too big to upload it

but led is blinking as hell so there has to be connection. The com port test says that data were transmited and i can see led blinks each time i press send. Maybe it doesnt get confirmation from PLC, if yes, how to fix it?

file.jpeg

file1.jpeg

file2.jpeg

com test.jpg

Edited by inteligo461A

Share this post


Link to post
Share on other sites

Run the Omron Automation Software AutoUpdate utility.

I don't know exactly how old 9.03 is but I'm willing to bet the CP1E was not in production then. Current version of CX Programming is 9.65.

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