Author Topic: Not reading from CJ2M CPU  (Read 11327 times)

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Not reading from CJ2M CPU
« on: June 08, 2015, 02:13:54 PM »
I've used AHMI with a Click PLC across modbus/tcp with no problems. I have been trying to read/write to an OMRON CJ2M with OmronEthernetFINSCom with no luck. I have the IP set at 192.168.250.11 and the network & node at 0. I'm trying to read D0 & W1.02 but not having any response. There are not errors either. I can create a basicbutton and turn on bit w1.02. I'm using Visual Studio 2013.  Does my PLCAddressValue have to be set to something other than D0 or W1.02?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #1 on: June 08, 2015, 07:45:44 PM »
I don't have a CJ2M to test with, but I did a quick test with a CP1H and everything worked as expected. This is the test I did:

- Add an OmronEthernetFINSCom to the MainForm
- Set the IP Address to the address of my controller which is 192.168.0.1
- Set my laptop IP Address to 192.168.0.99
- Added a BasicLabel to the form
- Set PLCAddressValue and PLCAddressKeypad both to D0
- Ran the application
- Clicked on the BasicLabel and entered a new value
- The BasicLabel then showed the new value from the PLC

My program in the PLC decreases the value of D0 until it reaches 0 just so I can see the value is being continuously updated from the PLC.

The best way for me to see exactly what is happening is for you to run a WireShark capture while reading/writing data, then post the capture. I will be able to see the data going to the PLC and whether it is responding.

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #2 on: June 09, 2015, 09:16:41 AM »
Here is my Wireshark capture.
I started a new HMI file with only an OmronEthernetFinsCom set to 192.168.250.11 and a BasicLabel to Read/Write D0.
My Computer IP is set to 192.168.250.55

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #3 on: June 09, 2015, 09:26:01 AM »
I would need the actual saved file from WireShark

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #4 on: June 09, 2015, 09:38:16 AM »
My apologies...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #5 on: June 09, 2015, 02:02:35 PM »
This is what I am seeing. Packet 5 is the request for D0. The PLC acknowledges that is received it in Packet 7. However it never responds with any data.

Searching around the internet I see some mentions of the CJ2 supporting UDP. One person even mentioned something about changing the port or disabling UDP. Do you see any kind of settings for both UDP and TCP? The AdvancedHMI driver only uses TCP.

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #6 on: June 09, 2015, 02:34:21 PM »
I tried changing the Fins/UDP port with no luck.
These are some settings that can be changed on the PLC

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #7 on: June 09, 2015, 02:38:31 PM »
If you changed the UDP port to User Defined and something other than 9600 and it made no difference, then maybe there is a node problem.

There are  addresses sent in the packet.

DNA - Destination Network Address
DA1 - Destination Node Address
DA2 - Destination Unit Address

In the Wireshark capture, all of these are showing 0. Are there any other settings in the PLC that may have changed these from 0s?

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #8 on: June 10, 2015, 12:37:47 PM »
I don't believe they were changed anywhere else in the program/settings. I found a CJ1M-CPU11 and connected that up (no ethernet/ip option on it). Same problem. I can write to bits & words but i cannot read any data.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #9 on: June 10, 2015, 06:56:42 PM »
I am running out of ideas on this. The Wireshark captures are showing the correct FINS request going to the controller and the controller even acknowledges that it received it, but never responds with data. The only controller I have that supports FINS/TCP is the CP1H, so I am unable to test with the same hardware.

Do you have any other software such as an OPC server that you can use to read D0 and do a WireShark capture? From that I can see how the packets compare. I was looking at the Kepware OPC server, but it shows that it only support UDP and not TCP.

One more things to try. In the OmronEthernetFINSCom1 driver properties, set the TargetNoteAddress to 11, which is the last byte of the PLCs IP Address. I remember having to do something like that on a CS1 controller.

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #10 on: June 11, 2015, 07:55:37 AM »
I've changed the TargetNodeAddress and TargetNetworkaddress with the same results or no communication at all. I just installed and ran Kepware on my computer and was able to read data from the PLC. However, it is only communicating UDP. Here is a wireshark capture of the Kepware session.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #11 on: June 11, 2015, 08:10:40 AM »
I do see one significant difference from the KEPWare packet. Attached is patch that will change the 1 byte to the same as what is used on the KEPWare driver.

- Download and extract the attached file
- Replace the file found in AdvancedHMIDrivers\Support with the attached file
- Open solution in Visual Studio and do a Rebuild Solution

If it doesn't work, post another WireShark and I will compare further.

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #12 on: June 11, 2015, 11:37:42 AM »
Still getting the same behavior. I did a wireshark capture with the UDP port set to 9600 and one with the UDP port changed to 9650.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Not reading from CJ2M CPU
« Reply #13 on: June 11, 2015, 12:00:19 PM »
It doesn't look like the patch applied. I'm still seeing the 0xff in the capture where it should be 0x00

Check in your AdvancedHMI\bin\Debug directory to see what the date is on the file MfgControl.AdvancedHMI.Drivers.dll

It should be today's date at 8:07AM

fbowman3

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Not reading from CJ2M CPU
« Reply #14 on: June 11, 2015, 01:09:03 PM »
I verified the patch update. Copied & replaced the driver.dll file and rebuilt the solution. still getting the 00xff.