element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products & Partners
    Products & Partners
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Blog SCPI on a Linux Board - Letter of Intent
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 27 Apr 2018 5:41 PM Date Created
  • Views 5947 views
  • Likes 14 likes
  • Comments 21 comments
  • pi
  • bbb
  • BeagleBone
  • raspberrypi
  • scpi
Related
Recommended

SCPI on a Linux Board - Letter of Intent

Jan Cumps
Jan Cumps
27 Apr 2018

I'm trying to build a SCPI shell for Linux.

I'd like to have it working over TCP/IP on a Raspberry Pi and a BeagleBone.

 

tl;dr It works. The rest of the blog series explains how to build a lab automation device that controls 8 outputs (2 of them relays), and read 8 inputs. With a Raspberry Pi and a PiFace Digital (2).

image

 

 

Here on element14, we've been playing with SCPI and microcontrollers. We have several instruments working on MSP432, Arduino and Hercules devices.

This time I'd like to get a Linux instrument up. To get some device independence, I'll try to make the source work on two different boards with different distros.

The program is expected to run as a background process.

 

I have a head start. My favourite SCPI library has a LwIP SCPI server example.

A relative head start, that is, because I have to find out how to get all the dependencies - I want to develop on a Windows PC image.

If this project fails, it'll be because of my develop for Linux skills.

 

related blog
SCPI on a Linux Board - Letter of Intent

SCPI on a Linux Board - Part 1: Proof of Concept

SCPI on a Linux Board - Part 2a: PiFace Digital C programming

SCPI on a Linux Board - Part 2b: PiFace Digital C++ programming
SCPI on a Linux Board - Part 3: TCP/IP Socket C++ programming
SCPI on a Linux Board - Part 4: TCP/IP SCPI and Instrument Service
SCPI on a Linux Board - Part 4b: TCP/IP SCPI and Instrument Service 100% Working
SCPI on a Linux Board - Part 4c: TCP/IP SCPI and Instrument Service - Run as a Daemon
SCPI on a Linux Board - Part 5a: LabVIEW Driver for LAB Switch: Open, Close and Switch functions
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 8 years ago in reply to Jan Cumps +4
    Yay! It works. Above is the capture of a LabVIEW back and forth communication - with the Raspberry Pi as a VISA TCP/IP device. *IDN? command sent, and the reply from the Pi arrived at LabVIEW.
  • DAB
    DAB over 8 years ago +3
    Good luck Jan. DAB
  • Jan Cumps
    Jan Cumps over 8 years ago in reply to Jan Cumps +3
    what's not working ok: even though I get a reply, the Visa Read block in LabVIEW throws a timeout error. when I close a connection (regardless of telnet, LabVIEW), the service on the Raspberry Pi goes…
  • Jan Cumps
    Jan Cumps over 8 years ago

    A few learnings from testing LabVIEW with another TCP/IP device (a Tektronix TBS 2000 oscilloscope - I won it in a contest image ):

    I can get things to work with raw TCP/IP - not yet as a VISA instrument.

    The Tektronix has all VISA drivers installed and I can contact it over VISA via TCP/IP, but not reliable.

    With USB, that scope works just fine.

    Have I opened a can of worms?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 8 years ago

    Well, that didn't take long.

    image

    I have a SCPI parser running now that accepts SCPI commands and sends replies. Easier than I thought it would be.

    Achievements unlocked:

    • program runs on Raspberry Pi, listens on a tcp/ip port for SCPI and can reply
    • SCPI library incorporated
    • cross compiled: developed on windows, executed on linux/Pi, debugged remotely from Windows

    To do:

    • turn this into a daemon, with proper startup and shutdown
    • test on BeagleBone
    • make a test instrument. This is just a mock program pretending it's a digital multimeter.
    • implement SYSTem:COMMunicate:LAN:CONTrol? : dynamic allocation of control port.
    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 8 years ago in reply to Jan Cumps

    for the geeks (i.e.: me):

     

    image

     

    from a raw telnet console on a linux pc in the network, the payload 'test' is sent to the Pi on port 2222.

    In Eclipse debugger on Windows, this is captured and logged ("Here is the message: test" ).

    On the telnet that sent the message, a confirmation is received ("I got your message").

     

    That's all I need to get a SCPI communication shell. Now over to getting it executed as a daemon ...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 8 years ago

    TCP/IP basics work on Raspberry Pi.

    Compiled and debugged in Eclipse on a Windows 10 PC, compiled program executed on the Pi:

    image

     

    Inspiration: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/server.c

     

    This may not look spectacular, but I think it's cool that you can compile a C executable on a windows machine, transfer it to the Pi and step through the code in the debugger on that same windows machine - with 1 click on some button

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    Good luck Jan.

     

    DAB

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube