AdvancedHMI Software
General Category => Support Questions => Topic started by: pe.vallee 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 :)
-
See this:
http://advancedhmi.com/forum/index.php?topic=774.0
-
Thanks :)
-
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 :)
-
- 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
-
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 :(
-
My mistake.... PLCAddressSelectColor2
I'm also not sure what you mean by "under the ID 10.10.3.40". Is that another IP address?
-
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
-
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)
-
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 ?
-
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?
-
yup I can :\
-
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,
-
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 ?
-
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.
-
That capture is not reads coming from AdvancedHMI. I ran a quick test using address 0.0 and the memory area code is different. The AdvancedHMI driver doesn't have support for a read area code of 0xb0
-
Yet I started the DEBUG Visual Studio. I do not understand why I can see in WireShark
-
Do you still have the OPC driver running or CX-Programmer? What ever is communicating is reading every 10ms which is not giving AdvancedHMI a chance to get any communications in.
-
I shut the OPC Server down .. I don't know what is talking... :\
-
If you run WireShark without AdvancedHMI running, do you still see all of the Omron packets?
-
yes, even if both, the server and the AdvancedHMI are off, there's still packets. I resolved the question.... I used a switch between my CPU and my PLC, the switch give my PC an internet access..
the Omron packets are between the switch and the PLC.. when I disconnect the plc from the switch and plug it in my PC, the packets stop,
but even if I bypass the switch, I cannot sniff any AdvancecHMI packets from WireShark...
-
I'm kind of confused with your 2 IP addresses. They are on 2 completely different subnets, therefore must pass through a router somewhere. Was the switch you bypassed by any chance a router?
Are you now directly connected with an ethernet cable from your PC to your PLC?
-
this is the switch I used : http://ca.dlink.com/products/connect/8-port-gigabit-desktop-switch/ (http://ca.dlink.com/products/connect/8-port-gigabit-desktop-switch/)
if I bypass it to connect VIA an Ethernet cable my pc to my plc I will no longer connected to the internet but I'll have a direct link to my plc
-
You need to get your PC and PLC on the same subnet. For example the PC IP address of 192.168.0.5 and the PLC 192.168.0.10
The 10.xx.xx.xx is another private network but on a different subnet.
-
IT WORKS!!! AT LAST !!
The IP address 192.168.0.149 is the address of my Network Card the IP address 10.10.3.40 is the address of my PLC the switch give to it .. don't know why I haven't thought of it before !!
-
Many thanks for your help and for your time !!
I'll to work with the Advanced HMI :)
Best Regards !!!
-
One last question about that... :P
If, instead of a Form I want to use a console application.
I've create and Driver Object
private static AdvancedHMIDrivers.Omron.OmronEthernetFINSCom o_IPAdress = new AdvancedHMIDrivers.Omron.OmronEthernetFINSCom();
and then give him an IP Address
o_IPAdress.IPAddress = s_address;
Then, I got this exception throwed by OmronEthernetFINSCom.vb
System.Exception was unhandled
HResult=-2146233088
Message=Incomplete Solution
Source=MfgControl.AdvancedHMI.Drivers
StackTrace:
à MfgControl.AdvancedHMI.Drivers.Omron.FinsTcpDataLinkLayer..ctor()
à MfgControl.AdvancedHMI.Drivers.Omron.FinsTcpDataLinkLayer..ctor(String ipAddress)
à AdvancedHMIDrivers.Omron.OmronEthernetFINSCom.CreateDLLInstance() dans C:\Users\pe.vallee\Documents\Visual Studio 2013\Projects\PLCToFileThread\AdvancedHMIDrivers\Omron\FINS\OmronEthernetFINSCom.vb:ligne 133
à AdvancedHMIDrivers.Omron.OmronEthernetFINSCom.set_IPAddress(String value) dans C:\Users\pe.vallee\Documents\Visual Studio 2013\Projects\PLCToFileThread\AdvancedHMIDrivers\Omron\FINS\OmronEthernetFINSCom.vb:ligne 31
à PLCToFileThread.PLCToFileThread.Main(String[] args) dans c:\Users\pe.vallee\Documents\Visual Studio 2013\Projects\PLCToFileThread\PLCToFileThread\Program.cs:ligne 49
à System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException:
What did I do wrong ?
-
Incomplete Solution means there is something missing from the project. Maybe the controls references or some of the drivers. AdvancedHMI only works as a compete solution with all of its original components and references.
-
I did what you suggest :
- Create a C# Form project in the solution AdvancedHMI
- Insert the driver OmronEthernetFINSCom and give if the IP address
- Create a basic label and linked it to the address 0.0 of my PLC
While executing the debug, I can see the value of the label change immediately when I toggle the button plug in the PLC address,
what is the basicLabel1
property or method to call to acces the value of the label from the Console ?!
I tried in an while( true )
loop the codeConsole.WriteLine( "basicLabel1 : " + basicLabel1.value);
( and many other properties and method but I can't see the value printed in the console..
even a basicLabel1.Refresh(); before the Console.WriteLine(); but it doesn't work :(
-
at last , I finally found my problem ....
in my Main I wrote
basicLabel1.ValueChanged += basicLabel1_ValueChanged;
and in basicLabel1_ValueChanged() I wrote
Console.WriteLine( "basicLabel1 : " + basicLabel1.Value );
finally!!! :P
-
For a console app, you could read directly through the driver:
Dim MyValue as string = OmronEthernetFINSCom1.Read("D0")
-
I've got an error message if I had these lines of code :
var _msg = driver.Read( "d0", 1 ); Console.WriteLine( _msg );
An unhandled exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in AdvancedHMIDrivers.dll
Additional information: No reponse from PLC. Ensure baud rate is correct.
If I add a BasicLabel and set its address at "0" I can get the value, but as soon as I add the Console output code, even if I didn't change the baud rate, I got this error.