GithubHelp home page GithubHelp logo

huangdong332 / itech_dc_power_capl_dll Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 53 KB

A capl dll to support ITECH DC power cotrol in Canoe.

Makefile 0.85% C++ 86.33% C 12.82%
canoe capl-dll itech-dc-power

itech_dc_power_capl_dll's Introduction

Project logo

ITECH DC Power Control CAPL DLL

Status GitHub Issues GitHub Pull Requests License


A CAPL DLL to control an ITECH DC power.

๐Ÿ“ Table of Contents

๐Ÿง About

This CAPL dll provides interfaces to control an ITECH programmable DC power supply through USB in CAPL. The only two APIs(dllItechDcPowerWrite & dllItechDcPowerQuery) in this dll are implemented on top of VISA(Virtual instrument software architecture). The standard SCPI command can be send to an ITECH device through those two APIs by the way controlling this device. The supported SCPI commands can be found in the device's document normally named "One's programming guide".

Communication Interface

USB and RS232 are both supported now.

๐Ÿ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

MinGW and Make.

This CAPL dll is built with a MinGW gcc tools for 32bit Windows target. The 64bit CAPL dll can't be recognized by the CAPL browser any way. The compile process is managed by a Makefile.

I use msys64 to install MinGW and Make.

Instrument Driver

NIVISA and NIIPC driver package should be installed on your machine.

๐ŸŽˆ Usage

There is an example code in CAPL. In this test case, a ITECH DC power supply's voltage is set to 5V.After 5 seconds,its output is truned ON. After 5 seconds, its voltage is adjusted to 10V. After 5 seconds, its voltage and current are queried and its voltage is adjusted to 800mV. After 5 seconds, its output is turned off.

USB

testcase TurnOnAndOff()
{
  char resultString[100];
  float result;
  //Set output voltage to 5V.
  dllItechDcPowerWrite("VOLT 5V");
  testWaitForTimeout(5000);
  //Set output state to  ON.
  dllItechDcPowerWrite("OUTP 1");
  testWaitForTimeout(5000);
  dllItechDcPowerWrite("VOLT 10V");
  testWaitForTimeout(5000);
  //Measure output voltage, numberic result saved in "result".
  dllItechDcPowerQuery("MEAS:VOLT?",resultString,result);
  write("Measured voltage: %f",result);
  //Measure output current, numberic result saved in "result".
  dllItechDcPowerQuery("MEAS:CURR?",resultString,result);
  write("Measured current: %f",result);
  dllItechDcPowerWrite("VOLT 800mV");
  testWaitForTimeout(5000);
  //Set output state to  OFF.
  dllItechDcPowerWrite("OUTP 0");
  
}

RS232

testcase test()
 {
  char resultString[100];
  float result;
  //!!!IMPORTANT!!!
  //Must be the first step in case of RS232.
  //This SCPI command enables reomte control.
  dllItechDcPowerWriteSerial("SYST:REM");
  dllItechDcPowerWriteSerial("VOLT 5V");
  testWaitForTimeout(5000);
  dllItechDcPowerWriteSerial("OUTP 1");
  testWaitForTimeout(5000);
  dllItechDcPowerWriteSerial("VOLT 10V");
  testWaitForTimeout(5000);
  dllItechDcPowerQuerySerial("MEAS:VOLT?",resultString,result);
  write("Measured voltage: %f",result);
  dllItechDcPowerQuerySerial("MEAS:CURR?",resultString,result);
  write("Measured current: %f",result);
  dllItechDcPowerWriteSerial("VOLT 800mV");
  testWaitForTimeout(5000);
  dllItechDcPowerWriteSerial("OUTP 0");
 }

โ›๏ธ Built Using

After change to this project's root directory, run follow command to build this CAPL dll.

make

No test code has been added in this project.

itech_dc_power_capl_dll's People

Contributors

huangdong332 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.