This is a recipe to setup a free test system for using the CODESYS library, co⚡e: Sparkplug™ MQTT edge and host, with Ignition by Inductive Automation acting as the Primary Host.
If you follow this recipe closely it "should" take you between 1 or 2 hours, depending on your experience.
Need any help? -> Drop us a question, we are happy to assist you.
On choosing your Ignition SCADA Flavor
It's up to you to decide which flavor of Ignition you wish to run as they are identical but differ in use-case scenario.
The provided information is not intended as advertisement but merely to provide you with enough information for you to make a choice on what installation is best suited for you.
Ignition Maker Edition has powerful industrial-grade features of Ignition Enterprise by Inductive Automation️® to any number of your personal or educational projects
at no cost. All you need is a permanent internet connection for it to work (so called 'always connected'). This seems for most purposes the optimal choice.
This is the full fledged version of Ignition Enterprise SCADA. Without proper licensing it runs in a DEMO trial period for 2 hours.
The trialperiod can be extended an unlimited amount of times by a single push of a button.
Pick any flavour you like (Maker Edition has no time-out)
Agree the terms
Set up a memorable username and password
Once it starts, go to Config > System > Modules > Quarantined Modules > MQTT Engine > Install
You now have an Ignition server with MQTT Engine installed.
You did it!
Running an application
Start MQTT.fx to monitor the topics:
If not already started, start your Debian10-ignition-mosquitto. No Need to login to linux.
Launch MQTT.fx from Start menu or C:\Program Files\mqttfx\mqttfx.exe
Press the gear to add your MQTT Server
Press the + down the bottom to add a new Server
Give it a profile name, the IP address of your mqtt server, generate a client ID, then press OK
Go to the subscribe tab, and subscribe to the following topics:
Switch the payload decoded by to Sparkplug Decoder
Start Ignition, to wait for connections:
If not already started, start your Debian11-ignition-mosquitto. No Need to login to linux.
By default, Ignition MQTT Engine will automatically connect to the local MQTT Server, so this does not need setup. If you need to set it up, use http://ip-address:8088 > Login > Config > MQTT Engine > Servers > Create new or edit.
The easiest way to browse tags is through designer. Login to http://ip-address:8088 then press the Get Designer button to download the installer.
Once installed launch designer. If your Gateway isn’t there, Add Gateway > Manually Add Gateway and type in http://ip-address:8088 before pressing “Add Gateway”.
You should now see the Gateway, click Launch to launch designer. Login.
Create a new project
Use the defaults, but give it a name and title.
Looking at the tag browser, you should currently see no sparkplug nodes.
Install the co⚡e library:
Now go back to the folder where you downloaded everything. Double click the co⚡e.library to open it.
Press the filing cabinet icon “Save Project and Install into Library Repository”
Configure the example project for your CODESYS runtime:
Back to the folder where you downloaded everything. Double click the co⚡e example project to open it.
These steps are CODESYS 101. You should do this for every example project you open:
Cancel the initial dialog asking about updating compiler etc.
Right click Device in the Devices view, And select “Update Device”
Select the actual version of your PLC runtime and hit “Update Device”, wait for it do its thing, then hit “Close”
Project > Project Environment > Set All to Newest > OK > OK
If your PLC is not running, start it now from the system tray. If you haven’t purchased a license, the PLC will stop after 2 hours, and the CODESYS MQTT Client SL will stop working after 30 minutes. If this happens you will have to stop it and start it again.
Double Click the Device in Devices Tree, and go to the communication Settings Screen. Scan your local Gateway, and double click your local PLC. (ProTip: If you want this much nicer view, Tools > Options > Device editor > Communication page > Classic mode)
Open PRG_FB_EoN_Node, and change the server URL to the ip address of your MQTT server.
As this is a private Mosquitto, we will change test scenario to 2 as well.
Go Online with this icon:
Hit F5 or press the play icon to run the application:
After a few seconds you should see it ONLINE:
Now let’s look at the log.
Double click the Device in the device tree and go to the Log tab.
If you do not have a license for the runtime or you do not have a license for the CODESYS IIoT Libraries SL, sou should see these messages:
To access the sparkplug specific logs, press these buttons and select SparkplugB:
You can change the verbosity of the logs with the verbosity param. Go Offline and open library manager, and browse through Sparkplug B MQTT > SparkplugB > GlobalVariables > GVL_Param_sparkplugB.
Is everything working?
Check in MQTT.fx, you should have some payloads:
Check in Ignition Designer, you should have some new tags in tag browser, changing every 5 seconds (configurable):
For more information on using CODESYS, go to help.codesys.com and forge.codesys.com/forge/talk/
For more information on using Ignition, go to inductiveuniversity.com and forum.inductiveautomation.com
Need help? -> Drop us a question, we are happy to assist you.