Did You Know? OmniServer Supports CSV Import/Export

10 min read

May 2, 2019 2:00:00 PM


OmniServer's main purpose is enabling connectivity without custom code for devices that use ‘non-standard’ protocols to communicate such as weight scales, barcode readers, and printers.  And OmniServer does that in a more efficient and cost-effective manner than writing custom code.

Furthering the goal of efficiency and cost-effectiveness, you may or may not be aware that OmniServer supports CSV import and export for speedy configuration of many things including topics, devices and, in the actual protocol itself, items, registers, topic variables and even messages.  On larger projects, this provides a substantial time savings.

In this post continuing our "OmniServer Did You Know?" blog series, we will cover how to use CSV import and export in OmniServer to facilitate faster configuration on larger protocol implementations.

Why might you need to use CSV Import and Export in OmniServer?

While some protocols might have one or only a handful of items and messages and no registers or topic variables (so you'd likely not need CSV import/export), other more complex protocols could have dozens or even hundreds of items or other components.

The CSV import/export capabilities in the protocol itself include items, registers, topic variables and messages, making more complex protocols with more components easier to mass edit, saving you time and effort that can be put to other uses.

And, whether your protocol is simple or more complex, for projects where you have dozens or hundreds of the same device using the same protocol, the CSV import and export capabilities for OmniServer topics and devices allows you to mass configure and mass edit your topics and devices to provide greater economies of scale on those projects.

If you missed previous posts in our blog series "OmniServer Did You Know?", get caught up here!

CSV Import and Export is also useful for merging OmniServer projects from different machines - it makes moving existing Topics and Devices from one machine to another where there is already an existing OmniServer project easy.

How Can I Use OmniServer CSV Import and Export?

It's simple to use CSV import and export for any of the supported components in OmniServer to increase productivity.  We provide three easy ways to initiate an import or export when you've selected the relevant component you wish to import or export.

In the OmniServer Configuration and Protocol Editor toolbars, we've provided Import and Export buttons that are context-sensitive to which section you've selected (i.e. if you're currently in the Topics section, you'll only be able to import or export topics).

Screenshot - OmniServer CSV Import Toolbar Button
CSV Import Toolbar Button
Screenshot - OmniServer CSV Export Toolbar Button
CSV Export Toolbar Button

As another alternative, which is also context-sensitive, you can select the relevant section in the tree view that you wish to import or export (i.e. Topics, Devices, etc) and go to File -> Import or File -> Export, as well.

Screenshot - OmniServer CSV Topic Import via File Menu

And last, but not least, you can also just right-click in the relevant section and select Import or Export from the menu that pops up.  In the following sections, we'll cover how to perform an export and import for each supported component in your OmniServer project and protocols

  1. CSV Import and Export for OmniServer Topics

    Starting from the Topics section of the OmniServer Configuration, you can use any of the three previously mentioned methods to initiate a Topic import or export.

    Screenshot - OmniServer CSV Topic Import via Right-Click

    For imports, we generally recommend manually configuring at least one topic and performing an export first.  That gives you a template of which fields are required that you can then use to further expand and add Topics you wish to then import.

    For either import or export operations, a Windows file explorer will display for you to select the location and name of the import or export file.

    A Topic export will export every Topic and its associated settings that are configured in the current OmniServer project.

    A Topic import will import the Topics you've configured to the current OmniServer project.  If there are any Topic names that already exist, you'll receive a prompt asking if you want to overwrite the existing Topic or not (and also whether you'd like to apply the same decision to any further conflicts).

    Screenshot - Handling Conflicts during CSV Import

    Saying "Yes" will overwrite the existing Topic and saying "No" will leave the existing Topic as-is.  Selecting "Apply to All Conflicts" will cause all conflicting Topics to get overwritten if you selected "Yes" or will maintain all existing Topics if you selected "No".
  2. CSV Import and Export for OmniServer Devices

    Starting from the "Devices" section of the OmniServer Configuration, you can use any of the three previously mentioned methods to initiate a Device import or export.

    Screenshot - OmniServer CSV  Device Import via Right-Click
    You'll notice that things are slightly different with Devices, as the settings available for a Serial device, an Ethernet device or an LPT device are significantly different.  As such, each type of device has to be imported or exported separately to maintain a consistent set of fields in the CSV files.

    Again, for imports, we recommend manually configuring at least one device of the required type (Serial, Ethernet or LPT) and performing an export first.  That gives you a template of which fields are required for that device type that you can then use to further expand and add the additional Devices you wish to then import
    .

    A Device export will export every Device of the selected type and its associated settings that are configured in the current OmniServer project.

    A Device import will import the Devices of the type you've added in the CSV file to the current OmniServer project.  If there are any Devices that already exist, you'll receive a prompt asking if you want to overwrite the existing Device or not (and also whether you'd like to apply the same decision to any further conflicts).

    Screenshot - OmniServer CSV Serial Device Import Conflict Dialog

    Saying "Yes" will overwrite the existing Device and saying "No" will leave the existing Device as-is.  Selecting "Apply to All Conflicts" will cause all conflicting Devices to get overwritten if you selected "Yes" or will maintain all existing Devices of the relevant type if you selected "No".
  3. CSV Import and Export for OmniServer Protocol Items

    For the purposes of this blog post, for the OmniServer protocol-specific import and export options, we'll use the MODBUSR sample protocol that installs with OmniServer, as it contains all of the components that are supported for CSV import/export.

    With the Item List selected in your OmniServer protocol, you can use one of the previously mentioned methods to initiate an import or export.

    Screenshot - OmniServer Item Import via Right-Click
    As with previous components, for imports, we recommend manually configuring at least one Item in the Item List and performing an export first.  That gives you a template of the fields that are required for your Items that you can then use to expand the CSV file and add the additional Items you need to import.

    An Item export exports every Item in the Item List along with its associated settings that are configured in the current OmniServer protocol.

    An Item import will import the Items you've added in the CSV file to the current OmniServer protocol.  If there are any Items that already exist, you'll receive a prompt asking if you want to overwrite the existing Item or not (and also whether you'd like to apply the same decision to any further conflicting Items).
  4. CSV Import and Export for OmniServer Protocol Registers

    With the Register Number List selected in your OmniServer protocol, you can use one of the previously mentioned methods to initiate an import or export.  (If you'd like more information on how Register Numbers are used in an OmniServer protocol - see our blog post.)

    Screenshot - Register CSV Import via Right-Click
    Once again, for imports, you should manually configure at least one Register in the protocol and performing an export first so that you have a template to work off of for creating your import file.

    A Register Number export exports every Register Number in the Register Number List along with its associated settings that are configured in the current OmniServer protocol.

    A Register Number import will import the Registers you've added in the CSV file to the current OmniServer protocol.  If there are any Registers that already exist, you'll receive a prompt asking if you want to overwrite the existing Register or not (and also whether you'd like to apply the same decision to any further conflicting Registers).
  5. CSV Import and Export for OmniServer Protocol Topic Variables

    With the Topic Variable List selected in your OmniServer protocol, you can again use one of the previously mentioned methods to initiate an import or export.  (If you'd like more information on how Topic Variables are used in an OmniServer protocol - see our blog post.)

    Screenshot - OmniServer Topic Variable Import via Right-Click
    Make sure to have manually configured at least one Register in the protocol and perform an export first so that you have a template to work off of for creating your import file.

    A Topic Variable export exports every Topic Variable in the Topic Variable List along with its associated settings that are configured in the current OmniServer protocol.

    A Topic Variable import will import the Topic Variables you've added in the CSV file to the current OmniServer protocol.  If there are any Topic Variables that already exist, you'll receive a prompt asking if you want to overwrite the existing Topic Variable or not (and also whether you'd like to apply the same decision to any further conflicting Registers).

  6. CSV Import and Export for OmniServer Protocol Command/Response Messages

    And last, but not least, with the Command/Request Message List selected in your OmniServer protocol, you can use one of the previously mentioned methods to initiate an import or export.

    Screenshot - Command/Request Messages Import via Right-Click
    There are a lot of settings in a Command/Request Message so it's easiest to manually configure at least one Register in the protocol and perform an export first so that you have a template to work off of for creating your import file.

    A Command/Request Message export exports every Command/Request (i.e. Host) Message in the protocol along with its associated settings.

    A Command/Request Message import will import the Command/Request Messages you've added in the CSV file to the current OmniServer protocol.  If there are any messages that already exist, you'll receive a prompt asking if you want to overwrite the existing Command/Request Message or not (and also whether you'd like to apply the same decision to any further conflicting Command/Request Messages).

Are there any limitations to OmniServer CSV Import/Export?

The only real limitations are that not all components of a protocol are supported for import/export such as Unsolicited Messages or Error Messages.  Also, make sure to avoid using commas in any description fields - this can cause problems with the imports/exports because commas are the separate used between the fields.

You'll receive an import summary at the end of any import indicating whether all rows were successfully imported or, if not, a list of failed rows will be provided with the reason why that row failed.

Screenshot - OmniServer Import Summary Log

Where can I get more information?

Have a protocol that you’re not really sure how to implement?  We're always happy to hear your potential use case for OmniServer and help with a complimentary protocol review of your protocol documentation or to answer questions you may have.

Email us at support@softwaretoolbox.com with your questions and don't forget to subscribe to our blog for more quick and easy OmniServer tutorials and tips and the latest news.  Then, make sure to download the OmniServer trial to try CSV Import/Export yourself for free.

Click to Download OmniServer Free Trial

Kevin Rutherford
Written by Kevin Rutherford

Software Toolbox Technical Blog

We're engineers like you, so this blog focuses on "How to" appnotes, videos, tech team tips, product update announcements, user case studies, and other technical updates.  Subscribe to updates below. Your feedback and questions on posts are always welcomed - just use the area at the bottom of any post.

Subscribe to our Blog

Recent Posts

Posts by Topic

See all