element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Open Arduino
  • Challenges & Projects
  • Project14
  • Open Arduino
  • More
  • Cancel
Open Arduino
Blog Arduino in Test Instrumentation - Part 1: SCPI Lib
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Open Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 6 Apr 2018 1:00 PM Date Created
  • Views 7394 views
  • Likes 12 likes
  • Comments 16 comments
  • diytestequipch
  • openarduinoch
  • scpi
  • arduino_test_instrumentation
Related
Recommended

Arduino in Test Instrumentation - Part 1: SCPI Lib

Jan Cumps
Jan Cumps
6 Apr 2018
image

Open Arduino

Enter Your Project for a chance to win a grand prize for the most innovative use of Arduino or a $200 shopping cart! The Birthday Special: Arduino Projects for Arduino Day!

Back to The Project14 homepage image

Project14 Home
Monthly Themes
Monthly Theme Poll

 

Arduino in Test Instrumentation

 

To celebrate Project 14's birthday, I'm going to make a programmable switch with an Arduino UNO.

In this post I try out the SCPI library.

image

 

SCPI Library Installation

 

I'm using a SCPI lib that's written for Arduino: Open Instrument Control.

You can download the GIT archive as a zip.

To install it in the Arduino environment, first check in the Arduino gui where your sketchbook folder is (Via File -> Preferences).

Extract the GIT archive in a temporary location. Copy the src/ArduinoSCPIParser folder to the sketchbook/libraries subfolder

On my PC: D:\users\jancu\Documents\Arduino\libraries\ArduinoSCPIParser.

 

You'll have to comment out one line in the scpiparser.cpp source, or you get compilation errors:

 

// #include <WProgram.h>

 

This is because the SCPI library we're using isn't adapted to the recent Arduino software versions.

 

Test the SCPI Library

 

There are two examples in the SCPI lib. We're using Meter.ino.

Open the example in the Arduino GUI (File -> Open, then navigate to the place where you extracted the GIT archive and open src/Examples/Meter/Meter.ino).

Connect your UNO, select Tools -> Board -> Arduino/Genuino UNO.

Select Tools -> Port -> <the COM port of your Arduino>.

Select Sketch -> Upload.

 

Your Arduino is now programmed with the Meter example and the SCPI lib.

To test the basic setup, open the serial monitor:

Tools -> Serial Monitor

Enter the SCPI command *IDN? and press Send.

The monitor should log the result: OIC,Embedded SCPI Example,1,10.

 

image

 

 

Related Blog
Arduino in Test Instrumentation - Intro: SCPI Programmable Switch
Arduino in Test Instrumentation - Part 1: SCPI Lib
Arduino in Test Instrumentation - Part 2: Firmware
Arduino in Test Instrumentation - Part 3a: LabVIEW Driver Intitialisation Block
Arduino in Test Instrumentation - Part 3b: LabVIEW Driver Switch Control Block
Arduino in Test Instrumentation - Part 3c: LabVIEW Driver Read Status Block
Arduino in Test Instrumentation - Outro: LabVIEW Example
  • Sign in to reply

Top Comments

  • genebren
    genebren over 7 years ago +4
    Jan, Nice update on your project. I look forward to following your progress on this project. Maybe this will convince me to look further into Arduino as a potential for future projects. Good luck on your…
  • mcb1
    mcb1 over 7 years ago in reply to Jan Cumps +2
    I tend to have my Arduino in C:\Development\Arduino\ *whatever version* I have multiple versions of the IDE which worked out useful when there was a bug ... it worked on a earlier version so it wasn't…
  • jomoenginer
    jomoenginer over 7 years ago in reply to mcb1 +2
    If the library will not be used in other applications, you could just add a 'src' folder where the .ino file is located and add your code there. You would then need to reference the files with the 'src…
Parents
  • jc2048
    jc2048 over 7 years ago

    That SCPI parser looks useful.

     

    Sorry if this is a stupid question, but do I have to compile the scpiparser.cpp source (and if so, how?) or does that happen automatically just by copying it to the libraries folder and then refering to it in a sketch by including the header?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to jc2048

    jc2048  wrote:

     

    ...  does that happen automatically just by copying it to the libraries folder and then refering to it in a sketch by including the header?

    like that, yes. Oncenthe source is in the libraries folder and you start the Arduino IDE again, it is available.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 7 years ago in reply to Jan Cumps

    IMO the newer version IDE makes that bit totally hidden.

    Any libraries imported are dumped in the user directory, rather than the ....*Arduino IDE place*\libraries

     

    It makes it hard when you simply copy your arduino directory to use on another machine....

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to mcb1

    mcb1  wrote:

     

    IMO the newer version IDE makes that bit totally hidden.

    Any libraries imported are dumped in the user directory, rather than the ....*Arduino IDE place*\libraries

    ...

    Mark

     

    Yes, that's what I did, in the libraries subfolder of that directory.:

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 7 years ago in reply to Jan Cumps

    I tend to have my Arduino in C:\Development\Arduino\ *whatever version*

    I have multiple versions of the IDE which worked out useful when there was a bug ... it worked on a earlier version so it wasn't my sketch.

     

     

    Mark

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

    I tend to have my Arduino in C:\Development\Arduino\ *whatever version*

    I have multiple versions of the IDE which worked out useful when there was a bug ... it worked on a earlier version so it wasn't my sketch.

     

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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 © 2025 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.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube