- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
In this How-To we present a demo example of a custom user interface for the Motion App running as a webserver in ctrlX OS.
In the following picture we can see an overview of the system that is presented in this How-To. In summary, ctrlX OS native websevers are available through the port 8443, whereas our custom one speaks and listens in port 5000. We also see how the apps interact with the datalayer nodes.
1. Requirements
- ctrlX OS 2.xx. installed in a ctrlX CORE device (X3, X5, X7 or virtual)
- Offical Bosch Rexroth Motion App
- Source code for custom Python webserver app
This project has been developed from the example in the official Bosch Rexroth app development SDK. If you want to have access to the specific source code of the implementation presented in this How-To, do not hesitate to leave us a comment and we will contact you.
2. ctrlX OS setup
The Motion app allows the user to define axes, which can be mapped later to a Profile that connects the defined axis object with the hardware. Axis can then be grouped in the so-called kinematics, this allows to define specific machine mechanical architectures, as it can be a Cartesian robot presented here.
2.1. Define 3 axes
Go to the Axes tab in the Motion app.
We need to first bring the Motion app to configuration state:
After that we are allowed to define new axes by clicking in the blue "+" (or a big ¨+¨ symbol in the middle of the screen if you do not have any axis yet).
Generate 3 axes called "AxisX", "AxisY" and "AxisZ" with the configuration you can see in the image.
NOTE: These names are used by the websever, so keep it consistent.
2.2. Map the axes with the hardware profiles (optional)
In this example we are working with virtual axes, so they are not mapped to hardware. If you are working with real drives, follow the common steps to set this up.
2.3. Define a Cartesian kinematic
Go to the Coordinated Motion tab.
Bring the Motion app to configuration state, if it was not there already.
Now you can add a new kinematic with the blue ¨+¨(or a big ¨+¨ symbol in the middle of the screen if you do not have any kinematic yet).
Define a ¨Cartesian¨ kinematics called ¨Kinematics¨. Again, the naming is used by the Webserver, be coherent with it.
Now, let's add the previously defined axes to this kinematic. Click on the ¨Kinematics¨ picture/text as depicted in the next image.
You can connect the axes to the kinematics clicking on the pencil.
After this step, you can bring the Motion app back to ¨Running¨state. Make also sure that the whole ctrlX is in Operating State (Not setup, not Service).
3. Webserver functionalities
Now, you are ready to interact with the websever. You can open it by clicking under ¨Webserver¨ tab in the lateral menu, a new window will start with the server. You may need to tell the browser that it is safe place manually.
NOTE: If you are working with ctrlX CORE virtual, do not forget to use port forwarding and map port 5000:5000. It is the port where the server is externally available.
If everything was fine, you should see this.
You could already use the webserver, but let's monitor its operation by looking at the Commissioning Tab for Kinematics.
You must see something like this:
Now let's go back to the webserver and press ¨Power¨. You will see how the button changes color from ¨Red¨ to ¨Green¨. You can see how the kinematics have been powered up.
Let's commision something from the webserver. Write some numbers under ¨Target position¨ and click ¨Start¨ in the webserver. You will see the actual position of the axis in the Comissioning Tab. You can stop this movement at any time by clicking ¨Stop¨ in the websever.
To power off the axis click the ¨Power¨ button in the webserver again, it will turn ¨Red¨. You can inspect the result of this operation in the commissioning tab.
4. Conclusions
In this How-To we have seen how we can design a custom webserver that can interact with ctrlX OS. In particular we are using the Datalayer-API that the Motion app provides, as well as interacting with custom messages (defined as flatbuffers) with the Datalayer.
If you found this post interesting do not forget to leave a like!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.