MTConnect.NET icon indicating copy to clipboard operation
MTConnect.NET copied to clipboard

Add Multiple Devices in Embedded MTConnect Agent

Open smtpl-iiotian opened this issue 1 year ago • 4 comments

@PatrickRitchie this is another great development of embedded mtconnect agent. I tested it for 1 machine and it worked as expected. I was able to route Mitsubishi CNC data to MTConnect agent. But I was only able to add 1 device in the protected override IDevice OnAddDevice() function.

Please guide how can I add x number of devices.

smtpl-iiotian avatar Apr 16 '24 13:04 smtpl-iiotian

Glad to hear you have found the embedded agent helpful. I intended for additional devices to be added by adding multiple configurations to the configuration file similar to below:

- haas-ethernet:
    deviceKey: VF2-01
    server: 192.168.1.101
    port: 5051

- haas-ethernet:
    deviceKey: VF2-02
    server: 192.168.1.102
    port: 5051

- haas-ethernet:
    deviceKey: VF2-03
    server: 192.168.1.103
    port: 5051

This will create an instance of the same module for each configuration.

Let me know if this works for you or if you have any other questions or recommendations.

PatrickRitchie avatar Apr 16 '24 14:04 PatrickRitchie

@PatrickRitchie very much thanks. I was able to add x number of devices after configuration update.

smtpl-iiotian avatar Apr 19 '24 14:04 smtpl-iiotian

@PatrickRitchie is there any provision in the embedded mtconnect agent to make the executable .exe as a windows service OR I have to do it manually?

smtpl-iiotian avatar Apr 19 '24 15:04 smtpl-iiotian

Yes, the embedded agent supports all of the standard command line arguments including "install" which will install as a windows service.

Command Prompt

YourAssembly.exe install

Note that you may need to run the command in a command prompt with Administrator privileges

https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent#usage

PatrickRitchie avatar Apr 19 '24 16:04 PatrickRitchie

@PatrickRitchie, I tried to install published .exe as a windows service as per the above link and guide. I added serviceName in configuration file to add multiple windows services one for Mitsubishi and another for Modbus devices but it only gets applied as a Display name as seen in the Windows Process(image attached).

MTCService

The windows Service name remains the same as MTConnect.Net-Agent. So when I try to install Modbus.exe with admin privileges of cmd the earlier windows service Mitsubishi-MTConnect.Net-Agent gets replaced with Modbus-MTConnect.Net-Agent

MTCServicename Attached snippet of configuration file

Kindly guide, If I am going wrong

smtpl-iiotian avatar May 14 '24 11:05 smtpl-iiotian

See if this is fixed in the v6.4.1 Release.

I added serviceDisplayName and serviceDescription in the configuration file:

serviceName: Mitsubishi-MTConnect.NET-Agnet
serviceDisplayName: Mitsubishi MTConnect.NET Agent
serviceDescription: MTConnect Agent to read information from a Mitsibishi Machine

I also fixed an issue with passing a configuration file path when installing the agent as a service

Please let me know if this is still an issue or if you find anything else.

PatrickRitchie avatar May 17 '24 07:05 PatrickRitchie

@smtpl-iiotian Hello, I am trying to data collect from a Mitsubishi CNC machine and I am writing a thesis on this subject, can you help me? It was written on some sites that free data cannot be collected from Mitsubishi, is this true?

koturcu avatar Jun 06 '24 13:06 koturcu

@PatrickRitchie apologies for late reply. It is working now.

smtpl-iiotian avatar Jun 12 '24 11:06 smtpl-iiotian

@koturcu explore NC Communication SDK on https://www.mitsubishielectric.com/fa/download/software/search.page?mode=software&kisyu=/cnc It is not free as said.

smtpl-iiotian avatar Jun 12 '24 12:06 smtpl-iiotian

Thank you sir

koturcu avatar Jun 12 '24 13:06 koturcu