Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now we have the three modules connected, we can setup the file publish configuration.

Step 3: Config MQTT

...

Engine File Handling

Now we can configure the MQTT Engine module to process the published files.

Navigate to the MQTT Engine > Settings in the left side of the Ignition Gateway UI and select the Namespaces tab. From the Default tab, edit the Sparkplug B namespace shown below:

...

Image Modified

Now select the 'Files' tab and set the following

  • Ignore Files
    • Leave this property unchecked so that publish files will not be ignored: unchecked/false
  • File Host Type:
    • ACTIVE to specify that a message ACK is sent back to MQTT Transmission
  • Base File Directory
    • : Set to some directory file path (i.e. 'C:\My Files' or something similar) where the files will be stored
  • Add Topic Tokens
    • Leave this property as checked to add the Group ID, Edge Node ID and Device ID to the base file directory path: checked/true
  • File Storing Policy
    • Set this policy to : REPLACE_EXISTING_FILE

When complete, it should look similar to the following. Save the changes after confirming.
Image Modified

...

Step 4: Configure MQTT Transmission to publish files

Now we can configure the MQTT Transmission module to publish files using the existing MQTT client created by the Example Transmitter. Navigate to the MQTT Transmission > Settings in the left side bar of the Ignition Gateway UI and select the Transmitters tab. Make note of the Sparkplug IDs configured for your transmitter.

For our example we have the Group ID as My MQTT Group and the Edge Node ID as Edge Node faec7e Image Added

Now on the 

...

  • In the example below, the Sparkplug IDs field is 'My MQTT Group/Edge Node faec7e'. This means the corresponding Group ID and Edge Node ID are:
    • Group ID: My MQTT Group
    • Edge Node ID: Edge Node faec7e
      Image Removed

...

'Files' tab, select the Create new Files... link and configure the following fields

    • Tag Provider
  • : default
      • Set to 'default'. This is the tag provider where the publish control and information tags will be created
    • Tag Folder Path
  • :
      • Set to 'files_manual'. This is the tag folder in the specified tag provider where the publish control and information tags will be created
    • Enable Auto-Publish
  • : unchecked/false
      • Leave this unchecked. This will force manual publishes only  
    • Group ID
  • :
      • Use the Group
  • ID you noted in the Transmitter configuration
      • ID from your Transmitters Sparkplug ID. For this example, My MQTT Group
    • Edge Node ID:
      • Use the Edge Node
  • ID you noted in the Transmitter configuration
      • ID from your Transmitters Sparkplug ID. For this example, Edge Node faec7e 


When complete, it should look

...

similar to the following. Save the changes after confirming.

Image Modified

After the configuration is saved, it should look

...

similar to below:

Image Modified

Step 5: Publish Files

At this point, everything should be configured to send files from MQTT Transmission to MQTT Engine. Open Ignition Designer on the system running MQTT Transmission. You should see a new set of tags there the control and information tags created in the specified tag provider and folder as shown below.:

At this point, we just need to tell MQTT Transmission which file to send. Download this sample_file.zip which contains two text files. The two text files are:

...

With both files in place, we can now set the 'Publish File Path' tag. This path must be the full path to the target file to publish over MQTT. In this example, we're using the path of '/tmp/transmission/sample_file.txt'. However, on a Windows system that would look something like 'C:\full\path\to\my\sample_file.txt'. When this is set, you should see something like this

...

You should also now see the file on the Ignition system with MQTT Engine installed. The file will be saved to the location you set as the 'Base File Directory' in your MQTT Engine namespace configuration for Sparkplug B.



Extra Activities

At this point you have a fully functional system which can be expanded or modified as required. There is also an option to 'automatically' publish files using MQTT TransmissionBelow are some addition configuration options to try:

  • Setup MQTT Transmission to automatically publish files. In the 'File' configuration of MQTT Transmission

...

  • , check the 'Enable Auto-Publish'.

...

  • When this is enabled, MQTT Transmission will create a tag called 'Publish Files Folder' instead of 'Publish File Path' as shown below.

...

Image Removed

...

  •   MQTT Transmission will scan the folder specified in the tag and will publish all files that appear in this directory automatically. Just as with the 'manual publish' option, an associated md5 sum file must be present and properly represent the md5 sum of the target file before it will be published.

...

Image Added

  • Adjust the file transfer configuration to define how quickly a file transfer occurs and how long before a timeout will occur on failure to receive host side acknowledgements

...

  • based on the size of files you are sending and any bandwidth constraints that you may have.

Additional Resources

...

...

...

...





Excerpt Include
CLD80:FAQ: Ignition Modules
CLD80:FAQ: Ignition Modules
nopaneltrue

...