CDP-Studio was used to make a dashboard to have a aoverveiw of the actual and target speed of the 8 motors, aswell the actual and target position of the end-effector. The PLC publishes these topics:

  • cabot/output/targetmotorspeed
  • cabot/output/actualmotorspeed
  • cabot/output/targetposition
  • cabot/output/actualposition

over MQTT. The problem is that the published string is on the format: "motorSpeed1, motorSpeed2, ..., motorSpeed3", this string needs to be parsed, this was done by using a python script to subscripe, then parse the string into 8 new publishes, the new publishes are unde the topics:

  • cabot/parsed/targetmotorspeed
  • cabot/parsed/actualmotorspeed
  • cabot/parsed/targetposition
  • cabot/parsed/actualposition

With a number behind the topic to indicate which indicate which motor it applies to. 


To have a MQTT broker run locally on the system mosquttio was used, its setup process is showcased in 24_7 Mosquitto setup. To setup a subscriber in CDP is quite simple. After creating a project, the NetworkInterface needs to be edited to correct IP(127.0.0.1) and SubnetMasK(255.255.255.0) furthermore, add a MQTTClient to the project. Within the MQTTClient some changes needs to be done before the subscriber works, the Broker host and port needs to be set to the correct settings, these should be 127.0.0.1(localhost) and 1883 respectivly.

Now the subscriber topics can be added to the MQTTClient, for our dashboard the MQTTIO.subscribeTopic<string> was used. The dashboard has 4 unique MQTTClients:

AMS, TMS, AMP, TMP are the acronyms of the topics: ActualMotorSpeed, TargetMotorSpeed, ActualMotorPosition, TargetMotorPosition. The topics are then added to the MQTTClient with the topics:

This is for the MQTTClientAMS, and are like this for the other clients aswell. 


The dashboard is then designes as:

Where the motors actual speed is on the left half on the meter, and the target speed on the righthand side.




  • No labels