Author Topic: PLC to C#  (Read 11175 times)

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
PLC to C#
« on: June 30, 2015, 09:48:39 AM »
HI !

I'm new here, I searched through the forum for anwsers and find few, so I've decided to ask my question here :P
I'm using an Omron CJ2 under OmronEthernetFINS, I try to retrieve Boolean data from it with C#.
Then I discover AdvancedHMI which allow some behaviors that I would like to do...

I just don't no if it is possible,  if yes ..  how ??

Thanks a lot :)
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #1 on: June 30, 2015, 10:46:52 AM »

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #2 on: June 30, 2015, 10:51:01 AM »
Thanks :)
- In Strange Aeons even death may die -

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #3 on: June 30, 2015, 11:49:24 AM »
I don't understand which of the AdvancedHMIControls Component should I use in a form ?

All I want to do is : "in a form.cs,  be able to show the value of my CJ2 PLC input (I took a mushroom button and set an input to true or false)"

My PLC  is connect at the IP adress 192.168.0.149, under the ID 10.10.3.40 there's the mushroom button plugged in at the adress  CIO0000.00

I supposed that I should insert the driver omronEthernetFINSCom and give him the IP adresse  192.168.0.149 in the properties panel....for the rest I'm stuck, may someone help me please :)
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #4 on: June 30, 2015, 12:05:03 PM »
- Add an OmronEthernetFINSCom to the form
- Set IPAddress to the address of your PLC
- Add a BasicIndictor to your form
- Set PLCAddressValue to 0.0
- Run the app

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #5 on: June 30, 2015, 12:20:23 PM »
thanks for the help,  it doesn't work at all :(

in the properties table of the basicIndicator I haven't the tab PLCAddressValue :(

I'll continue my researches :(
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #6 on: June 30, 2015, 12:23:12 PM »
My mistake.... PLCAddressSelectColor2


I'm also not sure what you mean by "under the ID 10.10.3.40". Is that another IP address?

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #7 on: June 30, 2015, 01:05:45 PM »
i'm not sure too, since I use KEPServerEX as my OPC Server, I think it's an ID that the server give to this PLC, understanding the Server may have many other PLC
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #8 on: June 30, 2015, 01:30:20 PM »
If you are using OmronEthernetFINSCom, then an OPC server has no relevance. You only need to know the IP Address of the PLC. The drivers do not use OPC (except OpcDaCom)

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #9 on: July 01, 2015, 08:56:03 AM »
Can an OPC Server blocks device that want to communicate with PLC which are plugged in ??

I'm trying to communicate with a PLC to get its datas and then write data in it.   

Probably its my addresses which aren't good, but with
  • the BasicIndicator : PLCAddressSelectColor2 : <addresse of the tag (0.0)>
  • even if I set the IP address of my driver omronEthernetFINSCom to be the same as the network Card :  192.168.0.149


where did I go wrong ?
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #10 on: July 01, 2015, 09:05:20 AM »
The OPC server could be affecting it. I found with Omron that when I am online with CX-Programmer at the same time as running the HMI, the communication will get very bad.

As a simple test just add a BasicLabel and set the PLCAddressValue to D0

If you open a Command Prompt window, can you ping the IP address of the controller?

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: PLC to C#
« Reply #11 on: July 01, 2015, 09:10:47 AM »
yup I can :\
- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #12 on: July 01, 2015, 09:28:13 AM »
Did you try the BasicLabel? If there is an error, it should tell what it is. If it is working, it will change to value.

One other other is to try to change the ProtocolType on the driver.

If none of that works, you may have to install WireShark to do a packet capture and post it,

pe.vallee

  • Newbie
  • *
  • Posts: 18
    • View Profile
PLC to C#
« Reply #13 on: July 01, 2015, 10:36:18 AM »
I've install WireShark,(never use it before) set filters to Omron (since it is an Omron PLC  that I used).
I can see that the PLC (192.168.0.149) is talking (never stop !!)  with the input ID (10.10.3.40).
But when I manually toggle the button ('cause it's a button which is plugged in the PLC for my test).

I cannot see any difference of message from when the Boolean is set to True or False
Is there any way to see the message throught a network sniffer ?



- In Strange Aeons even death may die -

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: PLC to C#
« Reply #14 on: July 01, 2015, 10:43:55 AM »
Those requests are coming very fast. Set the PollRateOverride of the OmronEthernetFINSCom driver to 1000

That should slow the reads to every 1 second.

If you save the capture and post it, I can see if you are getting any errors.