Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can I connect siemens controller to unity3D?

Discussion in 'General Discussion' started by sangwoo_67, Aug 26, 2022.

  1. sangwoo_67

    sangwoo_67

    Joined:
    Aug 26, 2022
    Posts:
    3
    Hi, I am undergraduate student from Korea.
    I am making a simple digital twin.
    I have SIEMENS840D.
    I want to connect its signal to unity's objects.
    SIEMENS840D operate by MPF file.
    I have MPF file.
    What should I do for connect?
    If you know, please you tell me in details.
    Thank you:)
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,191
    I can't tell you about the exact configuration, I don't know what MPF files are. But having worked with various industry sensors and integrated systems that were unknown to us, the workflow usually follows this route:

    • examine the documentation of the product (Siemens 840D in your case), try to locate anything in regards to public API
      • most common case: a web frontend is provided to which you can send HTTP POST/GET methods to => inspect this API
      • alternative: device offers a UDP connection, if you're lucky that's a documented feature of the device.
      • rarely the only option you have is transfer of configuration files to the device via FTP or web API and by rebooting the device, it will use the new configuration data - sometimes you just need it to be "configured" in the right way and that's all - typically that's for media servers, just tell them where to find the video files and how to play them and that's done. I suppose that's not your use case.
      • Otherwise, programming the device itself may be necessary. We had projects where the device vendor or another system integrator built the UDP/HTTP interface to our specs, in that particular case it was an Arduino controlling the rest of the systems as a "man in the middle" device.
    • given this information, you would:
      • implement POST/GET web requests in Unity - that's easily done in Unity using WebRequest API
      • add a UDP/TCP protocol interface script, ideally written in C#, to the Unity project and use that to send/receive UDP commands. You'll probably find something on github that does what you need.
      • talk to someone who knows the device ;)
    In your case I would assume you will find something in the manual of the device regarding a Web API, however the device may need to be configured to provide that API (often disabled by default for security reasons).

    Generally speaking you can connect just about anything with Unity, the grunt work will not be Unity specific or require features that Unity doesn't have and cannot be added to it.
     
    lmbarns and Antypodish like this.
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Can you share details what is this device?
    Is this CNC?

    If you want to operate on the file level, question is, where file is stored. If is in the device, Unity won't get access there.
    If is on PC, you will need write own Unity parser.
     
  4. sangwoo_67

    sangwoo_67

    Joined:
    Aug 26, 2022
    Posts:
    3
    Yes, this is CNC machine:)
     
  5. sangwoo_67

    sangwoo_67

    Joined:
    Aug 26, 2022
    Posts:
    3

    Thanks:)
    I am going to find manual to find something about FTP!
     
  6. in2sight

    in2sight

    Joined:
    Feb 24, 2018
    Posts:
    23