亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dpi515com.cpp

?? 壓力控制器通訊源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************/
/* File:        DPI515COM.CPP                                                 */
/*                                                                            */
/* Class:       cDPI515Communications                                         */
/* Author:      Alaster Jones                                                 */
/* Description: Derived from the VISA class specifically for DPI515 instru-   */
/*              ment communications, serial and IEEE.                         */
/*                                                                            */
/* Date:        02/03/01                                                      */
/******************************************************************************/
//---------------------------------------------------------------------------
#include "stdafx.h"

#include "dpi515Com.h"
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys\timeb.h>

#define MAXUNITS    26

//---------------------------------------------------------------------------

/******************************************************************************/
/* Function:    cDPI515Communications                                         */
/* Author:      Alaster Jones                                                 */
/* Purpose:     constructor                                                   */
/* Inputs:      none                                                          */
/* Outputs:     none                                                          */
/******************************************************************************/
cDPI515Communications::cDPI515Communications()
{
    // constructor
    commsProtocol = e515;   // default to 515 comms protocol SCPI
    pressureReading = 0.0;
    currentRangeFS = 0.0;
    pUnit = NULL;
    numRanges = 0;
    numUnits = 0;
    trap_SRQ = false;
    trap_SRQ_Value = 0;
}

/******************************************************************************/
/* Function:    ~cDPI515Communications                                        */
/* Author:      Alaster Jones                                                 */
/* Purpose:     destructor                                                    */
/* Inputs:      none                                                          */
/* Outputs:     none                                                          */
/******************************************************************************/
cDPI515Communications::~cDPI515Communications()
{
    // destructor
}

/******************************************************************************/
/* Function:    instrumentInitialisation                                      */
/* Author:      Alaster Jones                                                 */
/* Purpose:     initialise the instrument                                     */
/* Inputs:      none                                                          */
/* Outputs:     long status                                                   */
/******************************************************************************/
long cDPI515Communications::instrumentInitialisation(void)
{
//    char * ptr;
    char sTemp[20];
    char strWrite[100];
    long status = 0;

    // clear the bus and enable the registers
    strcpy(strWrite, "*CLS\r\n");
    status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), strlen(strWrite), &rtnCount);
    sndBytes = sndBytes + rtnCount; // number of bytes actually written

    if(!status) // enable pressure operations register
    {
        strcpy(strWrite, ":STAT:OPER:PRES:ENAB 511\r\n");
        status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), strlen(strWrite), &rtnCount);
        sndBytes = sndBytes + rtnCount; // number of bytes actually written
    }

    if(!status) // enable operations register
    {
        strcpy(strWrite, ":STAT:OPER:ENAB 1024\r\n");
        status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), strlen(strWrite), &rtnCount);
        sndBytes = sndBytes + rtnCount; // number of bytes actually written
    }

    if(!status) // enable SRQ events
    {
        strcpy(strWrite, ":SRQ:ENAB 128\r\n");
        status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), strlen(strWrite), &rtnCount);
        sndBytes = sndBytes + rtnCount; // number of bytes actually written
    }

    if(!status) // lock out the local UI
    {
        strcpy(strWrite, ":LLO\r\n");
        status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), strlen(strWrite), &rtnCount);
        sndBytes = sndBytes + rtnCount; // number of bytes actually written
    }

    // get the available ranges and the current range
    getInstrumentRanges();
    getCurrentRange(sTemp);

    // ..and the available and current units
    getInstrumentUnits();
    getCurrentUnit(sTemp);

    return status;
}

/******************************************************************************/
/* Function:    getInstrumentID                                               */
/* Author:      Alaster Jones                                                 */
/* Purpose:     get the ID, really a comms test                               */
/* Inputs:      none                                                          */
/* Outputs:     long status                                                   */
/******************************************************************************/
long cDPI515Communications::getInstrumentID(char * instrumentID)
{
    char * ptr;
    char strWrite[100];
    char strRead[100];
    long status = 0;

    // flush the buffers before we do a read every time
    status = viFlush(instr, VI_WRITE_BUF_DISCARD);
    status = viFlush(instr, VI_READ_BUF_DISCARD);

    // query pressure
    strcpy(strWrite,"*IDN?\r\n");
    wrtCount = strlen(strWrite);
    status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), wrtCount, &rtnCount);
    sndBytes = sndBytes + rtnCount; // number of bytes actually written

    // read the reply
    if(!status) // no r/w error
    {
        status = viRead (instr, reinterpret_cast<unsigned char *>(strRead), 100, &rtnCount);
        if(ptr = strtok(strRead, "\r"))
            strcpy(instrumentID, strRead);
        rcdBytes = rcdBytes + rtnCount; // number of bytes actually read
    }

    return status;
}

/******************************************************************************/
/* Function:    setSetpoint                                                   */
/* Author:      Alaster Jones                                                 */
/* Purpose:     send the setpoint                                             */
/* Inputs:      pressure double                                               */
/* Outputs:     long status                                                   */
/******************************************************************************/
long cDPI515Communications::setSetpoint(double dSetpoint)
{
//    char * ptr;
    char strWrite[100];
    long status = 0;

    // query pressure
    sprintf(strWrite, ":SOUR %f\r\n", dSetpoint);
    wrtCount = strlen(strWrite);
    status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), wrtCount, &rtnCount);
    sndBytes = sndBytes + rtnCount; // number of bytes actually written

    return status;
}

/******************************************************************************/
/* Function:    getSetpoint                                                   */
/* Author:      Alaster Jones                                                 */
/* Purpose:     get the setpoint                                              */
/* Inputs:      ptr to pressure double                                        */
/* Outputs:     long status                                                   */
/******************************************************************************/
long cDPI515Communications::getSetpoint(double * pdSetpoint)
{
    char * ptr;
    char strWrite[100];
    char strRead[50];
    long status = 0;

    // flush the buffers before we do a read every time
    status = viFlush(instr, VI_WRITE_BUF_DISCARD);
    status = viFlush(instr, VI_READ_BUF_DISCARD);

    // query pressure
    strcpy(strWrite,":SOUR?\r\n");
    wrtCount = strlen(strWrite);
    status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), wrtCount, &rtnCount);
    sndBytes = sndBytes + rtnCount; // number of bytes actually written

    // read pressure request
    if(!status) // no r/w error
    {
        status = viRead (instr, reinterpret_cast<unsigned char *>(strRead), 50, &rtnCount);
        rcdBytes = rcdBytes + rtnCount; // number of bytes actually read
    }

    if(!status) // no r/w error
    {
        if(strncmp(strRead, ":SOUR:PRES:LEV:IMM:AMPL", 23)==NULL)
        {
            ptr = strtok(strRead, " ");
            ptr = strtok(NULL, "\r");
            *pdSetpoint = atof(ptr);
        }
        else if(strncmp(strRead, ":SRQ", 4)==NULL)
        {
            // trap an SRQ here
            trap_SRQ = true;
            ptr = strtok(strRead, " ");
            ptr = strtok(NULL, "\r");
            trap_SRQ_Value = atol(ptr);
        }
        else

            status = -1; // failed to get the right reply

    }

    return status;
}

/******************************************************************************/
/* Function:    getPressure                                                   */
/* Author:      Alaster Jones                                                 */
/* Purpose:     get the pressure                                              */
/* Inputs:      ptr to pressure double                                        */
/* Outputs:     long status                                                   */
/******************************************************************************/
long cDPI515Communications::getPressure(double * pPressure)
{
    char * ptr;
    char strWrite[100];
    char strRead[100];
    long status = 0;

    // flush the buffers before we do a read every time
    status = viFlush(instr, VI_WRITE_BUF_DISCARD);
    status = viFlush(instr, VI_READ_BUF_DISCARD);

    // query pressure
    strcpy(strWrite,":SENS:PRES?\r\n");
    wrtCount = strlen(strWrite);
    status = viWrite (instr, reinterpret_cast<unsigned char *>(strWrite), wrtCount, &rtnCount);
    sndBytes = sndBytes + rtnCount; // number of bytes actually written

    // read pressure request
    if (!status) // no r/w error
    {
        status = viRead (instr, reinterpret_cast<unsigned char *>(strRead), 50, &rtnCount);
        rcdBytes = rcdBytes + rtnCount; // number of bytes actually read
   }

    if(!status) // no r/w error
    {
        if(strncmp(strRead, ":SENS:PRES", 10)==NULL)
        {
            // correct string returned
            ptr = strtok(strRead, " ");
            ptr = strtok(NULL, "\r");
            *pPressure = pressureReading = atof(ptr);
        }
        else if(strncmp(strRead, ":SRQ", 4)==NULL)
        {
            // trap an SRQ here

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清不卡一区| 国产成人av网站| 丁香婷婷综合五月| 欧美狂野另类xxxxoooo| 精品久久久网站| 亚洲午夜一区二区| av资源站一区| 精品福利在线导航| 视频一区在线视频| 91麻豆精品在线观看| 日本一区二区在线不卡| 蜜桃在线一区二区三区| 欧美日韩中文字幕精品| 中文字幕一区二区三区精华液| 美女免费视频一区| 欧美午夜一区二区三区免费大片| 国产精品免费人成网站| 国内精品国产三级国产a久久| 欧美福利视频一区| 亚洲福利一区二区三区| 91麻豆国产精品久久| 国产欧美日韩一区二区三区在线观看| 日韩一区欧美二区| 欧美日韩午夜在线| 亚洲国产wwwccc36天堂| 色综合av在线| 樱桃视频在线观看一区| 91年精品国产| 怡红院av一区二区三区| 91成人免费电影| 亚洲欧美一区二区三区国产精品 | 中文字幕一区二区三区在线不卡 | 九色porny丨国产精品| 6080国产精品一区二区| 午夜欧美视频在线观看| 欧美日韩精品一区二区天天拍小说| 亚洲男同性恋视频| 欧美日韩国产免费一区二区| 亚洲一区二区三区视频在线播放 | 亚洲欧美自拍偷拍| 不卡的av在线播放| 亚洲欧美一区二区三区国产精品| 国产视频在线观看一区二区三区| 国产视频一区不卡| 视频一区二区欧美| 亚洲综合999| 91最新地址在线播放| 樱桃国产成人精品视频| 欧美精品一级二级三级| 精品国产伦一区二区三区观看方式| 精品欧美一区二区久久 | 欧美一区二区黄| 中文字幕一区二区三区在线观看 | 一区二区三区在线视频观看 | 亚洲另类春色校园小说| 91原创在线视频| 色94色欧美sute亚洲线路一久| 亚洲国产精品一区二区久久恐怖片| 欧美精品aⅴ在线视频| 国产在线视频一区二区| 亚洲欧洲日本在线| 717成人午夜免费福利电影| 国产在线精品一区二区不卡了| 中文字幕在线一区二区三区| 欧美高清精品3d| 高清免费成人av| 国产在线视频一区二区| 国产欧美va欧美不卡在线| 在线看国产一区二区| 老司机精品视频一区二区三区| 中文字幕乱码亚洲精品一区| 欧美日韩国产综合草草| 成人永久aaa| 毛片一区二区三区| 亚洲欧美激情插| 久久综合狠狠综合| 在线亚洲欧美专区二区| 国产一区视频在线看| 午夜一区二区三区在线观看| 久久精品视频一区二区| 欧美日韩成人一区二区| 99精品热视频| 精品一区二区三区在线播放| 亚洲精品国产精品乱码不99| 国产夜色精品一区二区av| 欧美日韩免费一区二区三区| 处破女av一区二区| 久久99精品一区二区三区| 亚洲国产一区二区三区青草影视| 国产欧美1区2区3区| 精品日韩一区二区| 欧美日韩国产一区| www.亚洲免费av| 国产经典欧美精品| 麻豆一区二区三| 午夜视频在线观看一区| 亚洲色图19p| 国产精品网站在线播放| 久久综合久久综合久久| 国产欧美一区二区精品婷婷| 日韩欧美中文字幕制服| 欧美日韩国产一级二级| 欧美在线免费观看亚洲| 成av人片一区二区| 国产成人免费av在线| 激情另类小说区图片区视频区| 青青草精品视频| 日本亚洲最大的色成网站www| 亚洲成a人在线观看| 亚洲国产日日夜夜| 有码一区二区三区| 亚洲制服丝袜一区| 亚洲卡通动漫在线| 亚洲欧美色图小说| 亚洲一区中文日韩| 一区二区三区欧美| 亚洲午夜国产一区99re久久| 亚洲综合成人在线视频| 亚洲综合色成人| 婷婷成人综合网| 青青草成人在线观看| 美女久久久精品| 国产很黄免费观看久久| 豆国产96在线|亚洲| 99re这里都是精品| 欧美三区在线观看| 制服丝袜中文字幕亚洲| 日韩免费看网站| 欧美精品一区二区三区很污很色的| 久久伊99综合婷婷久久伊| 国产三级欧美三级日产三级99 | 久久精品国产网站| 国产一区二区网址| 成人av网站在线观看| 91丝袜美女网| 欧美电影影音先锋| 久久你懂得1024| 一区二区三区在线观看国产| 日韩影院精彩在线| 国产高清无密码一区二区三区| 91日韩在线专区| 日韩欧美一区二区免费| 中文字幕一区二区三区蜜月| 亚洲18影院在线观看| 国产毛片精品一区| 在线视频欧美精品| 久久夜色精品国产噜噜av| 亚洲欧洲三级电影| 日韩电影在线看| 成人国产视频在线观看| 欧美放荡的少妇| 国产精品理伦片| 无码av中文一区二区三区桃花岛| 国产精品一品视频| 欧美三级在线看| 国产农村妇女毛片精品久久麻豆 | 欧美一区二区在线免费观看| 国产精品丝袜一区| 午夜精品一区二区三区电影天堂| 国产精品香蕉一区二区三区| 欧美日韩国产小视频| 国产欧美日韩激情| 午夜在线成人av| 99久久精品国产毛片| 26uuu精品一区二区三区四区在线| 中文字幕人成不卡一区| 精品一区二区三区免费视频| 欧美最猛黑人xxxxx猛交| 久久久久国产精品免费免费搜索| 偷偷要91色婷婷| 91免费精品国自产拍在线不卡| 日韩美女天天操| 亚洲成人第一页| 91年精品国产| 国产精品成人一区二区艾草 | 亚洲欧美偷拍另类a∨色屁股| 久久成人精品无人区| 91九色最新地址| 中文av一区特黄| 国产在线视频一区二区三区| 日韩亚洲欧美高清| 一区二区三区av电影| 成人黄色软件下载| 久久久不卡影院| 国产一区二区伦理片| 欧美大片顶级少妇| 男人的天堂亚洲一区| 欧美色综合网站| 一区二区三区久久| 91成人在线精品| 一区二区高清视频在线观看| 色综合天天综合色综合av| 国产亚洲欧美日韩在线一区| 国产精品中文字幕日韩精品| 26uuu亚洲综合色欧美| 精品午夜久久福利影院| 日韩一区二区三区四区五区六区| 日韩高清不卡一区二区三区| 欧美一区二区三区色| 日韩二区三区在线观看|