• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Protocols - NMEA 0183 I/O
  • NMEAOnSerial example
  • 4.11.14

NMEA over UDP Setup Guide NMEA over UDP Setup Guide

NMEAOnSerial example

Introduction

This guide demonstrates the usage of NMEAOnSerial component in a Linux environment to receive arbitrary data from a command line over a virtual serial connection using CDP Studio, the independent automation software for open PC based real-time distributed control systems. To use NMEAOnSerial successfully without virtual connections, a serial loopback device or an actual NMEA capable device must be attached to the configured serial port. In this example, a Socat utility program is used to create two virtual serial connections.

Creating Virtual Connections

First, two virtual connections have to be created – one for sending data from terminal and another one for NMEAOnSerial component to receive the data.

  • Install Socat utility program. More information about Socat can be found here
  • Open the terminal and type
    socat pty,link=/tmp/CDPCOM0,raw,echo=0 pty,link=/tmp/CDPCOM1,raw,echo=0
  • Leave the terminal open for the testing period
  • A similar view should be seen in the terminal

Setting up a Test-system

First we set up a System that the component can be tested in:

Create a system named NMEATest with a Console application named NMEATestApp, then select Configure mode. See How to Create a system for more information.

Adding an NMEAOnSerial Component

  • Click on the default application called NMEATestApp
  • Click on NMEA0183IO to expand its contents in the Resource tree
  • Choose NMEAOnSerial component and add it to the default application

Adding ReceiveData To NMEAOnSerial and Configuring It

  • Double-click on the NMEAOnSerial that was added
  • Double-click the SerialTransport to navigate into it
  • Set the ComPort Value to /tmp/CDPCOM0
  • Select the NMEAOnSerial component in the Project tree
  • From the Resource tree, double-click ReceiveData inside the NMEA0183IO resource to add it to NMEAOnSerial
  • Double-click Receive to navigate into it
  • Tick DisableChecksum. We want this disabled to simplify testing with random data
  • Set Header to $T. Anything starting with $T, will now be accepted
  • From the NMEA0183IO resource in the Resource tree, double-click a String resource to add it

Note: To learn about other configurable values in SerialTransport, click here.

How to Run the Tutorial

To run the tutorial from CDP Studio, select Configure mode, right click on the system project and select Run & Connect. See the Running and Connecting to the System tutorial for more information.

Testing the System

  • Navigate into NMEATestApp NMEAOnSerial Receive
  • Open another terminal and type
    echo '$T,My first message' > /tmp/CDPCOM1
  • Watch how the data appears in the Text Value column

NMEA over UDP Setup Guide NMEA over UDP Setup Guide

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

    © Copyright 2022 CDP Technologies. Privacy and cookie policy.

    Return to top