This guide is going to show the steps that must be followed in order to test IBM App Connect Enterprise toolkit in a simple way by trying out the OPC to MQTT communication in your Windows machine. In order to simulate this scenario it will be necessary to install and configure some other software, this installation process will be explained in this guide too.
1.1. Installation of ACE
- Download and install ACE from: https://developer.ibm.com/integration/docs/app-connect-enterprise/get-started/
- After installing the program and choosing the workspace where you want to work, you are ready to start using ACE.
1.2. Installation of ACMfg which adds the manufacturing nodes
- Latest version of App Connect for Manufacturing (ACMfg).
Please contact your IBM representative or Plamen Kiradjiev (firstname.lastname@example.org).
- Ensure that the IIB/ACE Toolkit is closed.
- Ensure that all integration nodes are stopped.
- Download the latest ACMfg fix pack from FixCentral, including any latest iFix (by providing the latest fix pack as your last version).
- Extract the contents of the ACMfg_win64_126.96.36.199.zip to a location of your choice and run the ACMfg_win64_188.8.131.52.exe. This .zip file is provided in the folder provided.
- Accept license and install.
- This would install ACMfg at -C:Program \Files\IBM\ACMfg\184.108.40.206
1.3. Configuration of the database
In order to use ACMfg in ACE you need a container and a database working in your machine.
- The first thing that you must to do is install docker in your machine: https://hub.docker.com/editions/community/docker-ce-desktop-windows/. Follow the instructions provided. If you are working under Windows Home or earlier versions of Windows, please check: https://docs.docker.com/toolbox/overview/
- Run a DB2 container according to this section. You can find more information under: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com. ibm.db2.luw.qb.server.doc/doc/t_install_db2CE_win_img.html.
- First open the terminal of your system and create a folder for your Docker image and entry it with this command.
mkdir Docker cd Docker
- Login and pull the DB2 image required.
docker login docker pull ibmcom/db2
- Create the .env_list.
type nul > ".env_list"
- Open the file with your preferred text editor and paste the following content:
LICENSE=accept DB2INSTANCE=db2inst1 DB2INST1_PASSWORD=password DBNAME=testdb BLU=false ENABLE_ORACLE_COMPATIBILITY=false UPDATEAVAIL=NO TO_CREATE_SAMPLEDB=false REPODB=false IS_OSXFS=false PERSISTENT_HOME=false HADR_ENABLED=false ETCD_ENDPOINT= ETCD_USERNAME= ETCD_PASSWORD=
- Start the DB2 container.
docker run -h db2server –name db2server –restart=always –detach –privileged=true- p 50000:50000 -p 55000:55000 –env-file .env_list -v db2pv:/database ibmcom/db2
- Access to the container.
docker exec -ti db2server bash
- Inside the docker container perform the following operations in order to add a user and create the database.
useradd acmfg passwd acmfg (Provide @CMfg@I3M as a password for your user) chage -I -1 -m 0 -M 99999 -E -1 acmfg su - db2inst1 db2
- Now you are inside the db2 shell. Follow the next instructions in order to create the database, the steps might take a while so once you enter a command wait until the system responds.
CREATE DATABASE ACMFG CONNECT TO ACMFG
The next lines must be included in the same command:
GRANT DBADM, CREATETAB, BINDADD, CONNECT, CREATE_NOT_FENCED, IMPLICIT_SCHEMA, LOAD ON DATABASE TO USER ACMFG
1.4. Connection between ACMfg and the database
Now that the database is ready you have to connect it to ACMfg.
- Start ACE Toolkit.
- From the Data Source Explorer view, right-click Database Connections folder and click New. The New Connection window opens.
- Set the database manager to a supported database type; DB2 for Linux, UNIX, and Windows, MySQL or Oracle.
- In JDBC driver select: IBM Data Server Driver for JDBC and SQLJ (JDBC 4.0) Default. By the default you will have selected the appropriate drivers. If you have any problems and you need to download, download from here https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads. Then click on the three points, click Add JAR and search for the drivers that you downloaded.
- To set up the connection to the database, specify the required connection parameters according to your database type,
such as the Database name, Host, Port number, Username, Password.
- Database: Specify a database name (ACMFG in this case).
- Host: The host name of your database host server (IP of the docker machine).
- Port Number: The port number of your database server (50000 by default).
- User name: The user name to connect to your database (ACMFG in this case).
- Password: The password for the specified user name (Password you gave the user).
1.5. Testing the system with a simple OPC UA communication
1.5.1. Required software
You need to install the following software in order to test your system:
Upload Connector Providers in order to be able to deploy OPC UA scenarios
- Go back to the Integration Development perspective and at the left bottom, select the integration explorer perspective.
- Right click on Integration Servers and select Create a local Integration Server. Put the name that you desire for your new server.
- Open the file in the path: C:\Users\<your user>\IBM \ACET11\workspace\<server> \<server>.conf.yaml
- Open it with your text editor and below ConnectorProvider: (around line 366), copy the next lines in order to update the jarsURL property of the server. The spaces are important so make sure that the lines have the exact same format as in the image.
- Save the file.
ACMfg: connectorClassName: ’com.ibm.industrypack.industryclient.connector.ICConnectorFactory’ jarsURL: ’C:/Program Files/IBM/ACMfg/220.127.116.11/runtime/amd64_nt_4’
Testing the OPC UA to MQTT communication
- Inside of the Integration Development perspective. Right click on Application Development window > Import… > IBM Integration > Project Interchange. Browse your SimpleOPCUAMQTT.zip and click on Finish.
- Open OPCUA2WIOT application > Flows > OPCUA2MQTT.msgflow. The flow is displayed in the main window.
- Click on OPC UA Client icon and select proprieties sub window. It’s possible that you have a trigger of Current Time implemented, select it and in the right side of this window click on Delete.
- In the same way, click on add. The Manufacturing perspective will be displayed. Select Counter item from Client item window.
- Right click on the Source icon of Data Source window and click on Add Mapping node. Named Prosys.
- Execute the Prosys OPC UA simulation server application and wait until you have a connection address. Then copy the TCP URL and paste it in the Server URL of the Data Source Proprieties and fulfill the rest of the parameters as is made in the next image. Click on Create Data Source.
- Once you are in this step, resources will be displayed in the Source Items window. These resources will allow us to use some data of our data source in the client operations. In this example Counter is the resource that will be used. In order to access this data, click in the arrow and open Objects folder, then 3:Simulation, and then select 3:Counter. In the window Client Item Properties, click on Create Client Item Tree. To check if the communication is okay, click on Counter in the Client Item and the information should be displayed in the Client Item Value window.
- Click on Add Trigger item value from Select window (just below Client item value window).
- Go back to the Integration Development perspective and in order to deploy the applications drag first ACMfg_Schemas and then drag both, OPCUA2WIoT and 0ControlFlowApp applications.
Visualization of the test case
At this point the application is already working but we need an MQTT manager which actuates as a server in order to receive the messages and publish them and an MQTT client in order to visualize the message.
- Open a terminal in your machine and go to the default location where mosquitto was installed. In order to do this use the following commands:
cd .. cd .. cd "Program Files" cd mosquitto mosquitto -v
Alternatively if you want to configure mosquitto as a service:
- Open a power shell command prompt as administrator.
- Change to the directory where you have installed mosquitto and type:
- Mosquitto is added but you don’t get any confirmation and it isn’t started but will start on reboot.
- Now that you have mosquitto running, execute the MQTT.fx application, which is in the program files.
- Select the Subscribe field and then click on connect. Then click on the Scan button near to Topics Collector.
will be displayed as a topic.
- Then select
as a topic in the blank space just below the suscribe field and click on suscribe.
- If everything is fine, you will see displayed the MQTT messages which come from the OPC UA application as is shown in the following image.