Grandma’s Recipe: Beckhoff Twincat in MQTT under 15 minutes
Today we were expecting a client to be happy about having his Twincat PLC variables in the cloud. While we were explaining what we were doing, he said: “I have to stop you there!”. So we entered into listening mode, and we got quite excited to hear his feedback! He started, “that is quite a salesman speech. It simply impossible to have it so easy all Twincat variables in an IoT platform.” We got stunned…
We felt that we were failing as a salesman actually because he couldn’t believe it and we did it several times. So we decided to say :
Grandma’s Plant “My Grandma’s has a DIY recipe for that in her plant!
She calls it Beckhoff Twincat in MQTT under 15 minutes. We are going to show it to you. And if we are able to do it in 15 minutes, we can post this story in our blog. ”
“Show me then!”
So let’s get into the Recipe.
1 Prepare Coreflux (00:00:34s)
Install the Beta version of Coreflux for windows in my computer, in this case. It took all 34 seconds so…
Installation Coreflux 2 Prepare Flux Assets Broker (00:01:02s)
After finding the Coreflux HUB in the desktop, we opened and installed the Broker Flux Asset.
Broker MQTT prepared 3 Prepare Flux Assets ADS2MQTT(00:03:12s)
So here comes the toughest part of our recipe. As Grandma’s taught us we have to go to the System manager and check out our ADS Address. Then you select the FLux Asset ADS2MQTT and install it, and the configuration appears.
Preparation of ADS2MQTT Flux Asset Afterwards, we should start the ADS2MQTT and check if it is running.
ADS 2 MQTT Flux asset 4 Check the variables in MQTT FX (00:04:52s)
After less than 5 minutes, check your variables in the MQTT FX.
MQTT and Twincat variables Results
What we were able to accomplish, we had all PLC Variables in Coreflux and were able to get them via a C# application and a python app. That we were developing in between an hour. Our Grandma’s Recipe was a success, and we were able to access all variables and gather every variable change if needed. The system worked based on demand, and we can only connect the necessary variables by subscribing them. However, if we subscribed to all variables, we had every 1 millisecond an update. Which is not bad.
Still, there is an engineering culture in Industry that all data should flow at 1second. Also, there is a ton of “fears” and “superstitions”. The most common is that the plc might not be able to compute the code if it is sending data. Nowadays the ARM9 400 MHz is equipped in the Beckhoff CX8090, and it can do more than 300 MIPS ( Millions of Instructions Per Second). Sending a variable through an ethernet port which also is equipped with its own Communications Module it is not a problem, we have enough bandwidth to provide data to new systems.
Nothing should stop nowadays if it makes sense an industry into...