├── .gitignore ├── Ni ├── include │ ├── IviACPwr_ni.h │ ├── IviCounter_ni.h │ ├── IviDCPwrObsolete.h │ ├── IviDigitizer_ni.h │ ├── IviDmmObsolete.h │ ├── IviDownconverter_ni.h │ ├── IviFgenObsolete.h │ ├── IviPwrMeter.h │ ├── IviScopeObsolete.h │ ├── IviSwtchObsolete.h │ ├── IviUpconverter_ni.h │ ├── ivi.h │ ├── iviDcpwr.h │ ├── iviDmm.h │ ├── iviFgen.h │ ├── iviScope.h │ ├── iviSwtch.h │ ├── ivirfsiggen.h │ ├── ivispecan.h │ ├── niArbCal.h │ ├── niFgen.h │ ├── niFgenObsolete.h │ ├── niHSDIO.h │ ├── niHSDIOObsolete.h │ ├── niModInst.h │ ├── niRFSA.h │ ├── niRFSAErrors.h │ ├── niScope.h │ ├── niScopeCal.h │ ├── niScopeObsolete.h │ ├── niTClk.h │ ├── niTuner.h │ ├── nidcpower.h │ ├── nidmm.h │ ├── nidmmObsolete.h │ ├── niswitch.h │ ├── niswitchTopologies.h │ ├── visa.h │ ├── visa32.bas │ ├── visatype.h │ ├── vpptype.bas │ └── vpptype.h └── lib │ ├── bc │ ├── ivi.lib │ ├── niHSDIO.lib │ ├── niScope.lib │ ├── niTClk.lib │ ├── nidcpower.lib │ ├── nidmm.lib │ ├── niswitch.lib │ └── visa32.lib │ └── msc │ ├── ivi.lib │ ├── niArbCal.lib │ ├── niFgen.lib │ ├── niHSDIO.lib │ ├── niModInst.lib │ ├── niRFSA.lib │ ├── niScope.lib │ ├── niTClk.lib │ ├── niTuner.lib │ ├── nidcpower.lib │ ├── nidmm.lib │ ├── nidmm_32.lib │ ├── niswitch.lib │ └── visa32.lib ├── README.md ├── Visadll ├── AppIco.rc ├── Visadll.pro ├── labview.ico ├── main.cpp ├── measurethread.cpp ├── measurethread.h ├── widget.cpp ├── widget.h ├── widget.ui ├── widget_cmd.cpp ├── widget_measure.cpp └── widget_timer_recorder.cpp ├── 地震局.xls ├── 手动测量时间间隔.iseqx └── 指令表.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | 3 | *.slo 4 | *.lo 5 | *.o 6 | *.a 7 | *.la 8 | *.lai 9 | *.so 10 | *.dylib 11 | 12 | # Qt-es 13 | 14 | /.qmake.cache 15 | /.qmake.stash 16 | *.pro.user 17 | *.pro.user.* 18 | *.qbs.user 19 | *.qbs.user.* 20 | *.moc 21 | moc_*.cpp 22 | moc_*.h 23 | qrc_*.cpp 24 | ui_*.h 25 | Makefile* 26 | *build-* 27 | 28 | # QtCreator 29 | 30 | *.autosave 31 | 32 | # QtCtreator Qml 33 | *.qmlproject.user 34 | *.qmlproject.user.* 35 | 36 | # QtCtreator CMake 37 | CMakeLists.txt.user* 38 | 39 | -------------------------------------------------------------------------------- /Ni/include/IviDCPwrObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * I V I - D C P W R 2.0 3 | *---------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 2002. All Rights Reserved. 5 | *---------------------------------------------------------------------------- 6 | * 7 | * Title: IviDCPwrObsolete.h 8 | * Purpose: IviDCPwr Class value and attribute Id declarations for the 9 | * now obsolete IviDCPwr 2.0 specification. 10 | * These macros are defined to keep backward compatibility with 11 | * previous versions of this file. DC Power Supply specific 12 | * drivers should no longer use these macros. Instead, the 13 | * drivers must use definitions from the current IviDCPwr.h 14 | * header file. 15 | *****************************************************************************/ 16 | 17 | #ifndef IVIDCPWR_HEADER_OBSOLETE 18 | #define IVIDCPWR_HEADER_OBSOLETE 19 | #include 20 | 21 | /*- Obsolete Inherent Attributes -*/ 22 | #define IVIDCPWR_ATTR_CLASS_DRIVER_MAJOR_VERSION IVI_ATTR_CLASS_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 23 | #define IVIDCPWR_ATTR_CLASS_DRIVER_MINOR_VERSION IVI_ATTR_CLASS_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 24 | 25 | #define IVIDCPWR_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 26 | #define IVIDCPWR_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 27 | #define IVIDCPWR_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 28 | #define IVIDCPWR_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read-only */ 29 | #define IVIDCPWR_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS 30 | 31 | #define IVIDCPWR_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE 32 | #define IVIDCPWR_ATTR_IO_SESSION IVI_ATTR_IO_SESSION 33 | 34 | #define IVIDCPWR_ATTR_ATTRIBUTE_CAPABILITIES IVI_ATTR_ATTRIBUTE_CAPABILITIES /* ViString, read-only */ 35 | 36 | /*- Error Info -*/ 37 | #define IVIDCPWR_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 38 | #define IVIDCPWR_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 39 | #define IVIDCPWR_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 40 | 41 | /*- Error Information Functions -*/ 42 | ViStatus _VI_FUNC IviDCPwr_GetErrorInfo (ViSession vi, 43 | ViStatus *primaryError, 44 | ViStatus *secondaryError, 45 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 46 | 47 | ViStatus _VI_FUNC IviDCPwr_ClearErrorInfo (ViSession vi); 48 | 49 | /***************************************************************************** 50 | *---------------------------- End Include File -----------------------------* 51 | *****************************************************************************/ 52 | 53 | #endif /* IVIDCPWR_HEADER_OBSOLETE */ 54 | -------------------------------------------------------------------------------- /Ni/include/IviDmmObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * I V I - DMM 3 | *---------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1998. All Rights Reserved. 5 | *---------------------------------------------------------------------------- 6 | * 7 | * Title: IviDmmObsolete.h 8 | * Purpose: IviDmm Class value and attribute Id declarations for the 9 | * now obsolete IviDmm 1.0 specification. 10 | * These macros are defined to keep backward compatibility with 11 | * previous versions of this file. Dmm specific drivers 12 | * should no longer use these macros. Instead, the drivers must 13 | * use definitions from the current IviDmm.h header file. 14 | *****************************************************************************/ 15 | 16 | #ifndef IVIDMM_HEADER_OBSOLETE 17 | #define IVIDMM_HEADER_OBSOLETE 18 | 19 | /*- Obsolete Inherent Attributes -*/ 20 | #define IVIDMM_ATTR_CLASS_MAJOR_VERSION IVI_ATTR_CLASS_MAJOR_VERSION /* ViInt32, read-only */ 21 | #define IVIDMM_ATTR_CLASS_MINOR_VERSION IVI_ATTR_CLASS_MINOR_VERSION /* ViInt32, read-only */ 22 | #define IVIDMM_ATTR_CLASS_REVISION IVI_ATTR_CLASS_REVISION /* ViString, read-only */ 23 | 24 | #define IVIDMM_ATTR_CLASS_PREFIX IVI_ATTR_CLASS_PREFIX /* ViString, read-only */ 25 | #define IVIDMM_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_PREFIX /* ViString, read-only */ 26 | #define IVIDMM_ATTR_MODULE_PATHNAME IVI_ATTR_MODULE_PATHNAME /* ViString, read-only */ 27 | 28 | #define IVIDMM_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 29 | #define IVIDMM_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 30 | #define IVIDMM_ATTR_DRIVER_REVISION IVI_ATTR_DRIVER_REVISION /* ViString, read-only */ 31 | 32 | #define IVIDMM_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, read-only */ 33 | #define IVIDMM_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, read-only */ 34 | #define IVIDMM_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, read-only */ 35 | 36 | #define IVIDMM_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS /* ViInt32, read-only */ 37 | #define IVIDMM_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 38 | #define IVIDMM_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read-only */ 39 | 40 | #define IVIDMM_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE 41 | #define IVIDMM_ATTR_IO_SESSION IVI_ATTR_IO_SESSION 42 | 43 | #define IVIDMM_ATTR_CLASS_DRIVER_MAJOR_VERSION IVI_ATTR_CLASS_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 44 | #define IVIDMM_ATTR_CLASS_DRIVER_MINOR_VERSION IVI_ATTR_CLASS_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 45 | 46 | #define IVIDMM_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 47 | #define IVIDMM_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 48 | 49 | #define IVIDMM_ATTR_ATTRIBUTE_CAPABILITIES IVI_ATTR_ATTRIBUTE_CAPABILITIES /* ViString, read-only */ 50 | 51 | /*- Error Info -*/ 52 | #define IVIDMM_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 53 | #define IVIDMM_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 54 | #define IVIDMM_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 55 | 56 | /*- Obsolete Macros -*/ 57 | #define IVIDMM_VAL_OVER_RANGE_READING (1.0E+301) 58 | #define IVIDMM_VAL_MAX_VALID_READING (1.0E+300) 59 | 60 | /*- Obsolete Attributes -*/ 61 | #define IVIDMM_ATTR_RESOLUTION (IVI_CLASS_PUBLIC_ATTR_BASE + 3L) 62 | 63 | /*- Obsolete values for attributes -*/ 64 | /*- IVIDMM_ATTR_FUNCTION values -*/ 65 | #define IVIDMM_VAL_DIODE (102) 66 | #define IVIDMM_VAL_CONTINUITY (103) 67 | #define IVIDMM_VAL_TEMP_F (109) 68 | #define IVIDMM_VAL_TEMP_C (108) 69 | #define IVIDMM_VAL_SIEMENS (110) 70 | #define IVIDMM_VAL_COULOMBS (111) 71 | 72 | /*- IVIDMM_ATTR_RESOLUTION values -*/ 73 | #define IVIDMM_VAL_3_5_DIGITS (3.5) 74 | #define IVIDMM_VAL_4_DIGITS (4.0) 75 | #define IVIDMM_VAL_4_5_DIGITS (4.5) 76 | #define IVIDMM_VAL_5_DIGITS (5.0) 77 | #define IVIDMM_VAL_5_5_DIGITS (5.5) 78 | #define IVIDMM_VAL_6_DIGITS (6.0) 79 | #define IVIDMM_VAL_6_5_DIGITS (6.5) 80 | #define IVIDMM_VAL_7_DIGITS (7.0) 81 | #define IVIDMM_VAL_7_5_DIGITS (7.5) 82 | 83 | /*- IVIDMM_ATTR_TRIGGER_SOURCE values -*/ 84 | #define IVIDMM_VAL_GPIB_GET (101L) 85 | #define IVIDMM_VAL_SW_TRIG_FUNC (3L) 86 | 87 | /*- IVIDMM_ATTR_POWERLINE_FREQ values -*/ 88 | #define IVIDMM_VAL_50_HERTZ (50.0) 89 | #define IVIDMM_VAL_60_HERTZ (60.0) 90 | #define IVIDMM_VAL_400_HERTZ (400.0) 91 | 92 | /*- IVIDMM_ATTR_TRIGGER_POLARITY values -*/ 93 | #define IVIDMM_VAL_POS IVIDMM_VAL_POSITIVE 94 | #define IVIDMM_VAL_NEG IVIDMM_VAL_NEGATIVE 95 | 96 | /*- Obsolete error and completion code values -*/ 97 | #define IVIDMM_ERROR_ACCURACY_UNKNOWN (IVI_CLASS_ERROR_BASE + 1) 98 | #define IVIDMM_ERROR_ACCURACY_UNKNOWN_WHILE_AUTORANGING (IVI_CLASS_ERROR_BASE + 2) 99 | 100 | #define IVIDMM_ERRMSG_ACCURACY_UNKNOWN "The accuracy is unknown or not specified." 101 | #define IVIDMM_ERRMSG_ACCURACY_UNKNOWN_WHILE_AUTORANGING "The accuracy could not be determined while the DMM was autoranging." 102 | 103 | /*- Obsolete Error Information Functions -*/ 104 | ViStatus _VI_FUNC IviDmm_GetErrorInfo (ViSession vi, 105 | ViStatus *primaryError, 106 | ViStatus *secondaryError, 107 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 108 | 109 | ViStatus _VI_FUNC IviDmm_ClearErrorInfo (ViSession vi); 110 | 111 | /*- Obsolete functions -*/ 112 | 113 | ViStatus _VI_FUNC IviDmm_Configure (ViSession vi, ViInt32 measFunction, ViReal64 range, 114 | ViReal64 resolution, ViReal64 acMinFreq, ViReal64 acMaxFreq); 115 | ViStatus _VI_FUNC IviDmm_SendSWTrigger (ViSession vi); 116 | ViStatus _VI_FUNC IviDmm_CalculateAccuracy (ViSession vi, ViReal64 freqOfInterest, 117 | ViReal64 *readingMultiplier, ViReal64 *offset); 118 | 119 | 120 | /***************************************************************************** 121 | *---------------------------- End Include File -----------------------------* 122 | *****************************************************************************/ 123 | 124 | #endif /* __IVIDMM_HEADER_OBSOLETE */ 125 | -------------------------------------------------------------------------------- /Ni/include/IviFgenObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * I V I - F G E N * 3 | *---------------------------------------------------------------------------* 4 | * Copyright (c) National Instruments 1999. All Rights Reserved. * 5 | *---------------------------------------------------------------------------* 6 | * * 7 | * Title: IviFgenObsolete.h * 8 | * Purpose: IviFgen Class value and attribute Id declarations for the * 9 | * now obsolete IviFgen 1.0 specification. * 10 | * These macros are defined to keep backward compatibility with * 11 | * previous versions of this file. Instrument specific * 12 | * drivers should no longer use these macros. Instead, the * 13 | * drivers must use definitions from the current IviFgen.h * 14 | * header file. * 15 | *****************************************************************************/ 16 | 17 | #ifndef __IVIFGEN_HEADER_OBSOLETE 18 | #define __IVIFGEN_HEADER_OBSOLETE 19 | #include 20 | 21 | /*- Obsolete Inherent Attributes -*/ 22 | #define IVIFGEN_ATTR_CLASS_MAJOR_VERSION IVI_ATTR_CLASS_MAJOR_VERSION 23 | #define IVIFGEN_ATTR_CLASS_MINOR_VERSION IVI_ATTR_CLASS_MINOR_VERSION 24 | #define IVIFGEN_ATTR_CLASS_REVISION IVI_ATTR_CLASS_REVISION 25 | 26 | #define IVIFGEN_ATTR_CLASS_PREFIX IVI_ATTR_CLASS_PREFIX 27 | #define IVIFGEN_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_PREFIX 28 | #define IVIFGEN_ATTR_MODULE_PATHNAME IVI_ATTR_MODULE_PATHNAME 29 | 30 | #define IVIFGEN_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_DRIVER_MAJOR_VERSION 31 | #define IVIFGEN_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_DRIVER_MINOR_VERSION 32 | #define IVIFGEN_ATTR_DRIVER_REVISION IVI_ATTR_DRIVER_REVISION 33 | 34 | #define IVIFGEN_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, read-only */ 35 | #define IVIFGEN_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, read-only */ 36 | #define IVIFGEN_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, read-only */ 37 | 38 | #define IVIFGEN_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS 39 | #define IVIFGEN_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 40 | #define IVIFGEN_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read-only */ 41 | 42 | #define IVIFGEN_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE 43 | #define IVIFGEN_ATTR_IO_SESSION IVI_ATTR_IO_SESSION 44 | 45 | #define IVIFGEN_ATTR_CLASS_DRIVER_MAJOR_VERSION IVI_ATTR_CLASS_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 46 | #define IVIFGEN_ATTR_CLASS_DRIVER_MINOR_VERSION IVI_ATTR_CLASS_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 47 | 48 | #define IVIFGEN_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 49 | #define IVIFGEN_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 50 | 51 | #define IVIFGEN_ATTR_ATTRIBUTE_CAPABILITIES IVI_ATTR_ATTRIBUTE_CAPABILITIES /* ViString, read-only */ 52 | 53 | /*- Error Info -*/ 54 | #define IVIFGEN_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 55 | #define IVIFGEN_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 56 | #define IVIFGEN_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 57 | 58 | /*- Obsolete Attributes -*/ 59 | #define IVIFGEN_ATTR_CYCLE_COUNT (IVI_CLASS_PUBLIC_ATTR_BASE + 301L) 60 | 61 | /*- Obsolete values for function parameters -*/ 62 | #define IVIFGEN_VAL_FIRST_WAVEFORM_HANDLE (10000L) 63 | #define IVIFGEN_VAL_LAST_WAVEFORM_HANDLE (IVIFGEN_VAL_FIRST_WAVEFORM_HANDLE + 9999L) 64 | 65 | #define IVIFGEN_VAL_FIRST_SEQUENCE_HANDLE (100000L) 66 | #define IVIFGEN_VAL_LAST_SEQUENCE_HANDLE (IVIFGEN_VAL_FIRST_SEQUENCE_HANDLE + 9999L) 67 | 68 | /*- Obsolete values for attributes -*/ 69 | /*- IVIFGEN_ATTR_REF_CLOCK_SOURCE values -*/ 70 | #define IVIFGEN_VAL_INTERNAL (0L) 71 | #define IVIFGEN_VAL_RTSI_CLOCK (101L) 72 | 73 | /*- IVIFGEN_ATTR_OUTPUT_IMPEDANCE values -*/ 74 | #define IVIFGEN_VAL_50_OHMS (50.0) 75 | #define IVIFGEN_VAL_75_OHMS (75.0) 76 | #define IVIFGEN_VAL_1_MEGA_OHM (1.0e+6) 77 | 78 | /*- IVIFGEN_ATTR_FUNC_WAVEFORM values -*/ 79 | #define IVIFGEN_VAL_WFM_BASE (0L) 80 | 81 | /*- IVIFGEN_ATTR_TRIGGER_SOURCE values -*/ 82 | #define IVIFGEN_VAL_IMMEDIATE (0L) 83 | #define IVIFGEN_VAL_SW_TRIG_FUNC (2L) 84 | #define IVIFGEN_VAL_GPIB_GET (101L) 85 | 86 | /*- IVIFGEN_ATTR_CYCLE_COUNT values -*/ 87 | #define IVIFGEN_VAL_GENERATE_CONTINUOUS (-1L) 88 | 89 | /*- IVIFGEN_ATTR_AM_INTERNAL_WAVEFORM -*/ 90 | #define IVIFGEN_VAL_AM_INTERNAL_DC (6L) 91 | 92 | /*- IVIFGEN_ATTR_FM_INTERNAL_WAVEFORM -*/ 93 | #define IVIFGEN_VAL_FM_INTERNAL_DC (6L) 94 | 95 | /*- Obsolete error and completion code values -*/ 96 | #define IVIFGEN_ERROR_NOT_CONFIGURABLE (IVI_CLASS_ERROR_BASE+0x0001L) 97 | #define IVIFGEN_ERROR_NOT_GENERATING (IVI_CLASS_ERROR_BASE+0x0002L) 98 | #define IVIFGEN_ERROR_INVALID_MODE (IVI_CLASS_ERROR_BASE+0x0003L) 99 | #define IVIFGEN_ERROR_INVALID_WFM_LENGTH (IVI_CLASS_ERROR_BASE+0x0005L) 100 | #define IVIFGEN_ERROR_INVALID_WFM_ELEMENT (IVI_CLASS_ERROR_BASE+0x0006L) 101 | #define IVIFGEN_ERROR_INVALID_WAVEFORM (IVI_CLASS_ERROR_BASE+0x0007L) 102 | #define IVIFGEN_ERROR_INVALID_SEQ_LENGTH (IVI_CLASS_ERROR_BASE+0x000AL) 103 | #define IVIFGEN_ERROR_INVALID_LOOP_COUNT (IVI_CLASS_ERROR_BASE+0x000BL) 104 | #define IVIFGEN_ERROR_INVALID_SEQUENCE (IVI_CLASS_ERROR_BASE+0x000CL) 105 | 106 | #define IVIFGEN_ERRMSG_NOT_CONFIGURABLE "The operation cannot be completed because the function generator is not configurable" 107 | #define IVIFGEN_ERRMSG_NOT_GENERATING "The operation cannot be completed because the function generator is not generating a signal" 108 | #define IVIFGEN_ERRMSG_INVALID_MODE "The operation cannot be completed in the current output mode." 109 | #define IVIFGEN_ERRMSG_INVALID_WFM_LENGTH "The waveform length is invalid." 110 | #define IVIFGEN_ERRMSG_INVALID_WFM_ELEMENT "One of the elements in the waveform data array is invalid." 111 | #define IVIFGEN_ERRMSG_INVALID_WAVEFORM "The specified waveform is invalid." 112 | #define IVIFGEN_ERRMSG_INVALID_SEQ_LENGTH "The sequence length is invalid." 113 | #define IVIFGEN_ERRMSG_INVALID_LOOP_COUNT "One of the the elements in the loop count array is invalid." 114 | #define IVIFGEN_ERRMSG_INVALID_SEQUENCE "The specified sequence is invalid." 115 | 116 | /*- Obsolete Error Information Functions -*/ 117 | ViStatus _VI_FUNC IviFgen_GetErrorInfo (ViSession vi, 118 | ViStatus *primaryError, 119 | ViStatus *secondaryError, 120 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 121 | 122 | ViStatus _VI_FUNC IviFgen_ClearErrorInfo (ViSession vi); 123 | 124 | /*- Obsolete functions -*/ 125 | ViStatus _VI_FUNC IviFgen_EnableOutput (ViSession vi, ViConstString channelName); 126 | ViStatus _VI_FUNC IviFgen_DisableOutput (ViSession vi, ViConstString channelName); 127 | ViStatus _VI_FUNC IviFgen_ConfigureTrigger (ViSession vi, ViConstString channelName, 128 | ViInt32 trigSource, ViInt32 cycleCount); 129 | ViStatus _VI_FUNC IviFgen_SendSWTrigger (ViSession vi); 130 | ViStatus _VI_FUNC IviFgen_EnableAM (ViSession vi, ViConstString channelName, 131 | ViInt32 amSource); 132 | ViStatus _VI_FUNC IviFgen_DisableAM (ViSession vi, ViConstString channelName); 133 | ViStatus _VI_FUNC IviFgen_EnableFM (ViSession vi, ViConstString channelName, 134 | ViInt32 fmSource); 135 | ViStatus _VI_FUNC IviFgen_DisableFM (ViSession vi, ViConstString channelName); 136 | 137 | /***************************************************************************** 138 | *---------------------------- End Include File -----------------------------* 139 | *****************************************************************************/ 140 | 141 | #endif /* __IVIFGEN_HEADER_OBSOLETE */ 142 | -------------------------------------------------------------------------------- /Ni/include/IviScopeObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * I V I - S C O P E 1.0 3 | *---------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1999. All Rights Reserved. 5 | *---------------------------------------------------------------------------- 6 | * 7 | * Title: IviScopeObsolete.h 8 | * Purpose: IviScope Class value and attribute Id declarations for the 9 | * now obsolete IviScope 1.0 specification. 10 | * These macros are defined to keep backward compatibility with 11 | * previous versions of this file. Oscilloscope specific 12 | * drivers should no longer use these macros. Instead, the 13 | * drivers must use definitions from the current IviScope.h 14 | * header file. 15 | *****************************************************************************/ 16 | 17 | #ifndef IVISCOPE_HEADER_OBSOLETE 18 | #define IVISCOPE_HEADER_OBSOLETE 19 | #include 20 | 21 | /*- Obsolete Inherent Attributes -*/ 22 | #define IVISCOPE_ATTR_CLASS_MAJOR_VERSION IVI_ATTR_CLASS_MAJOR_VERSION 23 | #define IVISCOPE_ATTR_CLASS_MINOR_VERSION IVI_ATTR_CLASS_MINOR_VERSION 24 | #define IVISCOPE_ATTR_CLASS_REVISION IVI_ATTR_CLASS_REVISION 25 | 26 | #define IVISCOPE_ATTR_CLASS_PREFIX IVI_ATTR_CLASS_PREFIX 27 | #define IVISCOPE_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_PREFIX 28 | #define IVISCOPE_ATTR_MODULE_PATHNAME IVI_ATTR_MODULE_PATHNAME 29 | 30 | #define IVISCOPE_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_DRIVER_MAJOR_VERSION 31 | #define IVISCOPE_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_DRIVER_MINOR_VERSION 32 | #define IVISCOPE_ATTR_DRIVER_REVISION IVI_ATTR_DRIVER_REVISION 33 | 34 | #define IVISCOPE_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, read-only */ 35 | #define IVISCOPE_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, read-only */ 36 | #define IVISCOPE_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, read-only */ 37 | 38 | #define IVISCOPE_ATTR_CLASS_DRIVER_MAJOR_VERSION IVI_ATTR_CLASS_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 39 | #define IVISCOPE_ATTR_CLASS_DRIVER_MINOR_VERSION IVI_ATTR_CLASS_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 40 | 41 | #define IVISCOPE_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 42 | #define IVISCOPE_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 43 | 44 | #define IVISCOPE_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS 45 | #define IVISCOPE_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 46 | #define IVISCOPE_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read-only */ 47 | 48 | #define IVISCOPE_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE 49 | #define IVISCOPE_ATTR_IO_SESSION IVI_ATTR_IO_SESSION 50 | 51 | #define IVISCOPE_ATTR_ATTRIBUTE_CAPABILITIES IVI_ATTR_ATTRIBUTE_CAPABILITIES /* ViString, read-only */ 52 | 53 | /*- Error Info -*/ 54 | #define IVISCOPE_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 55 | #define IVISCOPE_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 56 | #define IVISCOPE_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 57 | 58 | /*- Obsolete Attributes -*/ 59 | #define IVISCOPE_ATTR_BANDWIDTH (IVI_CLASS_PUBLIC_ATTR_BASE + 6L) 60 | #define IVISCOPE_ATTR_HORZ_RECORD_REF_POSITION (IVI_CLASS_PUBLIC_ATTR_BASE + 11L) 61 | #define IVISCOPE_ATTR_TRIGGER_DELAY_TIME (IVI_CLASS_PUBLIC_ATTR_BASE + 15L) 62 | #define IVISCOPE_ATTR_TV_TRIGGER_SIGNAL_TYPE (IVI_CLASS_PUBLIC_ATTR_BASE + 201L) 63 | #define IVISCOPE_ATTR_TV_TRIGGER_FIELD (IVI_CLASS_PUBLIC_ATTR_BASE + 202L) 64 | #define IVISCOPE_ATTR_TV_TRIGGER_LINE (IVI_CLASS_PUBLIC_ATTR_BASE + 203L) 65 | 66 | /*- Obsolete macros -*/ 67 | #define IVISCOPE_VAL_MAX_VALID_WFM_VOLTAGE (1.0E+300) 68 | #define IVISCOPE_VAL_INVALID_WFM_VOLTAGE (1.0E+301) 69 | 70 | /*- Obsolete values for function parameters -*/ 71 | #define IVISCOPE_VAL_CALCULATION_SPECIFIC_DRIVER_BASE (1000L) 72 | 73 | /*- Defined values for attributes -*/ 74 | /*- IVISCOPE_ATTR_TRIGGER_TYPE values -*/ 75 | #define IVISCOPE_VAL_EDGE (1L) 76 | #define IVISCOPE_VAL_WIDTH (101L) 77 | #define IVISCOPE_VAL_RUNT (102L) 78 | #define IVISCOPE_VAL_GLITCH (103L) 79 | #define IVISCOPE_VAL_STATE (104L) 80 | #define IVISCOPE_VAL_PATTERN (105L) 81 | #define IVISCOPE_VAL_TV (106L) 82 | 83 | 84 | /*- IVISCOPE_ATTR_TRIGGER_SOURCE values -*/ 85 | #define IVISCOPE_VAL_IMMEDIATE "VAL_IMMEDIATE" 86 | #define IVISCOPE_VAL_GPIB_GET "VAL_GPIB_GET" 87 | #define IVISCOPE_VAL_SW_TRIG_FUNC "VAL_SW_TRIG_FUNC" 88 | #define IVISCOPE_VAL_AC_LINE "VAL_AC_LINE" 89 | 90 | /*- IVISCOPE_ATTR_TV_TRIGGER_SIGNAL_TYPE values -*/ 91 | #define IVISCOPE_VAL_TV_SIGNAL_TYPE_CLASS_EXT_BASE (100L) 92 | #define IVISCOPE_VAL_TV_SIGNAL_TYPE_SPECIFIC_EXT_BASE (1000L) 93 | 94 | /*- IVISCOPE_ATTR_TV_TRIGGER_FIELD values -*/ 95 | #define IVISCOPE_VAL_TV_FIELD1 (1L) 96 | #define IVISCOPE_VAL_TV_FIELD2 (2L) 97 | #define IVISCOPE_VAL_TV_ANY_FIELD (-1L) 98 | 99 | #define IVISCOPE_VAL_TV_TRIGGER_FIELD_CLASS_EXT_BASE (100L) 100 | #define IVISCOPE_VAL_TV_TRIGGER_FIELD_SPECIFIC_EXT_BASE (1000L) 101 | 102 | /*- IVISCOPE_ATTR_ACQUISITION_TYPE value -*/ 103 | #define IVISCOPE_VAL_ACQ_TYPE_CLASS_EXT_BASE (100L) 104 | #define IVISCOPE_VAL_ACQ_TYPE_SPECIFIC_EXT_BASE (1000L) 105 | 106 | /*- IVISCOPE_ATTR_NUM_ENVELOPES values -*/ 107 | /*- IVISCOPE_ATTR_NUM_AVERAGES values -*/ 108 | #define IVISCOPE_VAL_INFINITE (-1L) 109 | 110 | /*- IVISCOPE_ATTR_INPUT_IMPEDANCE values -*/ 111 | #define IVISCOPE_VAL_50_OHMS (50.0) 112 | #define IVISCOPE_VAL_75_OHMS (75.0) 113 | #define IVISCOPE_VAL_1_MEG_OHM (1000000.0) 114 | 115 | /*- Error Information Functions -*/ 116 | ViStatus _VI_FUNC IviScope_GetErrorInfo (ViSession vi, 117 | ViStatus *primaryError, 118 | ViStatus *secondaryError, 119 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 120 | 121 | ViStatus _VI_FUNC IviScope_ClearErrorInfo (ViSession vi); 122 | 123 | /*- IviScope Obsolete functions -*/ 124 | ViStatus _VI_FUNC IviScope_ConfigureVertical (ViSession vi, ViConstString channel, 125 | ViReal64 range, ViReal64 offset, 126 | ViInt32 coupling, ViReal64 probeAttenuation, 127 | ViBoolean enabled); 128 | ViStatus _VI_FUNC IviScope_ConfigureHorizontal (ViSession vi, ViReal64 timePerRecord, 129 | ViInt32 minimumRecordLength, 130 | ViReal64 triggerPosition); 131 | ViStatus _VI_FUNC IviScope_ConfigureTriggerSource (ViSession vi, ViConstString triggerSource, 132 | ViInt32 triggerType, ViReal64 triggerDelay, 133 | ViReal64 holdoff); 134 | ViStatus _VI_FUNC IviScope_ConfigureEdgeTrigger (ViSession vi, ViReal64 level, 135 | ViInt32 triggerCoupling, ViInt32 slope); 136 | ViStatus _VI_FUNC IviScope_SendSWTrigger (ViSession vi); 137 | ViStatus _VI_FUNC IviScope_ConfigureTVTrigger (ViSession vi, ViInt32 TVSignalType, 138 | ViInt32 TVField, ViInt32 TVLine, ViInt32 TVPolarity); 139 | ViStatus _VI_FUNC IviScope_ConfigureRuntTrigger (ViSession vi, ViReal64 runtLowThreshold, 140 | ViReal64 runtHighThreshold, ViInt32 runtPolarity); 141 | ViStatus _VI_FUNC IviScope_ConfigureGlitchTrigger (ViSession vi, ViReal64 level, 142 | ViReal64 glitchWidth, ViInt32 glitchPolarity); 143 | ViStatus _VI_FUNC IviScope_ConfigureWidthTrigger (ViSession vi, ViReal64 level, 144 | ViReal64 widthLowThreshold, ViReal64 widthHighThreshold, 145 | ViInt32 widthPolarity, ViInt32 widthCondition); 146 | ViStatus _VI_FUNC IviScope_ConfigureAcquisition (ViSession vi, ViInt32 acquisitionType); 147 | 148 | /***************************************************************************** 149 | *---------------------------- End Include File -----------------------------* 150 | *****************************************************************************/ 151 | 152 | #endif /* IVISCOPE_HEADER_OBSOLETE */ 153 | -------------------------------------------------------------------------------- /Ni/include/IviSwtchObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * I V I - S W T C H 1.0 3 | *---------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1999. All Rights Reserved. 5 | *---------------------------------------------------------------------------- 6 | * 7 | * Title: IviSwtchObsolete.h 8 | * Purpose: IviSwtch Class value and attribute Id declarations for the 9 | * now obsolete IviSwtch 1.0 specification. 10 | * These macros are defined to keep backward compatibility with 11 | * previous versions of this file. Swtich specific drivers 12 | * should no longer use these macros. Instead, the drivers must 13 | * use definitions from the current IviSwtch.h header file. 14 | *****************************************************************************/ 15 | 16 | #ifndef IVISWTCH_HEADER_OBSOLETE 17 | #define IVISWTCH_HEADER_OBSOLETE 18 | #include 19 | 20 | /*- Obsolete Inherent Attributes -*/ 21 | #define IVISWTCH_ATTR_CLASS_MAJOR_VERSION IVI_ATTR_CLASS_MAJOR_VERSION 22 | #define IVISWTCH_ATTR_CLASS_MINOR_VERSION IVI_ATTR_CLASS_MINOR_VERSION 23 | #define IVISWTCH_ATTR_CLASS_REVISION IVI_ATTR_CLASS_REVISION 24 | 25 | #define IVISWTCH_ATTR_CLASS_PREFIX IVI_ATTR_CLASS_PREFIX 26 | #define IVISWTCH_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_PREFIX 27 | #define IVISWTCH_ATTR_MODULE_PATHNAME IVI_ATTR_MODULE_PATHNAME 28 | 29 | #define IVISWTCH_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_DRIVER_MAJOR_VERSION 30 | #define IVISWTCH_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_DRIVER_MINOR_VERSION 31 | #define IVISWTCH_ATTR_DRIVER_REVISION IVI_ATTR_DRIVER_REVISION 32 | 33 | #define IVISWTCH_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, read-only */ 34 | #define IVISWTCH_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, read-only */ 35 | #define IVISWTCH_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, read-only */ 36 | 37 | #define IVISWTCH_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS 38 | #define IVISWTCH_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 39 | #define IVISWTCH_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read-only */ 40 | 41 | #define IVISWTCH_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE 42 | #define IVISWTCH_ATTR_IO_SESSION IVI_ATTR_IO_SESSION 43 | 44 | #define IVISWTCH_ATTR_CLASS_DRIVER_MAJOR_VERSION IVI_ATTR_CLASS_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 45 | #define IVISWTCH_ATTR_CLASS_DRIVER_MINOR_VERSION IVI_ATTR_CLASS_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 46 | 47 | #define IVISWTCH_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, read-only */ 48 | #define IVISWTCH_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, read-only */ 49 | 50 | #define IVISWTCH_ATTR_ATTRIBUTE_CAPABILITIES IVI_ATTR_ATTRIBUTE_CAPABILITIES /* ViString, read-only */ 51 | 52 | /*- Error Info -*/ 53 | #define IVISWTCH_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 54 | #define IVISWTCH_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 55 | #define IVISWTCH_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 56 | 57 | /*- IviSwtch Obsolete Macros -*/ 58 | #define IVISWTCH_VAL_1_WIRE (1L) 59 | #define IVISWTCH_VAL_2_WIRE (2L) 60 | #define IVISWTCH_VAL_3_WIRE (3L) 61 | #define IVISWTCH_VAL_4_WIRE (4L) 62 | #define IVISWTCH_VAL_GPIB_GET (101L) 63 | #define IVISWTCH_VAL_SW_TRIG_FUNC (3L) 64 | 65 | #define IVISWTCH_VAL_TRIGGER_SPECIFIC_EXT_BASE (1000L) 66 | 67 | /*- Error Information Functions -*/ 68 | ViStatus _VI_FUNC IviSwtch_GetErrorInfo (ViSession vi, 69 | ViStatus *primaryError, 70 | ViStatus *secondaryError, 71 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 72 | 73 | ViStatus _VI_FUNC IviSwtch_ClearErrorInfo (ViSession vi); 74 | 75 | /*- IviSwtch Obsolete Functions -*/ 76 | ViStatus _VI_FUNC IviSwtch_SendSWTrigger (ViSession vi); 77 | 78 | /***************************************************************************** 79 | *---------------------------- End Include File -----------------------------* 80 | *****************************************************************************/ 81 | 82 | #endif /* IVISWTCH_HEADER_OBSOLETE */ 83 | -------------------------------------------------------------------------------- /Ni/include/niArbCal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/include/niArbCal.h -------------------------------------------------------------------------------- /Ni/include/niFgenObsolete.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * NI-FGEN Instrument Driver for National Instruments Signal Generators 3 | *--------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1998-2003. All Rights Reserved. 5 | *--------------------------------------------------------------------------- 6 | * 7 | * Title: niFgenObsolete.h 8 | * Purpose: NI-FGEN Instrument Driver for National Instruments Signal Generators 9 | * Obsolete functions and attributes declarations. 10 | * 11 | ****************************************************************************/ 12 | 13 | #ifndef __NIFGENOBSOLETE_HEADER 14 | #define __NIFGENOBSOLETE_HEADER 15 | 16 | /* Pragma used in CVI to indicate that functions in this file have 17 | * user protection associated with them */ 18 | #ifdef _CVI_ 19 | #pragma EnableLibraryRuntimeChecking 20 | #endif 21 | 22 | #include 23 | 24 | /* Compatibility with older versions ------*/ 25 | 26 | /*- Deprecated Attributes and Values --------*/ 27 | // 28 | // Obsoleted prior to NI-FGEN 2.4 29 | // 30 | #define NIFGEN_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_DRIVER_PREFIX /* ViString, Read-only */ 31 | #define NIFGEN_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32, Read-only */ 32 | #define NIFGEN_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32, Read-only */ 33 | #define NIFGEN_ATTR_DRIVER_REVISION IVI_ATTR_SPECIFIC_DRIVER_REVISION /* ViString, Read-only */ 34 | #define NIFGEN_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, Read-only */ 35 | #define NIFGEN_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, Read-only */ 36 | #define NIFGEN_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, Read-only */ 37 | #define NIFGEN_ATTR_VISA_RM_SESSION IVI_ATTR_VISA_RM_SESSION /* ViSession, Read-only */ 38 | #define NIFGEN_ATTR_IO_SESSION IVI_ATTR_IO_SESSION /* ViSession, Read-only */ 39 | #define NIFGEN_ATTR_DEFER_UPDATE IVI_ATTR_DEFER_UPDATE /* ViBoolean */ 40 | #define NIFGEN_ATTR_RETURN_DEFERRED_VALUES IVI_ATTR_RETURN_DEFERRED_VALUES /* ViBoolean */ 41 | #define NIFGEN_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 42 | #define NIFGEN_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 43 | #define NIFGEN_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 44 | #define NIFGEN_ATTR_CYCLE_COUNT IVIFGEN_ATTR_BURST_COUNT /* ViInt32, multi-channel */ 45 | #define NIFGEN_VAL_TTL7 IVIFGEN_VAL_TTL7 46 | #define NIFGEN_VAL_RTSI_CLOCK IVIFGEN_VAL_REF_CLOCK_RTSI_CLOCK 47 | #define NIFGEN_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS /* ViInt32, Read-only */ 48 | #define NIFGEN_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 49 | #define NIFGEN_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION /* ViInt32 */ 50 | #define NIFGEN_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION /* ViInt32 */ 51 | #define NIFGEN_VAL_SW_TRIG_FUNC IVIFGEN_VAL_SOFTWARE_TRIG 52 | #define NIFGEN_ATTR_OSP_DATA_RATE NIFGEN_ATTR_OSP_IQ_RATE /* ViReal64 */ 53 | 54 | // 55 | // Obsoleted in NI-FGEN 2.4 56 | // 57 | /*- Defined values for attribute NIFGEN_ATTR_TRIGGER_SOURCE ------------*/ 58 | #define NIFGEN_VAL_IMMEDIATE 0L 59 | #define NIFGEN_VAL_EXTERNAL IVIFGEN_VAL_EXTERNAL 60 | #define NIFGEN_VAL_SOFTWARE_TRIG IVIFGEN_VAL_SOFTWARE_TRIG 61 | #define NIFGEN_VAL_PXI_STAR IVIFGEN_VAL_PXI_STAR 62 | #define NIFGEN_VAL_RTSI_0 IVIFGEN_VAL_RTSI_0 63 | #define NIFGEN_VAL_RTSI_1 IVIFGEN_VAL_RTSI_1 64 | #define NIFGEN_VAL_RTSI_2 IVIFGEN_VAL_RTSI_2 65 | #define NIFGEN_VAL_RTSI_3 IVIFGEN_VAL_RTSI_3 66 | #define NIFGEN_VAL_RTSI_4 IVIFGEN_VAL_RTSI_4 67 | #define NIFGEN_VAL_RTSI_5 IVIFGEN_VAL_RTSI_5 68 | #define NIFGEN_VAL_RTSI_6 IVIFGEN_VAL_RTSI_6 69 | #define NIFGEN_VAL_TTL0 IVIFGEN_VAL_TTL0 70 | #define NIFGEN_VAL_TTL1 IVIFGEN_VAL_TTL1 71 | #define NIFGEN_VAL_TTL2 IVIFGEN_VAL_TTL2 72 | #define NIFGEN_VAL_TTL3 IVIFGEN_VAL_TTL3 73 | #define NIFGEN_VAL_TTL4 IVIFGEN_VAL_TTL4 74 | #define NIFGEN_VAL_TTL5 IVIFGEN_VAL_TTL5 75 | #define NIFGEN_VAL_TTL6 IVIFGEN_VAL_TTL6 76 | 77 | /*- Defined values for attribute NIFGEN_ATTR_UPDATE_CLOCK_SOURCE ------------*/ 78 | #define NIFGEN_VAL_INTERNAL (0L) 79 | /*NIFGEN_VAL_EXTERNAL*/ 80 | 81 | /*- Defined values for signal routing ----------------------------------*/ 82 | #define NIFGEN_VAL_PLL_REF_SOURCE (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 3L) 83 | #define NIFGEN_VAL_PFI_1 (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 12L) 84 | #define NIFGEN_VAL_PFI_2 (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 13L) 85 | #define NIFGEN_VAL_PFI_3 (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 14L) 86 | #define NIFGEN_VAL_PFI_4 (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 15L) 87 | #define NIFGEN_VAL_PFI_5 (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 16L) 88 | #define NIFGEN_VAL_UPDATE_CLOCK (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 17L) 89 | #define NIFGEN_VAL_OTHER_TERMINAL (IVIFGEN_VAL_TRIG_SRC_SPECIFIC_EXT_BASE + 18L) 90 | 91 | /*- Defined values for attribute NIFGEN_ATTR_REF_CLOCK_SOURCE ----------*/ 92 | #define NIFGEN_VAL_REF_CLOCK_INTERNAL IVIFGEN_VAL_REF_CLOCK_INTERNAL 93 | #define NIFGEN_VAL_REF_CLOCK_EXTERNAL IVIFGEN_VAL_REF_CLOCK_EXTERNAL 94 | #define NIFGEN_VAL_REF_CLOCK_RTSI_CLOCK IVIFGEN_VAL_REF_CLOCK_RTSI_CLOCK 95 | #define NIFGEN_VAL_REF_CLOCK_TTL7 IVIFGEN_VAL_TTL7 96 | #define NIFGEN_VAL_REF_IN (NIFGEN_VAL_CLK_SRC_BASE + 0L) 97 | #define NIFGEN_VAL_PXI_CLK10 (NIFGEN_VAL_CLK_SRC_BASE + 1L) 98 | #define NIFGEN_VAL_CLK_IN (NIFGEN_VAL_CLK_SRC_BASE + 2L) 99 | #define NIFGEN_VAL_DDC_CLK_IN (NIFGEN_VAL_CLK_SRC_BASE + 3L) 100 | 101 | /*- Attributes ---------------------*/ 102 | #define NIFGEN_ATTR_UPDATE_CLOCK_SOURCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 106L) /* ViInt32 */ 103 | #define NIFGEN_ATTR_REF_CLOCK_SOURCE IVIFGEN_ATTR_REF_CLOCK_SOURCE /* ViInt32 */ 104 | 105 | // 106 | // Obsoleted in NI-FGEN 2.6.1 107 | // 108 | #define NIFGEN_ATTR_OPERATION_MODE IVIFGEN_ATTR_OPERATION_MODE /* ViInt32 */ 109 | #define NIFGEN_ATTR_ACTUAL_ARB_SAMPLE_RATE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 109L) /* ViReal64, read-only */ 110 | #define NIFGEN_ATTR_DAQMX_TASK (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 221L) /* ViInt32 */ 111 | 112 | /*- Deprecated Types --------------*/ 113 | 114 | // 115 | // Obsoleted in NI-FGEN 2.4 116 | // 117 | typedef NIComplexNumber niFgen_ComplexF64; 118 | 119 | 120 | 121 | /*- Deprecated Functions ----------*/ 122 | 123 | // 124 | // Obsoleted in NI-FGEN 2.0 125 | // 126 | ViStatus _VI_FUNC niFgen_IviInit( 127 | ViChar instrName[], 128 | ViBoolean IDQuery, 129 | ViBoolean resetDevice, 130 | ViSession vi); 131 | 132 | ViStatus _VI_FUNC niFgen_IviClose( 133 | ViSession vi); 134 | 135 | ViStatus _VI_FUNC niFgen_GetErrorInfo( 136 | ViSession vi, 137 | ViStatus *primaryError, 138 | ViStatus *secondaryError, 139 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 140 | 141 | ViStatus _VI_FUNC niFgen_ClearErrorInfo( 142 | ViSession vi); 143 | 144 | ViStatus _VI_FUNC niFgen_EnableOutput( 145 | ViSession vi, 146 | ViConstString channelName); 147 | 148 | ViStatus _VI_FUNC niFgen_DisableOutput( 149 | ViSession vi, 150 | ViConstString channelName); 151 | 152 | ViStatus _VI_FUNC niFgen_ConfigureTrigger( 153 | ViSession vi, 154 | ViConstString channelName, 155 | ViInt32 trigSource, 156 | ViInt32 cycleCount); 157 | 158 | ViStatus _VI_FUNC niFgen_SendSWTrigger( 159 | ViSession vi); 160 | 161 | 162 | // 163 | // Obsoleted in NI-FGEN 2.2 164 | // 165 | 166 | // use niFgen_CreateWaveformF64 instead 167 | ViStatus _VI_FUNC niFgen_CreateArbWaveform( 168 | ViSession vi, 169 | ViInt32 wfmSize, 170 | ViReal64 wfmData[], 171 | ViInt32 *wfmHandle); 172 | 173 | // use niFgen_CreateWaveformI16 instead 174 | ViStatus _VI_FUNC niFgen_CreateBinary16ArbWaveform( 175 | ViSession vi, 176 | ViInt32 wfmSize, 177 | ViInt16 wfmData[], 178 | ViInt32 *wfmHandle); 179 | 180 | // 181 | // Obsoleted in NI-FGEN 2.3 182 | // 183 | 184 | // use niFgen_SetAttributeViReal64 with attribute NIFGEN_ATTR_ARB_GAIN instead 185 | ViStatus _VI_FUNC niFgen_ConfigureGain( 186 | ViSession vi, 187 | ViConstString channelName, 188 | ViReal64 Gain); 189 | 190 | // 191 | // Obsoleted in NI-FGEN 2.4 192 | // 193 | 194 | // use niFgen_ConfigureReferenceClock instead 195 | ViStatus _VI_FUNC niFgen_ConfigureRefClockSource( 196 | ViSession vi, 197 | ViInt32 referenceClockSource); 198 | 199 | // use niFgen_ConfigureReferenceClock instead 200 | ViStatus _VI_FUNC niFgen_ConfigureRefClockFrequency( 201 | ViSession vi, 202 | ViReal64 frequency); 203 | 204 | // use niFgen_ConfigureSampleClockSource instead 205 | ViStatus _VI_FUNC niFgen_ConfigureUpdateClockSource( 206 | ViSession vi, 207 | ViInt32 source); 208 | 209 | // use niFgen_SendSoftwareEdgeTrigger instead 210 | ViStatus _VI_FUNC niFgen_SendSoftwareTrigger( 211 | ViSession vi); 212 | 213 | // use the configure trigger specific to the trigger instead 214 | ViStatus _VI_FUNC niFgen_ConfigureTriggerSource( 215 | ViSession vi, 216 | ViConstString channelName, 217 | ViInt32 trigSource); 218 | 219 | // 220 | // Obsoleted in NI-FGEN 2.7 221 | // 222 | 223 | ViStatus _VI_FUNC niFgen_CalAdjustCalADC( 224 | ViSession vi, 225 | ViReal64* voltagesMeasuredExternally, 226 | ViReal64* voltagesMeasuredWithCalADC); 227 | 228 | 229 | #endif /* __NIFGENOBSOLETE_HEADER */ 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /Ni/include/niHSDIOObsolete.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * National Instruments High Speed Sources Signal Generator 3 | *--------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1998-2003. All Rights Reserved. 5 | *--------------------------------------------------------------------------- 6 | * 7 | * Title: niHSDIOObsolete.h 8 | * Purpose: National Instruments High-Speed Digital I/O 9 | * Instrument Driver declarations : Obsolete functions and attributes. 10 | * 11 | ****************************************************************************/ 12 | 13 | #ifndef __NIHSDIOOBSOLETE_HEADER 14 | #define __NIHSDIOOBSOLETE_HEADER 15 | 16 | #include 17 | 18 | /* Compatibility with older versions ------*/ 19 | 20 | /*- Deprecated Attributes --------*/ 21 | #define NIHSDIO_ATTR_DEVICE_SERIAL_NUMBER (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 84L) /* ViInt32 */ 22 | #define NIHSDIO_ATTR_START_TRIGGER_IMPEDANCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 1L) /* ViReal64 */ 23 | #define NIHSDIO_ATTR_REF_TRIGGER_IMPEDANCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 4L) /* ViReal64 */ 24 | #define NIHSDIO_ATTR_SCRIPT_TRIGGER_IMPEDANCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 5L) /* ViReal64 */ 25 | #define NIHSDIO_ATTR_PAUSE_TRIGGER_IMPEDANCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 15L) /* ViReal64 */ 26 | #define NIHSDIO_ATTR_ADVANCE_TRIGGER_IMPEDANCE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 95L) /* ViReal64 */ 27 | #define NIHSDIO_ATTR_START_TRIGGER_POSITION (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 75L) /* ViInt32 */ 28 | #define NIHSDIO_ATTR_REF_TRIGGER_POSITION (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 77L) /* ViInt32 */ 29 | #define NIHSDIO_ATTR_PAUSE_TRIGGER_POSITION (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 87L) /* ViInt32 */ 30 | #define NIHSDIO_ATTR_ADVANCE_TRIGGER_POSITION (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 93L) /* ViInt32 */ 31 | #define NIHSDIO_ATTR_HWC_HARDWARE_COMPARE_MODE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 130L) /* ViInt32 */ 32 | #define NIHSDIO_ATTR_DAQMX_TASK (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 69L) /* ViInt32 */ 33 | 34 | /*- Deprecated Values --------*/ 35 | #define NIHSDIO_VAL_PXI_CLK10_STR "PXI_CLK10" 36 | #define NIHSDIO_VAL_PXI_CLK100_STR "PXI_CLK100" 37 | 38 | /* Hardware Compare Mode Values - Use Supported Data States instead */ 39 | #define NIHSDIO_VAL_HWC_DISABLED 77 40 | #define NIHSDIO_VAL_HWC_STIMULUS_AND_EXPECTED_RESPONSE 78 41 | #define NIHSDIO_VAL_HWC_EXPECTED_RESPONSE_ONLY 79 42 | 43 | #endif /* __NIHSDIOOBSOLETE_HEADER */ -------------------------------------------------------------------------------- /Ni/include/niModInst.h: -------------------------------------------------------------------------------- 1 | // **************************************************************************** 2 | // NI-ModInst 3 | // 4 | // National Instruments utility library for Modular Instruments Drivers 5 | // 6 | // Copyright (c) National Instruments 2004-. All Rights Reserved. 7 | // **************************************************************************** 8 | 9 | #ifndef ___niModInst_h___ 10 | #define ___niModInst_h___ 11 | 12 | 13 | #if defined(__cplusplus) || defined(__cplusplus__) 14 | extern "C" { 15 | #endif 16 | 17 | #include "visatype.h" 18 | 19 | #ifndef DllExport 20 | #define DllExport __declspec( dllexport ) 21 | #endif 22 | 23 | 24 | // **************************************************************************** 25 | // --------------------------- Attribute Definitions -------------------------- 26 | // **************************************************************************** 27 | 28 | // ViString Attributes 29 | #define NIMODINST_ATTR_DEVICE_NAME 0 30 | #define NIMODINST_ATTR_DEVICE_MODEL 1 31 | #define NIMODINST_ATTR_SERIAL_NUMBER 2 32 | 33 | // ViInt32 Attributes 34 | #define NIMODINST_ATTR_SLOT_NUMBER 10 35 | #define NIMODINST_ATTR_CHASSIS_NUMBER 11 36 | #define NIMODINST_ATTR_BUS_NUMBER 12 37 | #define NIMODINST_ATTR_SOCKET_NUMBER 13 38 | // 14-16 Reserved 39 | #define NIMODINST_ATTR_PCIEXPRESS_LINK_WIDTH 17 40 | #define NIMODINST_ATTR_MAX_PCIEXPRESS_LINK_WIDTH 18 41 | 42 | // **************************************************************************** 43 | // ------------------------- Library Function Declarations -------------------- 44 | // **************************************************************************** 45 | 46 | // --- Session Based Functions 47 | 48 | ViStatus DllExport _VI_FUNC 49 | niModInst_OpenInstalledDevicesSession ( 50 | ViConstString driver, 51 | ViSession* handle, 52 | ViInt32* deviceCount); 53 | 54 | ViStatus DllExport _VI_FUNC 55 | niModInst_GetInstalledDeviceAttributeViString ( 56 | ViSession handle, 57 | ViInt32 index, 58 | ViInt32 attributeID, 59 | ViInt32 attributeValueBufferSize, 60 | ViChar attributeValue[]); 61 | 62 | ViStatus DllExport _VI_FUNC 63 | niModInst_GetInstalledDeviceAttributeViInt32 ( 64 | ViSession handle, 65 | ViInt32 index, 66 | ViInt32 attributeID, 67 | ViInt32* attributeValue); 68 | 69 | ViStatus DllExport _VI_FUNC 70 | niModInst_CloseInstalledDevicesSession ( 71 | ViSession handle); 72 | 73 | 74 | // --- Utility Functions 75 | 76 | ViStatus DllExport _VI_FUNC niModInst_GetExtendedErrorInfo ( 77 | ViInt32 errorInfoBufferSize, 78 | ViChar errorInfo[]); 79 | 80 | 81 | // **************************************************************************** 82 | // ----------------------- Error And Completion Codes ------------------------- 83 | // **************************************************************************** 84 | 85 | #define NIMODINST_SUCCESS 0 86 | 87 | #define NIMODINST_ERROR_INVALID_SESSION_HANDLE -250200 88 | #define NIMODINST_ERROR_NULL_SESSION_HANDLE -250201 89 | #define NIMODINST_ERROR_INVALID_DEVICE_INDEX -250202 90 | #define NIMODINST_ERROR_INVALID_ATTRIBUTE_ID -250203 91 | #define NIMODINST_ERROR_ATTRIBUTE_NOT_SUPPORTED_BY_DEVICE -250204 92 | #define NIMODINST_ERROR_NULL_OUTPUT_PARAMETER -250205 93 | #define NIMODINST_ERROR_NULL_DRIVER -250206 94 | 95 | 96 | #if defined(__cplusplus) || defined(__cplusplus__) 97 | } 98 | #endif 99 | 100 | #endif /* ___niModInst_h___ */ 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Ni/include/niRFSAErrors.h: -------------------------------------------------------------------------------- 1 | #ifndef ___niRFSA_niRFSAErrors_h___ 2 | #define ___niRFSA_niRFSAErrors_h___ 3 | 4 | /*******************************/ 5 | /*********** Errors ************/ 6 | /*******************************/ 7 | 8 | /* hex:0xBFFA4130 */ 9 | /* Relay count operations are not supported on this device */ 10 | #define NIRFSA_ERROR_RELAY_COUNT_NOT_SUPPORTED -1074118352 11 | 12 | /* hex:0xBFFA412F */ 13 | /* Calibration Tone Frequency was found to exceed maximum deviation. Make sure the PXI chassis backplane clock and the LO Reference Clock are both locked to the same source. */ 14 | #define NIRFSA_ERROR_CAL_TONE_FREQUENCY_MAX_DEVIATION_EXCEEDED -1074118353 15 | 16 | /* hex:0xBFFA412E */ 17 | /* The specified calibration gain adjustment is invalid, verify calibration setup is correct. Contact National Instruments support for further information */ 18 | #define NIRFSA_ERROR_EXTCAL_INVALID_GAIN_ADJUSTED -1074118354 19 | 20 | /* hex:0xBFFA412D */ 21 | /* Adjacent Channel Power Ratio (ACPR) measurements are not supported in the current IF Filter path. Choose a narrower IF Filter by decreasing Span or Device Instantaneous Bandwidth. */ 22 | #define NIRFSA_ERROR_ACPR_NOT_SUPPORTED_IN_FILTER_PATH -1074118355 23 | 24 | /* hex:0xBFFA412C */ 25 | /* Adjacent Channel Power Ratio (ACPR) measurement calibration is not supported with the selected IF filter path, Choose a different table type or a narrower filter. */ 26 | #define NIRFSA_ERROR_ACPR_CALIBRATION_NOT_SUPPORTED_IN_FILTER_PATH -1074118356 27 | 28 | /* hex:0xBFFA412B */ 29 | /* NI-RFSA cannot achieve the specified calibration tone frequency. To solve this issue, try changing the requested resolution. */ 30 | #define NIRFSA_ERROR_CALIBRATION_TONE_INVALID -1074118357 31 | 32 | /* hex:0xBFFA412A */ 33 | /* The number of frequencies and LO attenuation settings being passed to the function are not the same. Ensure the arrays you pass to the function have the same number of elements. */ 34 | #define NIRFSA_ERROR_NUMBER_OF_FREQUENCIES_LO_ATTENUATION_MISMATCH -1074118358 35 | 36 | /* hex:0xBFFA4129 */ 37 | /* NI-RFSA cannot initialize a calibration session because another calibration session for the specified device is already open. Close the open session by calling niRFSA Close Ext Cal or by exiting the application with the open session. */ 38 | #define NIRFSA_ERROR_CAL_SESSION_ALREADY_EXISTS -1074118359 39 | 40 | /* hex:0xBFFA4128 */ 41 | /* Calibration is not supported on simulated devices. */ 42 | #define NIRFSA_ERROR_CALIBRATION_SESSION_NOT_SUPPORTED_IN_SIMULATION -1074118360 43 | 44 | /* hex:0xBFFA4127 */ 45 | /* You have exceeded the EEPROM memory space allocated for Self Cal. Run Self Cal again for all invalid steps, or contatct National Instruments technical support. */ 46 | #define NIRFSA_ERROR_EEPROM_SPACE_EXCEEDED_FOR_SELF_CAL -1074118361 47 | 48 | /* hex:0xBFFA4126 */ 49 | /* The gain associated with the specified index is not valid for the specified frequency. */ 50 | #define NIRFSA_ERROR_INVALID_IF_GAIN_FOR_FREQUENCY -1074118362 51 | 52 | /* hex:0xBFFA4125 */ 53 | /* The parameter value specified is not supported when using an external digitizer. */ 54 | #define NIRFSA_ERROR_INVALID_PARAMETER_VALUE_FOR_EXTERNAL_DIGITIZER -1074118363 55 | 56 | /* hex:0xBFFA4124 */ 57 | /* This property or attribute is supported only during a calibration session. */ 58 | #define NIRFSA_ERROR_ATTR_NOT_SUPPORTED_IN_NON_CALIBRATION_SESSION -1074118364 59 | 60 | /* hex:0xBFFA4123 */ 61 | /* LO2 and LO3 calibration adjustment supports adjusting only a single LO frequency (4 GHz and 800 MHz, respectively). */ 62 | #define NIRFSA_ERROR_INVALID_LO_EXPORT_CALIBRATION_NUMBER_OF_FREQUENCIES -1074118365 63 | 64 | /* hex:0xBFFA4122 */ 65 | /* The device temperature deviation during calibration exceeded the maximum allowed amount. To correct the issue, ensure good ventilation and a stable room temperature, and set the fan speed to its maximum. */ 66 | #define NIRFSA_ERROR_CALIBRATION_TEMPERATURE_DEVIATION_EXCEEDED -1074118366 67 | 68 | /* hex:0xBFFA4121 */ 69 | /* A configuration property or attribute that is required for calibration is missing. Commit these properties and attributes prior to calling calibration adjustment VIs and functions. */ 70 | #define NIRFSA_ERROR_REQUIRED_CALIBRATION_PARAMETER_MISSING -1074118367 71 | 72 | /* hex:0xBFFA4120 */ 73 | /* An invalid LO export number was provided to the niRFSA Cal Adjust LO Export Calibration function. */ 74 | #define NIRFSA_ERROR_INVALID_LO_EXPORT_NUMBER -1074118368 75 | 76 | /* hex:0xBFFA411F */ 77 | /* The LO Export attenuation was adjusted to a value outside the supported range. */ 78 | #define NIRFSA_ERROR_LO_EXPORT_ATTENUATION_OUT_OF_RANGE -1074118369 79 | 80 | /* hex:0xBFFA411E */ 81 | /* The maximum supported mixer level was exceeded. This problem is usually caused by forcing low RF attenuation. To correct the issue, increase the RF attenuation so that the mixer level is equal to the reference level minus the RF attenuation plus RF gain. */ 82 | #define NIRFSA_ERROR_MAXIMUM_MIXER_LEVEL_EXCEEDED -1074118370 83 | 84 | /* hex:0xBFFA411D */ 85 | /* NI-RFSA failed to align the YIG tunable filter (YTF). */ 86 | #define NIRFSA_ERROR_YTF_ALIGNMENT_DOES_NOT_COVER_RANGE -1074118371 87 | 88 | /* hex:0xBFFA411C */ 89 | /* NI-RFSA failed to detect a signal while calibrating the YTF module. Ensure that your LO and digitizer are properly connected by running the test panel in MAX. */ 90 | #define NIRFSA_ERROR_YTF_ALIGNMENT_SIGNAL_DETECTION_FAILED -1074118372 91 | 92 | /* hex:0xBFFA411B */ 93 | /* Creation of the simulated device failed. Connection to the MXS database is taking too long. Restart your system, and if this process does not solve the problem, contact National Instruments technical support. */ 94 | #define NIRFSA_ERROR_SIMULATED_DEVICE_CREATION_FAILED -1074118373 95 | 96 | /* hex:0xBFFA411A */ 97 | /* NI-RFSA does not support the specified LO. */ 98 | #define NIRFSA_ERROR_LO_NOT_SUPPORTED -1074118374 99 | 100 | /* hex:0xBFFA4119 */ 101 | /* The specified keyword is not supported in this session. Real sessions support Digitizer and LO Driver Setup keywords, while simulated sessions support DigitizerModel and LOModel Driver Setup keywords. Refer to the documentation for more information about Driver Setup keywords. */ 102 | #define NIRFSA_ERROR_KEYWORD_NOT_SUPPORTED_IN_SESSION -1074118375 103 | 104 | /* hex:0xBFFA4116 */ 105 | /* The Reference clock is not a valid value for this operation. */ 106 | #define NIRFSA_ERROR_REF_CLOCK_INVALID_SIGNAL_TYPE -1074118378 107 | 108 | /* hex:0xBFFA4111 */ 109 | /* You have exceeded the maximum number of configuration list steps supported for your device. */ 110 | #define NIRFSA_ERROR_MAX_STEP_COUNT_EXCEEDED -1074118383 111 | 112 | /* hex:0xBFFA4110 */ 113 | /* NI-RFSA cannot get the frequency response. Calibration data is not available for this device configuration. */ 114 | #define NIRFA_ERROR_CANNOT_GET_FREQUENCY_RESPONSE -1074118384 115 | 116 | /* hex:0xBFFA410F */ 117 | /* The currently installed version of NI-RFSA is not compatible with the currently installed version of NI-RFSG. Downgrade your NI-RFSA installation, or upgrade your NI-RFSG installation. */ 118 | #define NIRFSA_ERROR_NIRFSG_DRIVER_VERSION_TOO_OLD -1074118385 119 | 120 | /* hex:0xBFFA410E */ 121 | /* The currently installed version of NI-RFSA is not compatible with the currently installed version of NI-RFSG. Upgrade your NI-RFSA installation, or downgrade your NI-RFSG installation. */ 122 | #define NIRFSA_ERROR_NIRFSG_DRIVER_VERSION_TOO_NEW -1074118386 123 | 124 | /* hex:0xBFFA40EC */ 125 | /* This function is only supported when using NI-RFSA in external digitizer mode. Specify the digitizer resource name as in Measurement & Automation Explorer or in the Option String. */ 126 | #define NIRFSA_ERROR_FUNCTION_NOT_SUPPORTED_IN_DOWNCONVERTER_DIGITIZER_MODE -1074118420 127 | 128 | /* hex:0xBFFA40EB */ 129 | /* This attribute is only supported when using NI-RFSA in external digitizer mode. Specify the digitizer resource name as in Measurement & Automation Explorer or in the Option String. */ 130 | #define NIRFSA_ERROR_ATTR_NOT_SUPPORTED_IN_DOWNCONVERTER_DIGITIZER_MODE -1074118421 131 | 132 | /* hex:0xBFFA40DA */ 133 | /* The temperature sensor on the device returned a bad reading. The sensor may be failing and need replacement. Contact National Instruments Technical Support if you need additional information or the problem persists. */ 134 | #define NIRFSA_ERROR_BAD_TEMPERATURE_READING -1074118438 135 | 136 | /* hex:0xBFFA40CA */ 137 | /* You must specify the reference level, attenuation, and mixer level attributes such that attenuation = reference level - mixer level. If you do not set either mixer level or attenuation, the driver selects the appropriate value for the attribute. */ 138 | #define NIRFSA_ERROR_ATTENUATION_RELATIONSHIP_INVALID -1074118454 139 | 140 | /* hex:0xBFFA401E */ 141 | /* The configured trigger level value is too high. The maximum value for the trigger level is determined by the configured reference level. */ 142 | #define NIRFSA_ERROR_TRIGGER_LEVEL_HIGHER_THAN_REF_LEVEL -1074118626 143 | 144 | /* hex:0xBFFA401D */ 145 | /* Additional calibration information is necessary to enable this feature. */ 146 | #define NIRFSA_ERROR_ADDITIONAL_CALIBRATION_NEEDED_FOR_THIS_FEATURE -1074118627 147 | 148 | /* hex:0xBFFA401C */ 149 | /* This function is not supported when using NI-RFSA with an external LO module. */ 150 | #define NIRFSA_ERROR_FUNCTION_NOT_SUPPORTED_IN_EXTERNAL_LO_MODE -1074118628 151 | 152 | /* hex:0xBFFA401B */ 153 | /* This attribute is not supported when using NI-RFSA with the external LO module. */ 154 | #define NIRFSA_ERROR_ATTR_NOT_SUPPORTED_IN_EXTERNAL_LO_MODE -1074118629 155 | 156 | /* hex:0xBFFA401A */ 157 | /* The LO returned the following error: */ 158 | #define NIRFSA_ERROR_NIRFSG_ERROR -1074118630 159 | 160 | /* hex:0xBFFA4019 */ 161 | /* LO resource name is invalid. The resource name can be invalid because you either associated an invalid LO resource name in MAX with the downconverter or because you tried to use niRFSA Init With Options with a DriverSetup string that included an invalid LO resource name. */ 162 | #define NIRFSA_ERROR_INVALID_LO_RESOURCE_NAME -1074118631 163 | 164 | /* hex:0xBFFA4018 */ 165 | /* Session could not be opened because the LO resource name was not specified. Specify the LO resource name in Measurement & Automation Explorer or in the Option String. */ 166 | #define NIRFSA_ERROR_LO_RESOURCE_NAME_NOT_FOUND -1074118632 167 | 168 | /* hex:0xBFFA4017 */ 169 | /* The currently installed version of NI-RFSA is not compatible with the currently installed version of NI-SCOPE. Upgrade your NI-RFSA installation, or downgrade your NI-SCOPE installation. */ 170 | #define NIRFSA_ERROR_INCOMPATIBLE_NISCOPE_DRIVER_VERSION -1074118633 171 | 172 | /* hex:0xBFFA4016 */ 173 | /* The attenuator relays are not settled. Repair or reinstall the NI-RFSA instrument driver. Contact National Instruments Technical Support if you need additional information or the problem persists. */ 174 | #define NIRFSA_ERROR_ATTENUATORS_NOT_SETTLED -1074118634 175 | 176 | /* hex:0xBFFA4015 */ 177 | /* The frequency tuning PLL is not locked. */ 178 | #define NIRFSA_ERROR_FREQUENCY_TUNING_PLL_NOT_LOCKED -1074118635 179 | 180 | /* hex:0xBFFA4014 */ 181 | /* The Reference clock PLL is not locked. */ 182 | #define NIRFSA_ERROR_REF_CLK_PLL_NOT_LOCKED -1074118636 183 | 184 | /* hex:0xBFFA4013 */ 185 | /* This attribute is not supported when using NI-RFSA with an external digitizer module. */ 186 | #define NIRFSA_ERROR_ATTR_NOT_SUPPORTED_IN_DOWNCONVERTER_ONLY_MODE -1074118637 187 | 188 | /* hex:0xBFFA4012 */ 189 | /* This function is not supported when using NI-RFSA with an external digitizer module. */ 190 | #define NIRFSA_ERROR_FUNCTION_NOT_SUPPORTED_IN_DOWNCONVERTER_ONLY_MODE -1074118638 191 | 192 | /* hex:0xBFFA4011 */ 193 | /* This function is not supported when the acquistion type is set to IQ. */ 194 | #define NIRFSA_ERROR_FUNCTION_NOT_SUPPORTED_IN_IQ_ACQUISITION -1074118639 195 | 196 | /* hex:0xBFFA4010 */ 197 | /* This function is not supported when the acquistion type is set to Spectrum. */ 198 | #define NIRFSA_ERROR_FUNCTION_NOT_SUPPORTED_IN_SPECTRUM_ACQUISITION -1074118640 199 | 200 | /* hex:0xBFFA400F */ 201 | /* You can only get the specified property while the session is committed or while the session is running.Commit or initiate the session prior to getting the property. */ 202 | #define NIRFSA_ERROR_GET_WHEN_SESSION_NOT_RUNNING -1074118641 203 | 204 | /* hex:0xBFFA400E */ 205 | /* Unable to initialize because a session for the specified device is already open from another process. Close the open session by calling niRFSA Close or by exiting the application with the open session. */ 206 | #define NIRFSA_ERROR_INSTRUMENT_ALREADY_IN_USE -1074118642 207 | 208 | /* hex:0xBFFA400D */ 209 | /* Device not available in NI-RFSA. The device may be being used by NI-Tuner or NI-5660, or the device is being reset. After using a device in NI-Tuner, you must reset the device using the Traditional DAQ Device Reset before using it in NI-RFSA. */ 210 | #define NIRFSA_ERROR_DEVICE_ABSENT_OR_UNAVAILABLE -1074118643 211 | 212 | /* hex:0xBFFA400C */ 213 | /* The device's calibration revision is unsupported by this version of the driver. Upgrade the driver. Contact National Instruments Technical Support if you need additional information or the problem persists. */ 214 | #define NIRFSA_ERROR_UNSUPPORTED_CALIBRATION_REVISION -1074118644 215 | 216 | /* hex:0xBFFA400B */ 217 | /* The specified operation cannot be performed because a session has been aborted or a device has been removed from the system. */ 218 | #define NIRFSA_ERROR_RUNTIME_ABORTED -1074118645 219 | 220 | /* hex:0xBFFA400A */ 221 | /* Specified property cannot be set while the session is running.Set the property prior to initiating the session, or abort the session prior to setting the property. */ 222 | #define NIRFSA_ERROR_SET_WHEN_SESSION_RUNNING -1074118646 223 | 224 | /* hex:0xBFFA4009 */ 225 | /* Specified operation is only supported while the session is running.Initiate the session before requesting the operation and ensure that the session has not been aborted. */ 226 | #define NIRFSA_ERROR_SESSION_NOT_IN_RUNNING_STATE -1074118647 227 | 228 | /* hex:0xBFFA4008 */ 229 | /* You cannot perform this action while the session is running. */ 230 | #define NIRFSA_ERROR_SESSION_IN_RUNNING_STATE -1074118648 231 | 232 | /* hex:0xBFFA4007 */ 233 | /* Session could not be opened because the digitizer resource name was not specified. Specify the digitizer resource name in Measurement & Automation Explorer by right-clicking on the downconverter and selecting Properties. */ 234 | #define NIRFSA_ERROR_DIGITIZER_RESOURCE_NAME_NOT_FOUND_IN_INIT -1074118649 235 | 236 | /* hex:0xBFFA4006 */ 237 | /* Session could not be opened because the digitizer resource name was not specified. Specify the digitizer resource name in Measurement & Automation Explorer by right-clicking on the downconverter and selecting Properties. If you are specifying the digitizer via the Option String, ensure the digitizer Resource Name is valid. */ 238 | #define NIRFSA_ERROR_DIGITIZER_RESOURCE_NAME_NOT_FOUND -1074118650 239 | 240 | /* hex:0xBFFA4005 */ 241 | /* Digitizer resource name is invalid. The resource name can be invalid because you either associated an invalid digitizer resource name in MAX with the downconverter or because you tried to use niRFSA Init With Options with a DriverSetup string that included an invalid digitizer resource name. */ 242 | #define NIRFSA_ERROR_INVALID_DIGITIZER_RESOURCE_NAME -1074118651 243 | 244 | /* hex:0xBFFA4004 */ 245 | /* The specified digitizer is not supported by NI-RFSA. */ 246 | #define NIRFSA_ERROR_DIGITIZER_NOT_SUPPORTED -1074118652 247 | 248 | /* hex:0xBFFA4003 */ 249 | /* The device specified is not supported by this driver. */ 250 | #define NIRFSA_ERROR_DEVICE_NOT_SUPPORTED -1074118653 251 | 252 | /* hex:0xBFFA4002 */ 253 | /* Maximum time exceeded before the operation completed. */ 254 | #define NIRFSA_ERROR_MAX_TIME_EXCEEDED -1074118654 255 | 256 | /* hex:0xBFFA4001 */ 257 | /* The digitizer returned the following error: */ 258 | #define NIRFSA_ERROR_NISCOPE_ERROR -1074118655 259 | 260 | /*********************************/ 261 | /*********** Warnings ************/ 262 | /*********************************/ 263 | 264 | /* hex:0x3FFA4001 */ 265 | /* The digitizer returned the following warning: */ 266 | #define NIRFSA_WARN_NISCOPE_WARN 1073364993 267 | 268 | /* hex:0x3FFA4002 */ 269 | /* The reference clock PLL is not locked. */ 270 | #define NIRFSA_WARN_REF_CLK_PLL_NOT_LOCKED 1073364994 271 | 272 | /* hex:0x3FFA4003 */ 273 | /* The LO returned the following warning: */ 274 | #define NIRFSA_WARN_NIRFSG_WARN 1073364995 275 | 276 | /* hex:0x3FFA4004 */ 277 | /* The digitizer returned the following PLL warning: */ 278 | #define NIRFSA_WARN_NISCOPE_PLL_WARN 1073364996 279 | 280 | /* hex:0x3FFA4005 */ 281 | /* The current channel coupling configuration is not calibrated, accuracy levels are not guaranteed */ 282 | #define NIRFSA_WARN_DCBLOCK_NOT_CALIBRATED 1073364997 283 | 284 | /* hex:0x3FFA4006 */ 285 | /* The Speficied IF state is not present in the calibration data, try a different IF filter path, IF Attenuation table type, or IF Index. */ 286 | #define NIRFSA_WARN_IF_INDEX_NOT_CALIBRATED 1073364998 287 | 288 | /* hex:0x3FFA4007 */ 289 | /* The specified Attenuation constraints are not calibrated, Reference level accuracy not guaranteed. */ 290 | #define NIRFSA_WARN_ATTENUATION_CONSTRAINT_NOT_CALIBRATED 1073364999 291 | 292 | /* hex:0x3FFA4008 */ 293 | /* Calibration data not present or invalid, Reference level accuracy not guaranteed */ 294 | #define NIRFSA_WARN_CALIBRATION_DATA_NOT_PRESENT 1073365000 295 | 296 | /* hex:0x3FFA4009 */ 297 | /* The current RF configuration is not calibrated. Try changing the Channel Coupling attribute, Preamp Enabled attribute, or RF attenuation configuration with either Mixer Level or RF Attenuation Attributes */ 298 | #define NIRFSA_WARN_RF_CONFIGURATION_NOT_CALIBRATED 1073365001 299 | 300 | #endif /* ___niRFSA_niRFSAErrors_h___ */ 301 | -------------------------------------------------------------------------------- /Ni/include/niScopeCal.h: -------------------------------------------------------------------------------- 1 | #ifndef ___niScopeCal_h___ 2 | #define ___niScopeCal_h___ 3 | 4 | #ifndef ___niScope_h___ 5 | #include "niScope.h" 6 | #endif 7 | 8 | /* Pragma used in CVI to indicate that functions in this file have 9 | * user protection associated with them */ 10 | #ifdef _CVI_ 11 | #pragma EnableLibraryRuntimeChecking 12 | #endif 13 | 14 | #define NISCOPE_VAL_CAL_ACTION_STORE 0 // Possible Action for CloseSession 15 | #define NISCOPE_VAL_CAL_ACTION_ABORT 1 // Possible Action for CloseSession 16 | #define NISCOPE_VAL_CAL_ACTION_RESET 101 // Possible Action for CloseSession (internal use only) 17 | 18 | #define NISCOPE_VAL_CAL_ABORT_ON_ERR 0 // option for error handling 19 | #define NISCOPE_VAL_CAL_ABORT_ON_MAJOR_ERR 1 // option for error handling 20 | #define NISCOPE_VAL_CAL_SKIP_BAD_SECTIONS 2 // option for error handling 21 | #define NISCOPE_VAL_CAL_RESET_BAD_SECTIONS 3 // option for error handling 22 | 23 | #define NISCOPE_VAL_CAL_SELF 1 // option for fetch date, count, temp 24 | #define NISCOPE_VAL_CAL_EXTERNAL 0 // option for fetch date, count, temp 25 | #define NISCOPE_VAL_CAL_MANUFACTURE 2 // option for fetch date 26 | 27 | // Route internal reference options 28 | #define NISCOPE_VAL_CAL_UNROUTE_SIGNAL (ViUInt32)0xfffffff 29 | #define NISCOPE_VAL_CAL_POSITIVE (ViUInt32)0xffff 30 | #define NISCOPE_VAL_CAL_NEGATIVE 0 31 | 32 | // Calibration source for niScope_CalSetAccessorySource 33 | #define NISCOPE_VAL_CAL_SOURCE_GROUND 0 34 | #define NISCOPE_VAL_CAL_SOURCE_POSITIVEFS 1 35 | #define NISCOPE_VAL_CAL_SOURCE_NEGATIVEFS 2 36 | 37 | // Which reference parameter for routing, storing and fetching int. ref. 38 | #define NISCOPE_VAL_CAL_10V_CH0 0 39 | 40 | #if defined(__cplusplus) || defined(__cplusplus__) 41 | extern "C" { 42 | #endif 43 | 44 | /////////////////////////////////////////////////////// 45 | // 46 | // OPEN / CLOSE / Change Password 47 | // 48 | /////////////////////////////////////////////////////// 49 | 50 | // Gives calibration session handle 51 | ViStatus _VI_FUNC niScope_CalStart 52 | ( 53 | ViRsrc resourceName, // e.g. "DAQ:1" 54 | ViConstString password, // pointer to 4 bytes for password, 0 or "" by default 55 | ViSession *newSessionHandle // returns this session handle 56 | ); 57 | 58 | // Either store constants in eeprom or abort. 59 | ViStatus _VI_FUNC niScope_CalEnd 60 | ( 61 | ViSession sessionHandle, // session handle from CalStart 62 | ViInt32 action // see defined "action" constants above 63 | ); 64 | 65 | // If the old password is correct, the new password is stored in eeprom 66 | ViStatus _VI_FUNC niScope_CalChangePassword 67 | ( 68 | ViSession sessionHandle, // session handle from CalStart or niScope_init 69 | ViConstString oldPassword, // previous password is verfied (pointer to 4 bytes) 70 | ViConstString newPassword // new password is written to eeprom (pointer to 4 bytes) 71 | ); 72 | 73 | /////////////////////////////////////////////////////// 74 | // 75 | // FETCH 76 | // 77 | /////////////////////////////////////////////////////// 78 | 79 | ViStatus _VI_FUNC niScope_CalFetchCount 80 | ( 81 | ViSession sessionHandle, // session handle from CalStart or niScope_init 82 | ViInt32 whichOne, // internal or external count: see defines 83 | ViInt32* calibrationCount // number of calibrations peformed 84 | ); 85 | 86 | ViStatus _VI_FUNC niScope_CalFetchDate 87 | ( 88 | ViSession sessionHandle, // session handle from CalStart or niScope_init 89 | ViInt32 whichOne, // internal or external cal date, or manufacture date 90 | ViInt32* year, // year of last calibration from eeprom 91 | ViInt32* month, // month of last calibration from eeprom 92 | ViInt32* day // day of last calibration from eeprom 93 | ); 94 | 95 | 96 | // Not supported yet, but will be for temperature sensing devices 97 | ViStatus _VI_FUNC niScope_CalFetchTemperature 98 | ( 99 | ViSession sessionHandle, // session handle from CalStart or niScope_init 100 | ViInt32 whichOne, // internal or external cal temperature 101 | ViReal64* temperature // temperature in degrees C 102 | ); 103 | 104 | ViStatus _VI_FUNC niScope_CalFetchMiscInfo 105 | ( 106 | ViSession sessionHandle, // session handle from CalStart or niScope_init 107 | ViChar* miscInfo // pointer to 5 bytes; returned from eeprom 108 | ); 109 | 110 | // Return the last stored internal reference value. 111 | // This value is not used during device operation. 112 | ViStatus _VI_FUNC niScope_CalFetchInternalReference 113 | ( 114 | ViSession sessionHandle, // session handle from CalStart or niScope_init 115 | ViInt32 whichReference, // see defines 116 | ViReal64* internalRefValue // last stored internal reference measurement 117 | ); 118 | 119 | /////////////////////////////////////////////////////// 120 | // 121 | // Store 122 | // 123 | /////////////////////////////////////////////////////// 124 | ViStatus _VI_FUNC niScope_CalStoreMiscInfo 125 | ( 126 | ViSession sessionHandle, // session handle from CalStart 127 | ViConstString miscInfo // pointer to 4 characters to store in eeprom (operator id?) 128 | ); 129 | 130 | // For verification, store the internal reference. This value is not 131 | // used during device operation. 132 | ViStatus _VI_FUNC niScope_CalStoreInternalReference 133 | ( 134 | ViSession sessionHandle, // session handle from CalStart 135 | ViInt32 whichReference, // see defines 136 | ViReal64 internalRefValue // last stored internal reference measurement 137 | ); 138 | 139 | 140 | /////////////////////////////////////////////////////// 141 | // 142 | // Adjustment 143 | // 144 | /////////////////////////////////////////////////////// 145 | 146 | ViStatus _VI_FUNC niScope_CalAdjustRange 147 | ( 148 | ViSession sessionHandle, // session handle from CalStart 149 | ViConstString channelName, // e.g. "0" or "1" 150 | ViReal64 range, // see niscope calibration document 151 | ViReal64 stimulus // peak voltage of applied signal 152 | ); 153 | 154 | ViStatus _VI_FUNC niScope_CalAdjustVCXO 155 | ( 156 | ViSession sessionHandle, // session handle from CalStart 157 | ViReal64 stimulusFreq // frequency of applied signal 158 | ); 159 | 160 | ViStatus _VI_FUNC niScope_CalAdjustDCM 161 | ( 162 | ViSession sessionHandle, // session handle from CalStart 163 | ViConstString channelName, // e.g. "0" or "1" 164 | ViReal64 stimulusFreq // frequency of applied signal 165 | ); 166 | 167 | ViStatus _VI_FUNC niScope_CalAdjustOffset 168 | ( 169 | ViSession sessionHandle, // session handle from CalStart 170 | ViConstString channelName, // e.g. "0" or "1" 171 | ViReal64 range // see niscope calibration document 172 | ); 173 | 174 | ViStatus _VI_FUNC niScope_CalAdjustOffsetRange 175 | ( 176 | ViSession sessionHandle, // session handle from CalStart 177 | ViConstString channelName, // e.g. "0" or "1" 178 | ViReal64 range, // see niscope calibration document 179 | ViReal64 stimulus // peak voltage of applied signal 180 | ); 181 | 182 | ViStatus _VI_FUNC niScope_CalAdjustCompensationAttenuator 183 | ( 184 | ViSession sessionHandle, // session handle from CalStart 185 | ViConstString channelName, // e.g. "0" or "1" 186 | ViReal64 range // see niscope calibration document 187 | ); 188 | 189 | ViStatus _VI_FUNC niScope_CalAdjustFrequencyResponse 190 | ( 191 | ViSession sessionHandle, // session handle from CalStart 192 | ViConstString channelName, // e.g. "0" or "1" 193 | ViReal64 range, // see niscope calibration document 194 | ViReal64 stimulusFreq, // frequency of applied signal 195 | ViReal64 stimulusAmp // peak voltage of applied signal 196 | ); 197 | 198 | // For the 5911 external calibration with a single DC external voltage source 199 | ViStatus _VI_FUNC niScope_CalAdjustInternalReference 200 | ( 201 | ViSession sessionHandle, // session handle from CalStart 202 | ViInt32 option, // use VI_NULL 203 | ViReal64 stimulus // voltage of applied signal 204 | ); 205 | 206 | 207 | // For 5112 verification, this routes the internal reference out the 208 | // front BNC connector for measurement. 209 | ViStatus _VI_FUNC niScope_CalRouteInternalReference 210 | ( 211 | ViSession sessionHandle, // session handle from CalStart 212 | ViInt32 option , // see defines 213 | ViInt32 whichReference // see constants 214 | ); 215 | 216 | // For the 5900 external calibration 217 | ViStatus _VI_FUNC niScope_CalAdjustAccessoryGainAndOffset 218 | ( 219 | ViSession sessionHandle, // session handle from CalStart 220 | ViConstString channelName, // e.g. "0" or "1" 221 | ViReal64 posFS, 222 | ViReal64 gnd, 223 | ViReal64 negFS 224 | ); 225 | 226 | ViStatus _VI_FUNC niScope_CalSetAccessorySource 227 | ( 228 | ViSession sessionHandle, 229 | ViConstString channelName, 230 | ViInt32 calSource 231 | ); 232 | 233 | /////////////////////////////////////////////////////// 234 | // 235 | // Verification 236 | // 237 | /////////////////////////////////////////////////////// 238 | ViStatus _VI_FUNC niScope_CalMeasureRISDistribution 239 | ( 240 | ViSession sessionHandle, // session handle from CalStart or niScope_init 241 | ViConstString channelName, // e.g. "0" or "1" 242 | ViInt32 maxTime, // max time in ms for each acquisition 243 | ViReal64* minBinPercent, // percent (0-1) of trigers in the least full bin 244 | ViInt32 distributionSize, // number of bins for distribution 245 | ViInt32* distribution // array for distribution, NULL for "don't return it" 246 | ); 247 | 248 | #if defined(__cplusplus) || defined(__cplusplus__) 249 | } 250 | #endif 251 | 252 | #endif 253 | -------------------------------------------------------------------------------- /Ni/include/niTClk.h: -------------------------------------------------------------------------------- 1 | // *************************************************************************************** 2 | // NI-TClk 3 | // 4 | // National Instruments library for TClk synchronization 5 | // 6 | // Copyright (c) National Instruments 2003. All Rights Reserved. 7 | // **************************************************************************************** 8 | 9 | #ifndef ___niTClk_h___ 10 | #define ___niTClk_h___ 11 | 12 | 13 | #if defined(__cplusplus) || defined(__cplusplus__) 14 | extern "C" { 15 | #endif 16 | 17 | #include "visatype.h" 18 | 19 | // **************************************************************************************** 20 | // ---------------------------- Attribute Definitions ------------------------------------- 21 | // **************************************************************************************** 22 | 23 | #define NITCLK_ATTR_SYNC_PULSE_SOURCE 1 24 | #define NITCLK_ATTR_EXPORTED_SYNC_PULSE_OUTPUT_TERMINAL 2 25 | #define NITCLK_ATTR_START_TRIGGER_MASTER_SESSION 3 26 | #define NITCLK_ATTR_REF_TRIGGER_MASTER_SESSION 4 27 | #define NITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION 5 28 | #define NITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION 6 29 | #define NITCLK_ATTR_TCLK_ACTUAL_PERIOD 8 30 | #define NITCLK_ATTR_EXPORTED_TCLK_OUTPUT_TERMINAL 9 31 | #define NITCLK_ATTR_SYNC_PULSE_CLOCK_SOURCE 10 32 | #define NITCLK_ATTR_SAMPLE_CLOCK_DELAY 11 33 | #define NITCLK_ATTR_SYNC_PULSE_SENDER_SYNC_PULSE_SOURCE 13 34 | 35 | 36 | 37 | 38 | // **************************************************************************************** 39 | // -------------------------- Library Function Declarations ------------------------------- 40 | // **************************************************************************************** 41 | 42 | ViStatus _VI_FUNC niTClk_ConfigureForHomogeneousTriggers(ViUInt32 sessionCount, 43 | ViSession sessions[]); 44 | 45 | ViStatus _VI_FUNC niTClk_Synchronize(ViUInt32 sessionCount, 46 | ViSession sessions[], 47 | ViReal64 minTime); 48 | 49 | ViStatus _VI_FUNC niTClk_Initiate(ViUInt32 sessionCount, 50 | ViSession sessions[]); 51 | 52 | ViStatus _VI_FUNC niTClk_WaitUntilDone(ViUInt32 sessionCount, 53 | ViSession sessions[], 54 | ViReal64 timeout); 55 | 56 | ViStatus _VI_FUNC niTClk_GetExtendedErrorInfo(ViChar errorString[], 57 | ViUInt32 errorStringSize); 58 | 59 | 60 | // --- Advanced Functions 61 | 62 | ViStatus _VI_FUNC niTClk_IsDone(ViUInt32 sessionCount, 63 | ViSession sessions[], 64 | ViBoolean *done); 65 | 66 | ViStatus _VI_FUNC niTClk_SetupForSyncPulseSenderSynchronize(ViUInt32 sessionCount, 67 | ViSession sessions[], 68 | ViReal64 minTime); 69 | 70 | ViStatus _VI_FUNC niTClk_FinishSyncPulseSenderSynchronize(ViUInt32 sessionCount, 71 | ViSession sessions[], 72 | ViReal64 minTime); 73 | 74 | ViStatus _VI_FUNC niTClk_SynchronizeToSyncPulseSender(ViUInt32 sessionCount, 75 | ViSession sessions[], 76 | ViReal64 minTime); 77 | 78 | 79 | // ------ Set Attribute 80 | 81 | ViStatus _VI_FUNC niTClk_SetAttributeViString (ViSession session, 82 | ViConstString channelName, 83 | ViAttr attributeId, 84 | ViConstString value); 85 | 86 | ViStatus _VI_FUNC niTClk_SetAttributeViSession(ViSession session, 87 | ViConstString channelName, 88 | ViAttr attributeId, 89 | ViSession value); 90 | 91 | ViStatus _VI_FUNC niTClk_SetAttributeViReal64(ViSession session, 92 | ViConstString channelName, 93 | ViAttr attributeId, 94 | ViReal64 value); 95 | 96 | 97 | // ------ Get Attribute 98 | 99 | ViStatus _VI_FUNC niTClk_GetAttributeViString (ViSession session, 100 | ViConstString channelName, 101 | ViAttr attributeId, 102 | ViInt32 bufSize, 103 | ViChar value[]); 104 | 105 | ViStatus _VI_FUNC niTClk_GetAttributeViSession(ViSession session, 106 | ViConstString channelName, 107 | ViAttr attributeId, 108 | ViSession *value); 109 | 110 | ViStatus _VI_FUNC niTClk_GetAttributeViReal64(ViSession session, 111 | ViConstString channelName, 112 | ViAttr attributeId, 113 | ViReal64 *value); 114 | 115 | 116 | 117 | // **************************************************************************************** 118 | // ------------------------ Error And Completion Codes ------------------------------------ 119 | // **************************************************************************************** 120 | 121 | #define NITCLK_SUCCESS 0 122 | 123 | 124 | #define NITCLK_ERROR_START_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK -250001 125 | #define NITCLK_ERROR_REF_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK -250002 126 | #define NITCLK_ERROR_SCRIPT_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK -250003 127 | #define NITCLK_ERROR_PAUSE_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK -250004 128 | #define NITCLK_ERROR_START_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK_FOR_LABVIEW -250005 129 | #define NITCLK_ERROR_REF_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK_FOR_LABVIEW -250006 130 | #define NITCLK_ERROR_SCRIPT_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK_FOR_LABVIEW -250007 131 | #define NITCLK_ERROR_PAUSE_TRIG_MASTER_DOES_NOT_SUPPORT_TCLK_FOR_LABVIEW -250008 132 | #define NITCLK_ERROR_CHAN_NAME_NOT_EMPTY -250009 133 | #define NITCLK_ERROR_REF_CLK_RATE_ZERO -250010 134 | #define NITCLK_ERROR_REF_CLK_RATE_NEGATIVE -250011 135 | #define NITCLK_ERROR_UNEQUAL_REF_CLK_RATES -250012 136 | #define NITCLK_ERROR_MIN_TCLK_PERIOD_NOT_SUPPORTED -250013 137 | #define NITCLK_ERROR_REF_CLK_SRC_NONE -250014 138 | #define NITCLK_ERROR_EXT_SAMP_CLK_RATE_NOT_ALSO_INT -250015 139 | #define NITCLK_ERROR_CANNOT_FIND_COMMON_TCLK_PERIOD -250016 140 | #define NITCLK_ERROR_INCONSISTENT_SYNC_PULSE_CLK_SRC -250017 141 | #define NITCLK_ERROR_INCONSISTENT_REF_CLK_SRC -250018 142 | #define NITCLK_ERROR_NO_START_TRIGS_CONFIGURED_ONE_OR_MORE_MASTERS -250019 143 | #define NITCLK_ERROR_NO_REF_TRIGS_CONFIGURED_ONE_OR_MORE_MASTERS -250020 144 | #define NITCLK_ERROR_NO_PAUSE_TRIGS_CONFIGURED_ONE_OR_MORE_MASTERS -250021 145 | #define NITCLK_ERROR_NO_SCRIPT_TRIGS_CONFIGURED_ONE_OR_MORE_MASTERS -250022 146 | #define NITCLK_ERROR_MULTIPLE_START_TRIG_MASTERS -250023 147 | #define NITCLK_ERROR_TIMEOUT_NOT_SUPPORTED -250024 148 | #define NITCLK_ERROR_OP_NOT_DONE_WITHIN_TIMEOUT -250025 149 | #define NITCLK_ERROR_MULTIPLE_SESSIONS_EXPORT_SYNC_PULSE -250026 150 | #define NITCLK_ERROR_SESSION_NOT_SUPPORTED -250027 151 | #define NITCLK_ERROR_ZERO_SESSIONS -250028 152 | #define NITCLK_ERROR_SESSIONS_ARRAY_NULL -250029 153 | #define NITCLK_ERROR_SESSION_SPECIFIED_TWICE -250030 154 | #define NITCLK_ERROR_TWO_SESSIONS_FOR_ONE_DEVICE -250031 155 | #define NITCLK_ERROR_SESSION_NOT_VALID -250032 156 | #define NITCLK_ERROR_COMMIT_FAILED -250033 157 | #define NITCLK_ERROR_INITIATE_FAILED -250034 158 | #define NITCLK_ERROR_IS_DONE_FAILED -250035 159 | #define NITCLK_ERROR_NULL_ERROR_STRING -250036 160 | #define NITCLK_ERROR_ZERO_START_TRIG_MASTERS -250037 161 | #define NITCLK_ERROR_ATTRIBUTE_ID_NOT_SUPPORTED -250038 162 | #define NITCLK_ERROR_GET_ATTRIBUTE_FUNCTION_NOT_SUPPORTED_DUE_TO_DATA_TYPE -250039 163 | #define NITCLK_ERROR_SET_ATTRIBUTE_FUNCTION_NOT_SUPPORTED_DUE_TO_DATA_TYPE -250040 164 | #define NITCLK_ERROR_GET_ATTRIBUTE_NOT_SUPPORTED -250041 165 | #define NITCLK_ERROR_SET_ATTRIBUTE_NOT_SUPPORTED -250042 166 | #define NITCLK_ERROR_INSTRUMENT_DRIVER_CALL_FAILED -250043 167 | #define NITCLK_ERROR_EXT_SAMP_CLK_RATE_NOT_ABOVE_ZERO -250044 168 | #define NITCLK_ERROR_EXT_SAMP_CLK_RATES_UNEQUAL -250045 169 | #define NITCLK_ERROR_TRIG_MASTER_SESSION_NO_LONGER_VALID -250046 170 | #define NITCLK_ERROR_MULTIPLE_SESSIONS_EXPORT_ONBOARD_REF_CLK -250047 171 | #define NITCLK_ERROR_SAMP_CLK_DELAY_NOT_SUPPORTED -250048 172 | #define NITCLK_ERROR_ONE_START_TRIG_CONFIGURED_ONE_OR_MORE_MASTERS -250049 173 | #define NITCLK_ERROR_ONE_REF_TRIG_CONFIGURED_ONE_OR_MORE_MASTERS -250050 174 | #define NITCLK_ERROR_ONE_PAUSE_TRIG_CONFIGURED_ONE_OR_MORE_MASTERS -250051 175 | #define NITCLK_ERROR_ONE_SCRIPT_TRIG_CONFIGURED_ONE_OR_MORE_MASTERS -250052 176 | #define NITCLK_ERROR_ALL_BUT_ONE_START_TRIG_CONFIGURED_AND_NONE_TRIG_NOT_MASTER -250053 177 | #define NITCLK_ERROR_ALL_BUT_ONE_REF_TRIG_CONFIGURED_AND_NONE_TRIG_NOT_MASTER -250054 178 | #define NITCLK_ERROR_ALL_BUT_ONE_PAUSE_TRIG_CONFIGURED_AND_NONE_TRIG_NOT_MASTER -250055 179 | #define NITCLK_ERROR_ALL_BUT_ONE_SCRIPT_TRIG_CONFIGURED_AND_NONE_TRIG_NOT_MASTER -250056 180 | #define NITCLK_ERROR_NUM_SESSIONS_START_TRIG_CONFIGURED -250057 181 | #define NITCLK_ERROR_NUM_SESSIONS_REF_TRIG_CONFIGURED -250058 182 | #define NITCLK_ERROR_NUM_SESSIONS_PAUSE_TRIG_CONFIGURED -250059 183 | #define NITCLK_ERROR_NUM_SESSIONS_SCRIPT_TRIG_CONFIGURED -250060 184 | #define NITCLK_ERROR_SAMP_CLK_RATE_TOO_LOW -250061 185 | #define NITCLK_ERROR_SAMP_CLK_DELAY_NOT_SUPPORTED_FOR_ACQ_SESSIONS -250062 186 | #define NITCLK_ERROR_SAMP_CLK_DELAY_NOT_SUPPORTED_FOR_EXT_SAMP_CLK -250063 187 | #define NITCLK_ERROR_SAMP_CLK_DELAY_NOT_SUPPORTED_FOR_EXT_SAMP_CLK_TIMEBASE -250064 188 | #define NITCLK_ERROR_MORE_THAN_ONE_REF_TRIG_MASTER -250065 189 | #define NITCLK_ERROR_ACTIVE_CHANNELS_NOT_SUPPORTED_FOR_LABVIEW -250066 190 | #define NITCLK_ERROR_ACTIVE_CHANNELS_FOR_SCRIPT_TRIGGER_MASTER_FOR_LABVIEW -250067 191 | #define NITCLK_ERROR_VALUE_IS_NULL -250068 192 | #define NITCLK_ERROR_CHANNEL_NAME_FOR_SCRIPT_TRIGGER_MASTER -250069 193 | #define NITCLK_ERROR_INCOMPATIBLE_VERSIONS_OF_NITCLK_AND_INSTRUMENT_DRIVER -250070 194 | #define NITCLK_ERROR_INCOMPATIBLE_VERSIONS_OF_NITCLK_AND_2_INSTRUMENT_DRIVERS -250071 195 | #define NITCLK_ERROR_EXT_SAMP_CLK_AND_OR_SAMP_CLK_TIMEBASE_RATE_UNMATCHED -250072 196 | #define NITCLK_ERROR_INVALID_ORDERING_OF_DEVICES_LIST -250073 197 | #define NITCLK_ERROR_SESSIONS_CANNOT_BE_SYNC_DUE_TO_CONFIGURATION -250074 198 | #define NITCLK_ERROR_DRIVER_VERSION_DOES_NOT_SUPPORT_ATTRIBUTE -250075 199 | #define NITCLK_ERROR_SESSIONS_CANNOT_CONFIGURED_DUE_TO_CONFIGURATION -250076 200 | 201 | #define NITCLK_WARNING_COMMIT_RETURNED_WARNING 250000 202 | #define NITCLK_WARNING_INITIATE_RETURNED_WARNING 250001 203 | #define NITCLK_WARNING_IS_DONE_RETURNED_WARNING 250002 204 | #define NITCLK_WARNING_STRING_TRUNCATED_TO_FIT_BUFFER 250003 205 | #define NITCLK_WARNING_INSTRUMENT_DRIVER_CALL_RETURNED_WARNING 250004 206 | 207 | 208 | #if defined(__cplusplus) || defined(__cplusplus__) 209 | } 210 | #endif 211 | 212 | #endif /* ___niTClk_h___ */ 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /Ni/include/niTuner.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * niTuner * 3 | *--------------------------------------------------------------------------* 4 | * Copyright (c) National Instruments 2001. All Rights Reserved. * 5 | *--------------------------------------------------------------------------* 6 | * * 7 | * Title: niTuner.h * 8 | * Purpose: NI-TUNER * 9 | * instrument driver declarations. * 10 | * * 11 | ****************************************************************************/ 12 | 13 | #ifndef __NITUNER_HEADER 14 | #define __NITUNER_HEADER 15 | 16 | #include 17 | 18 | #ifdef _CVI_ 19 | #include 20 | #pragma EnableLibraryRuntimeChecking 21 | #else 22 | #define CVIFUNC __stdcall 23 | #endif 24 | 25 | #if defined(__cplusplus) || defined(__cplusplus__) 26 | extern "C" { 27 | #endif 28 | 29 | /**************************************************************************** 30 | *----------------- Instrument Driver Revision Information -----------------* 31 | ****************************************************************************/ 32 | #define NITUNER_MAJOR_VERSION 1 /* Instrument driver major version */ 33 | #define NITUNER_MINOR_VERSION 5 /* Instrument driver minor version */ 34 | 35 | /**************************************************************************** 36 | *---------------------- Useful Macros and Defines -------------------------* 37 | ****************************************************************************/ 38 | 39 | /* Maximum length of a NI-TUNER function name, including the NULL terminator */ 40 | #define NITUNER_MAX_FUNCTION_NAME_SIZE 55 41 | 42 | /* Maximum size of an error message returned from niTuner_errorHandler or 43 | GetDAQErrorString, including the NULL terminator */ 44 | #define NITUNER_MAX_ERROR_DESCRIPTION 1024 45 | 46 | /* This macro handles all errors and warnings returned from NI-TUNER. 47 | It requires one variable be declared: 48 | int errorTuner 49 | and a line marked "ErrorTuner:" that marks the beginning of cleanup code. 50 | If a function returns an error code, "errorTuner" is set to the error code, 51 | and execution skips to the "ErrorTuner:" line. Otherwise, "errorTuner" 52 | stores the location of warnings that occur, and execution proceeds normally. */ 53 | #define handleErrTuner(fCall) { \ 54 | int code = (fCall); \ 55 | if (code != 0) errorTuner = code; \ 56 | if (code < 0) goto ErrorTuner; \ 57 | } 58 | 59 | /* General Constants */ 60 | #define NITUNER_MAX_FREQUENCY 2700000000 61 | #define NITUNER_CENTER_IF_FREQUENCY 15000000 62 | #define NITUNER_DEFAULT_SPAN 20000000 63 | 64 | /**************************************************************************** 65 | *------------------ Attribute and Parameter Value Defines -----------------* 66 | ****************************************************************************/ 67 | 68 | /*- Clock Reference Source Options -*/ 69 | #define NITUNER_REF_DRIVE_PXI_BACKPLANE_CLOCK 0 70 | #define NITUNER_REF_INTERNAL 1 71 | #define NITUNER_REF_LOCK_TO_PXI_BACKPLANE_CLOCK 2 72 | #define NITUNER_REF_EXTERNAL 3 73 | #define NITUNER_REF_DRIVE_PXI_BACKPLANE_CLOCK_EXTERNAL 4 74 | 75 | /*- Signal Path Options -*/ 76 | #define NITUNER_SIGNAL_SOFTWARE 0 77 | #define NITUNER_SIGNAL_NO_DESTINATION 0 78 | #define NITUNER_SIGNAL_RTSI0 1 79 | #define NITUNER_SIGNAL_RTSI1 2 80 | #define NITUNER_SIGNAL_RTSI2 3 81 | #define NITUNER_SIGNAL_RTSI3 4 82 | #define NITUNER_SIGNAL_RTSI4 5 83 | #define NITUNER_SIGNAL_RTSI5 6 84 | #define NITUNER_SIGNAL_RTSI6 7 85 | 86 | /*- Signal Type Options -*/ 87 | #define NITUNER_SIGNAL_PULSE 0 88 | #define NITUNER_SIGNAL_LEVEL 1 89 | 90 | /*- Signal Polarity Options -*/ 91 | #define NITUNER_SIGNAL_ACTIVE_LOW 0 92 | #define NITUNER_SIGNAL_ACTIVE_HIGH 1 93 | 94 | /*- Attenuation Option -*/ 95 | #define NITUNER_ATTN_AUTOMODE 1001 96 | 97 | /*- Boolean Defines -*/ 98 | #define NITUNER_VAL_FALSE 0 99 | #define NITUNER_VAL_TRUE 1 100 | 101 | /**************************************************************************** 102 | *---------------- Instrument Driver Function Declarations -----------------* 103 | ****************************************************************************/ 104 | 105 | /*--- Basic Functions ------------------------------------------------------*/ 106 | int CVIFUNC niTuner_init (int device, int *taskID); 107 | 108 | int CVIFUNC niTuner_initWithResetOption (int device, int *taskID, unsigned int reset); 109 | 110 | int CVIFUNC niTuner_setFreq (int taskID, double desiredRFFrequency, 111 | double span, double *actualIFFrequency, 112 | double *actualRFTunedFrequency, double *freqShift); 113 | 114 | int CVIFUNC niTuner_close (int taskID); 115 | 116 | /*--- General Configuration ------------------------------------------------*/ 117 | int CVIFUNC niTuner_setAttenuation (int taskID, int refLevel, int mixerLevel, 118 | double *attenuation, double *scaleFactor); 119 | 120 | int CVIFUNC niTuner_getAttenuation (int taskID, unsigned long listSize, 121 | double * attenuation, double * scaleFactor); 122 | 123 | /*--- Synchronization ------------------------------------------------------*/ 124 | int CVIFUNC niTuner_configAdvanceTrigger (int taskID, unsigned int signalSource, 125 | unsigned int signalType, unsigned int signalPolarity); 126 | 127 | 128 | int CVIFUNC niTuner_configReadySignal (int taskID, unsigned int signalDestination, 129 | unsigned int signalType, unsigned int signalPolarity, 130 | double pulseLength); 131 | 132 | int CVIFUNC niTuner_configReferenceClock (int taskID, 133 | unsigned int referenceConfiguration); 134 | 135 | int CVIFUNC niTuner_initiateScan (int taskID); 136 | 137 | int CVIFUNC niTuner_sendSoftwareTrigger (int taskID); 138 | 139 | /*--- Scan List Configuration ----------------------------------------------*/ 140 | int CVIFUNC niTuner_setFreqScanList (int taskID, unsigned long numFreq, 141 | double desiredRFFrequencies[], 142 | double spans[], 143 | double actualIFFrequencies[], 144 | double actualRFTunedFrequencies[], 145 | double freqShifts[]); 146 | 147 | int CVIFUNC niTuner_getCal (int taskID, 148 | unsigned long listSize, 149 | double RFArrays[], 150 | double IFArrays[], 151 | double attenuationArray[]); 152 | 153 | /*--- Utility --------------------------------------------------------------*/ 154 | int CVIFUNC niTuner_getTemperature (int taskID, double *temperature, 155 | double *correctionFactor); 156 | 157 | int CVIFUNC niTuner_getTemperatureWithRefreshInterval (int taskID, double *temperature, 158 | double *correctionFactor, double refreshInterval); 159 | 160 | int CVIFUNC niTuner_ready (int taskID, double timeout, unsigned long *ready); 161 | 162 | int CVIFUNC niTuner_errorHandler (int taskID, int errorCode, char errorSource[], 163 | char errorDescription[]); 164 | 165 | /**************************************************************************** 166 | *------------------- Error, Warning, and Completion Codes -----------------* 167 | ****************************************************************************/ 168 | #define NITUNER_ERROR_SUCCESS 0 169 | 170 | #define NITUNER_ERROR_OFFSET -27000 171 | #define NITUNER_MIN_ERROR ( -1 + NITUNER_ERROR_OFFSET ) 172 | #define NITUNER_MAX_ERROR ( -31 + NITUNER_ERROR_OFFSET ) 173 | #define NITUNER_ERROR_INVALIDSERIALCHAINSIZE ( -1 + NITUNER_ERROR_OFFSET ) 174 | #define NITUNER_ERROR_ALLOCATEMEMORY ( -2 + NITUNER_ERROR_OFFSET ) 175 | #define NITUNER_ERROR_FREQCOUNTERTIMEOUT ( -3 + NITUNER_ERROR_OFFSET ) 176 | #define NITUNER_ERROR_DOWNCONVERTERBUSY ( -4 + NITUNER_ERROR_OFFSET ) 177 | #define NITUNER_ERROR_RELAYBUSY ( -5 + NITUNER_ERROR_OFFSET ) 178 | #define NITUNER_ERROR_INFINITELOOP ( -6 + NITUNER_ERROR_OFFSET ) 179 | #define NITUNER_ERROR_DEVICEPOINTER ( -7 + NITUNER_ERROR_OFFSET ) 180 | #define NITUNER_ERROR_EEPROMWRITEFAIL ( -8 + NITUNER_ERROR_OFFSET ) 181 | #define NITUNER_ERROR_INVALIDARRAYSIZE ( -10 + NITUNER_ERROR_OFFSET ) 182 | #define NITUNER_ERROR_BADSPAN ( -11 + NITUNER_ERROR_OFFSET ) 183 | #define NITUNER_ERROR_RANGEERROR ( -12 + NITUNER_ERROR_OFFSET ) 184 | #define NITUNER_ERROR_RESETNOTCALLED ( -13 + NITUNER_ERROR_OFFSET ) 185 | #define NITUNER_ERROR_INITNOTCALLED ( -14 + NITUNER_ERROR_OFFSET ) 186 | #define NITUNER_ERROR_INVALIDRTSIVALUE ( -15 + NITUNER_ERROR_OFFSET ) 187 | #define NITUNER_ERROR_UNKNOWNPLL ( -16 + NITUNER_ERROR_OFFSET ) 188 | #define NITUNER_ERROR_CLOCKCONFLICT ( -17 + NITUNER_ERROR_OFFSET ) 189 | #define NITUNER_ERROR_NULLPOINTER ( -18 + NITUNER_ERROR_OFFSET ) 190 | #define NITUNER_ERROR_CPLDREJECT ( -19 + NITUNER_ERROR_OFFSET ) 191 | #define NITUNER_ERROR_FPGADOWNLOADFAILED ( -20 + NITUNER_ERROR_OFFSET ) 192 | #define NITUNER_ERROR_INVALIDATTRIBUTE ( -21 + NITUNER_ERROR_OFFSET ) 193 | #define NITUNER_ERROR_INVALID_SIGNAL_PATH ( -23 + NITUNER_ERROR_OFFSET ) 194 | #define NITUNER_ERROR_INVALID_SIGNAL_TYPE ( -24 + NITUNER_ERROR_OFFSET ) 195 | #define NITUNER_ERROR_INVALID_SIGNAL_POLARITY ( -25 + NITUNER_ERROR_OFFSET ) 196 | #define NITUNER_ERROR_INVALID_PULSE_LENGTH ( -26 + NITUNER_ERROR_OFFSET ) 197 | 198 | #define NITUNER_WARN_OFFSET 27000 199 | #define NITUNER_MIN_WARN ( 1 + NITUNER_WARN_OFFSET ) 200 | #define NITUNER_MAX_WARN ( 31 + NITUNER_WARN_OFFSET ) 201 | #define NITUNER_WARN_CALIBRATIONLOADFAIL ( 9 + NITUNER_WARN_OFFSET ) 202 | #define NITUNER_WARN_ATTENUATIONCOERCED ( 22 + NITUNER_WARN_OFFSET ) 203 | #define NITUNER_WARN_BAD_MIXER_RANGE ( 27 + NITUNER_WARN_OFFSET ) 204 | #define NITUNER_WARN_BAD_REFERENCE_RANGE ( 28 + NITUNER_WARN_OFFSET ) 205 | #define NITUNER_WARN_MAX_SPEC ( 29 + NITUNER_WARN_OFFSET ) 206 | #define NITUNER_WARN_MIXER_ABOVE_ZERO ( 30 + NITUNER_WARN_OFFSET ) 207 | #define NITUNER_WARN_BAD_IF_RANGE ( 31 + NITUNER_WARN_OFFSET ) 208 | 209 | 210 | 211 | /**************************************************************************** 212 | *---------------------------- End Include File ----------------------------* 213 | ****************************************************************************/ 214 | #if defined(__cplusplus) || defined(__cplusplus__) 215 | } 216 | #endif 217 | #endif /* __NITUNER_HEADER */ 218 | -------------------------------------------------------------------------------- /Ni/include/nidmmObsolete.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * N I - D M M 3 | *---------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 2002. All Rights Reserved. 5 | *---------------------------------------------------------------------------- 6 | * 7 | * Title: nidmmObsolete.h 8 | * Purpose: NiDmm Class value and attribute Id declarations for the 9 | * now obsolete IviDmm specification. 10 | * These macros are defined to keep backward compatibility with 11 | * previous versions of this file. Dmm specific drivers 12 | * should no longer use these macros. Instead, the drivers must 13 | * use definitions from the current nidmm.h header file. 14 | *****************************************************************************/ 15 | 16 | #ifndef __NIDMM__HEADER_OBSOLETE 17 | #define __NIDMM__HEADER_OBSOLETE 18 | 19 | #if defined(__cplusplus) || defined(__cplusplus__) 20 | extern "C" { 21 | #endif 22 | 23 | /********************************************************************************* 24 | * This section lists all attributes and values that became obsolete. Do not use * 25 | * these attributes and values in your drivers and applications. * 26 | *********************************************************************************/ 27 | 28 | #if (defined(_EXPORTING) && defined(_IVI_mswin32_)) 29 | #define NIDMM_DECLSPEC __declspec(dllexport) 30 | #else 31 | #define NIDMM_DECLSPEC 32 | #endif 33 | 34 | /* Use NIDMM_ATTR_CHANNEL_COUNT instead */ 35 | #define NIDMM_ATTR_NUM_CHANNELS IVI_ATTR_NUM_CHANNELS /* ViInt32, read only*/ 36 | /* Use NIDMM_ATTR_SPECIFIC_DRIVER_PREFIX instead */ 37 | #define NIDMM_ATTR_SPECIFIC_PREFIX IVI_ATTR_SPECIFIC_PREFIX /* ViString, read only*/ 38 | /* Use NIDMM_ATTR_SPECIFIC_DRIVER_REVISION instead */ 39 | #define NIDMM_ATTR_DRIVER_REVISION IVI_ATTR_DRIVER_REVISION /* ViString, read only*/ 40 | /* Use NIDMM_ATTR_QUERY_INSTRUMENT_STATUS instead */ 41 | #define NIDMM_ATTR_QUERY_INSTR_STATUS IVI_ATTR_QUERY_INSTR_STATUS /* ViBoolean */ 42 | /* Use NIDMM_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION instead */ 43 | #define NIDMM_ATTR_DRIVER_MAJOR_VERSION IVI_ATTR_DRIVER_MAJOR_VERSION /* ViInt32, read only */ 44 | /* Use NIDMM_ATTR_SPECIFIC_DRIVER_MINOR_VERSION instead */ 45 | #define NIDMM_ATTR_DRIVER_MINOR_VERSION IVI_ATTR_DRIVER_MINOR_VERSION /* ViInt32, read only */ 46 | #define NIDMM_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR /* ViInt32 */ 47 | #define NIDMM_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR /* ViInt32 */ 48 | #define NIDMM_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION /* ViString */ 49 | #define NIDMM_ATTR_ENGINE_MAJOR_VERSION IVI_ATTR_ENGINE_MAJOR_VERSION /* ViInt32, read only */ 50 | #define NIDMM_ATTR_ENGINE_MINOR_VERSION IVI_ATTR_ENGINE_MINOR_VERSION /* ViInt32, read only */ 51 | #define NIDMM_ATTR_ENGINE_REVISION IVI_ATTR_ENGINE_REVISION /* ViString, read-only */ 52 | #define NIDMM_ATTR_VISA_RM_SESSION IVI_ATTR_VISA_RM_SESSION /* ViSession, read only */ 53 | #define NIDMM_ATTR_DEFER_UPDATE IVI_ATTR_DEFER_UPDATE /* ViBoolean */ 54 | #define NIDMM_ATTR_RETURN_DEFERRED_VALUES IVI_ATTR_RETURN_DEFERRED_VALUES /* ViBoolean */ 55 | /* Use NIDMM_ATTR_IO_RESOURCE_DESCRIPTOR instead */ 56 | #define NIDMM_ATTR_RESOURCE_DESCRIPTOR IVI_ATTR_RESOURCE_DESCRIPTOR /* ViString, read only */ 57 | /* Use NIDMM_ATTR_RESOLUTION_ABSOLUTE */ 58 | #define NIDMM_ATTR_RESOLUTION NIDMM_ATTR_RESOLUTION_DIGITS /* ViReal64 */ 59 | /* Use NIDMM_ATTR_TRIGGER */ 60 | #define NIDMM_ATTR_START_TRIGGER (NIDMM_ATTR_BASE + 8L) /* ViInt32 */ 61 | #define NIDMM_ATTR_START_TRIG_SLOPE (NIDMM_ATTR_BASE + 9L) /* ViInt32 */ 62 | #define NIDMM_ATTR_SAMPLE_TRIGGER_DELAY (NIDMM_ATTR_BASE + 11L) /* ViReal64 */ 63 | #define NIDMM_ATTR_OLD_TRIGGER_MODEL (NIDMM_ATTR_BASE + 12L) /* ViBoolean */ 64 | #define NIDMM_ATTR_CHAN_NAMES (NIDMM_ATTR_BASE + 4L) /* ViString, read only */ 65 | #define NIDMM_ATTR_ID_QUERY_RESPONSE (NIDMM_ATTR_BASE + 1L) /* ViString, read only */ 66 | #define NIDMM_ATTR_AI_NUM_CHANNELS (NIDMM_ATTR_BASE + 5L) /* ViInt32, read only */ 67 | #define NIDMM_ATTR_FILTER_NOTCH (NIDMM_ATTR_BASE + 6L) /* ViInt32, read only */ 68 | #define NIDMM_ATTR_CONVER_PER_SAMPLE (NIDMM_ATTR_BASE + 7L) /* ViInt32, read only */ 69 | #define NIDMM_ATTR_AI_BUFFER_SIZE (NIDMM_ATTR_BASE + 13L) /* ViInt32 */ 70 | #define NIDMM_VAL_3_5_DIGITS (3.5) 71 | #define NIDMM_VAL_4_5_DIGITS (4.5) 72 | #define NIDMM_VAL_5_5_DIGITS (5.5) 73 | #define NIDMM_VAL_6_5_DIGITS (6.5) 74 | #define NIDMM_VAL_7_5_DIGITS (7.5) 75 | /* Use NIDMM_VAL_SOFTWARE_TRIG instead */ 76 | #define NIDMM_VAL_SW_TRIG_FUNC IVIDMM_VAL_SW_TRIG_FUNC 77 | /* Use NIDMM_VAL_POSITIVE instead */ 78 | #define NIDMM_VAL_POS IVIDMM_VAL_POSITIVE 79 | /* Use NIDMM_VAL_NEGATIVE instead */ 80 | #define NIDMM_VAL_NEG IVIDMM_VAL_NEGATIVE 81 | /* Use NIDMM_VAL_MILLIAMP instead */ 82 | #define NIDMM_VAL_1_MILIAMP 0.001 83 | #define NIDMM_WARN_FREQ_UNDERRANGE (NIDMM_WARN_EXT_STATUS_BASE + 0x80) // 0x3FFA4F80 1073368960 84 | 85 | 86 | /********************************************************************************* 87 | * This section lists all driver functions that became obsolete. Do not use * 88 | * these functions in your drivers and applications. * 89 | *********************************************************************************/ 90 | ViStatus _VI_FUNC niDMM_error_message( 91 | ViSession vi, 92 | ViStatus errorCode, 93 | ViChar errMessage[]); 94 | 95 | ViStatus _VI_FUNC niDMM_GetErrorInfo( 96 | ViSession vi, 97 | ViStatus *primaryError, 98 | ViStatus *secondaryError, 99 | ViChar errorElaboration[IVI_MAX_MESSAGE_BUF_SIZE]); 100 | 101 | ViStatus _VI_FUNC niDMM_ClearErrorInfo( 102 | ViSession vi); 103 | 104 | ViStatus _VI_FUNC niDMM_error_query( 105 | ViSession vi, 106 | ViStatus *errorCode, 107 | ViChar errMessage[]); 108 | 109 | ViStatus _VI_FUNC niDMM_Configure( 110 | ViSession vi, 111 | ViInt32 measFunction, 112 | ViReal64 range, 113 | ViReal64 resolution, 114 | ViReal64 minFrequency, 115 | ViReal64 maxFrequency); 116 | 117 | ViStatus _VI_FUNC niDMM_ConfigureMeasurement( 118 | ViSession vi, 119 | ViInt32 measFunction, 120 | ViReal64 range, 121 | ViReal64 resolution); 122 | 123 | ViStatus _VI_FUNC niDMM_ConfigureSampleDelayMode( 124 | ViSession vi, 125 | ViInt32 sampleDelayMode); 126 | 127 | ViStatus _VI_FUNC niDMM_Measure( 128 | ViSession vi, 129 | ViInt32 measFunction, 130 | ViInt32 maxTime, 131 | ViReal64 *reading); 132 | 133 | ViStatus _VI_FUNC niDMM_MeasureMultiPoint( 134 | ViSession vi, 135 | ViInt32 function, 136 | ViInt32 maxTime, 137 | ViInt32 arraySize, 138 | ViReal64 readingArray[], 139 | ViInt32 *actualPts); 140 | 141 | ViStatus _VI_FUNC niDMM_ConfigureMeasurementComplete( 142 | ViSession vi, 143 | ViInt32 destination, 144 | ViInt32 slope); 145 | 146 | ViStatus _VI_FUNC niDMM_SendSWTrigger( 147 | ViSession vi); 148 | 149 | ViStatus _VI_FUNC niDMM_SetPowerlineFrequency( 150 | ViSession vi, 151 | ViReal64 frequency); 152 | 153 | ViStatus _VI_FUNC niDMM_ConfigureStartTrigger( 154 | ViSession vi, 155 | ViInt32 source, 156 | ViInt32 slope); 157 | 158 | ViStatus _VI_FUNC niDMM_SetAutoZero( 159 | ViSession vi, 160 | ViInt32 enable); 161 | 162 | ViStatus _VI_FUNC niDMM_GetDigitsOfPrecision( 163 | ViSession vi, 164 | ViReal64 *digits); 165 | 166 | ViStatus _VI_FUNC niDMM_FormatMeas( 167 | ViInt32 function, 168 | ViReal64 range, 169 | ViReal64 resolution, 170 | ViReal64 reading, 171 | ViChar modeString[], 172 | ViChar rangeString[], 173 | ViChar dataString[]); 174 | 175 | ViStatus _VI_FUNC niDMM_FormatMeasAbsolute( 176 | ViInt32 function, 177 | ViReal64 range, 178 | ViReal64 resolution, 179 | ViReal64 reading, 180 | ViChar modeString[], 181 | ViChar rangeString[], 182 | ViChar dataString[]); 183 | 184 | ViStatus _VI_FUNC niDMM_CalculateAccuracy( 185 | ViSession vi, 186 | ViReal64 frequency, 187 | ViReal64 *multiplier, 188 | ViReal64 *offset); 189 | 190 | ViStatus _VI_FUNC niDMM_GetViReal64Type( 191 | ViSession vi, 192 | ViReal64 value, 193 | ViInt32* type); 194 | 195 | /**************************************************************************** 196 | *---------------------------- End Include File ----------------------------* 197 | ****************************************************************************/ 198 | 199 | #if defined(__cplusplus) || defined(__cplusplus__) 200 | } 201 | #endif 202 | 203 | #endif // __NIDMM__HEADER_OBSOLETE 204 | -------------------------------------------------------------------------------- /Ni/include/niswitchTopologies.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * NI Switch Topologies 3 | *--------------------------------------------------------------------------- 4 | * Copyright (c) National Instruments 1998-2004. All Rights Reserved. 5 | *--------------------------------------------------------------------------- 6 | * 7 | * Title: niswitchTopologies.h 8 | * Purpose: Define topologies for use with NI Switch 9 | * 10 | ****************************************************************************/ 11 | 12 | #ifndef ___niswitch_topologies_h___ 13 | #define ___niswitch_topologies_h___ 14 | 15 | #define NISWITCH_TOPOLOGY_CONFIGURED_TOPOLOGY "Configured Topology" 16 | 17 | #define NISWITCH_TOPOLOGY_1127_1_WIRE_64X1_MUX "1127/1-Wire 64x1 Mux" 18 | #define NISWITCH_TOPOLOGY_1127_2_WIRE_32X1_MUX "1127/2-Wire 32x1 Mux" 19 | #define NISWITCH_TOPOLOGY_1127_2_WIRE_4X8_MATRIX "1127/2-Wire 4x8 Matrix" 20 | #define NISWITCH_TOPOLOGY_1127_4_WIRE_16X1_MUX "1127/4-Wire 16x1 Mux" 21 | #define NISWITCH_TOPOLOGY_1127_INDEPENDENT "1127/Independent" 22 | 23 | #define NISWITCH_TOPOLOGY_1128_1_WIRE_64X1_MUX "1128/1-Wire 64x1 Mux" 24 | #define NISWITCH_TOPOLOGY_1128_2_WIRE_32X1_MUX "1128/2-Wire 32x1 Mux" 25 | #define NISWITCH_TOPOLOGY_1128_2_WIRE_4X8_MATRIX "1128/2-Wire 4x8 Matrix" 26 | #define NISWITCH_TOPOLOGY_1128_4_WIRE_16X1_MUX "1128/4-Wire 16x1 Mux" 27 | #define NISWITCH_TOPOLOGY_1128_INDEPENDENT "1128/Independent" 28 | 29 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_16X16_MATRIX "1129/2-Wire 16x16 Matrix" 30 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_8X32_MATRIX "1129/2-Wire 8x32 Matrix" 31 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_4X64_MATRIX "1129/2-Wire 4x64 Matrix" 32 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_DUAL_8X16_MATRIX "1129/2-Wire Dual 8x16 Matrix" 33 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_DUAL_4X32_MATRIX "1129/2-Wire Dual 4x32 Matrix" 34 | #define NISWITCH_TOPOLOGY_1129_2_WIRE_QUAD_4X16_MATRIX "1129/2-Wire Quad 4x16 Matrix" 35 | 36 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_256X1_MUX "1130/1-Wire 256x1 Mux" 37 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_DUAL_128X1_MUX "1130/1-Wire Dual 128x1 Mux" 38 | #define NISWITCH_TOPOLOGY_1130_2_WIRE_128X1_MUX "1130/2-Wire 128x1 Mux" 39 | #define NISWITCH_TOPOLOGY_1130_4_WIRE_64X1_MUX "1130/4-Wire 64x1 Mux" 40 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_4X64_MATRIX "1130/1-Wire 4x64 Matrix" 41 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_8X32_MATRIX "1130/1-Wire 8x32 Matrix" 42 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_OCTAL_32X1_MUX "1130/1-Wire Octal 32x1 Mux" 43 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_QUAD_64X1_MUX "1130/1-Wire Quad 64x1 Mux" 44 | #define NISWITCH_TOPOLOGY_1130_1_WIRE_SIXTEEN_16X1_MUX "1130/1-Wire Sixteen 16x1 Mux" 45 | #define NISWITCH_TOPOLOGY_1130_2_WIRE_4X32_MATRIX "1130/2-Wire 4x32 Matrix" 46 | #define NISWITCH_TOPOLOGY_1130_2_WIRE_OCTAL_16X1_MUX "1130/2-Wire Octal 16x1 Mux" 47 | #define NISWITCH_TOPOLOGY_1130_2_WIRE_QUAD_32X1_MUX "1130/2-Wire Quad 32x1 Mux" 48 | #define NISWITCH_TOPOLOGY_1130_4_WIRE_QUAD_16X1_MUX "1130/4-Wire Quad 16x1 Mux" 49 | #define NISWITCH_TOPOLOGY_1130_INDEPENDENT "1130/Independent" 50 | 51 | #define NISWITCH_TOPOLOGY_1160_16_SPDT "1160/16-SPDT" 52 | 53 | #define NISWITCH_TOPOLOGY_1161_8_SPDT "1161/8-SPDT" 54 | 55 | #define NISWITCH_TOPOLOGY_1163R_OCTAL_4X1_MUX "1163R/Octal 4x1 Mux" 56 | 57 | #define NISWITCH_TOPOLOGY_1166_32_SPDT "1166/32-SPDT" 58 | #define NISWITCH_TOPOLOGY_1166_16_DPDT "1166/16-DPDT" 59 | 60 | #define NISWITCH_TOPOLOGY_1167_INDEPENDENT "1167/Independent" 61 | 62 | #define NISWITCH_TOPOLOGY_1169_100_SPST "1169/100-SPST" 63 | #define NISWITCH_TOPOLOGY_1169_50_DPST "1169/50-DPST" 64 | 65 | #define NISWITCH_TOPOLOGY_1175_1_WIRE_196X1_MUX "1175/1-Wire 196x1 Mux" 66 | #define NISWITCH_TOPOLOGY_1175_2_WIRE_98X1_MUX "1175/2-Wire 98x1 Mux" 67 | #define NISWITCH_TOPOLOGY_1175_2_WIRE_95X1_MUX "1175/2-Wire 95x1 Mux" 68 | 69 | #define NISWITCH_TOPOLOGY_1190_QUAD_4X1_MUX "1190/Quad 4x1 Mux" 70 | 71 | #define NISWITCH_TOPOLOGY_1191_QUAD_4X1_MUX "1191/Quad 4x1 Mux" 72 | 73 | #define NISWITCH_TOPOLOGY_1192_8_SPDT "1192/8-SPDT" 74 | 75 | #define NISWITCH_TOPOLOGY_1193_32X1_MUX "1193/32x1 Mux" 76 | #define NISWITCH_TOPOLOGY_1193_DUAL_16X1_MUX "1193/Dual 16x1 Mux" 77 | #define NISWITCH_TOPOLOGY_1193_QUAD_8X1_MUX "1193/Quad 8x1 Mux" 78 | #define NISWITCH_TOPOLOGY_1193_16X1_TERMINATED_MUX "1193/16x1 Terminated Mux" 79 | #define NISWITCH_TOPOLOGY_1193_DUAL_8X1_TERMINATED_MUX "1193/Dual 8x1 Terminated Mux" 80 | #define NISWITCH_TOPOLOGY_1193_QUAD_4X1_TERMINATED_MUX "1193/Quad 4x1 Terminated Mux" 81 | #define NISWITCH_TOPOLOGY_1193_INDEPENDENT "1193/Independent" 82 | 83 | #define NISWITCH_TOPOLOGY_1194_QUAD_4X1_MUX "1194/Quad 4x1 Mux" 84 | 85 | #define NISWITCH_TOPOLOGY_1195_QUAD_4X1_MUX "1195/Quad 4x1 Mux" 86 | 87 | #define NISWITCH_TOPOLOGY_2501_1_WIRE_48X1_MUX "2501/1-Wire 48x1 Mux" 88 | #define NISWITCH_TOPOLOGY_2501_1_WIRE_48X1_AMPLIFIED_MUX "2501/1-Wire 48x1 Amplified Mux" 89 | #define NISWITCH_TOPOLOGY_2501_2_WIRE_24X1_MUX "2501/2-Wire 24x1 Mux" 90 | #define NISWITCH_TOPOLOGY_2501_2_WIRE_24X1_AMPLIFIED_MUX "2501/2-Wire 24x1 Amplified Mux" 91 | #define NISWITCH_TOPOLOGY_2501_2_WIRE_DUAL_12X1_MUX "2501/2-Wire Dual 12x1 Mux" 92 | #define NISWITCH_TOPOLOGY_2501_2_WIRE_QUAD_6X1_MUX "2501/2-Wire Quad 6x1 Mux" 93 | #define NISWITCH_TOPOLOGY_2501_2_WIRE_4X6_MATRIX "2501/2-Wire 4x6 Matrix" 94 | #define NISWITCH_TOPOLOGY_2501_4_WIRE_12X1_MUX "2501/4-Wire 12x1 Mux" 95 | 96 | #define NISWITCH_TOPOLOGY_2503_1_WIRE_48X1_MUX "2503/1-Wire 48x1 Mux" 97 | #define NISWITCH_TOPOLOGY_2503_2_WIRE_24X1_MUX "2503/2-Wire 24x1 Mux" 98 | #define NISWITCH_TOPOLOGY_2503_2_WIRE_DUAL_12X1_MUX "2503/2-Wire Dual 12x1 Mux" 99 | #define NISWITCH_TOPOLOGY_2503_2_WIRE_QUAD_6X1_MUX "2503/2-Wire Quad 6x1 Mux" 100 | #define NISWITCH_TOPOLOGY_2503_2_WIRE_4X6_MATRIX "2503/2-Wire 4x6 Matrix" 101 | #define NISWITCH_TOPOLOGY_2503_4_WIRE_12X1_MUX "2503/4-Wire 12x1 Mux" 102 | 103 | #define NISWITCH_TOPOLOGY_2510_INDEPENDENT "2510/Independent" 104 | 105 | #define NISWITCH_TOPOLOGY_2512_INDEPENDENT "2512/Independent" 106 | 107 | #define NISWITCH_TOPOLOGY_2514_INDEPENDENT "2514/Independent" 108 | 109 | #define NISWITCH_TOPOLOGY_2515_INDEPENDENT "2515/Independent" 110 | 111 | #define NISWITCH_TOPOLOGY_2527_1_WIRE_64X1_MUX "2527/1-Wire 64x1 Mux" 112 | #define NISWITCH_TOPOLOGY_2527_1_WIRE_DUAL_32X1_MUX "2527/1-Wire Dual 32x1 Mux" 113 | #define NISWITCH_TOPOLOGY_2527_2_WIRE_32X1_MUX "2527/2-Wire 32x1 Mux" 114 | #define NISWITCH_TOPOLOGY_2527_2_WIRE_DUAL_16X1_MUX "2527/2-Wire Dual 16x1 Mux" 115 | #define NISWITCH_TOPOLOGY_2527_4_WIRE_16X1_MUX "2527/4-Wire 16x1 Mux" 116 | #define NISWITCH_TOPOLOGY_2527_INDEPENDENT "2527/Independent" 117 | 118 | #define NISWITCH_TOPOLOGY_2529_2_WIRE_8X16_MATRIX "2529/2-Wire 8x16 Matrix" 119 | #define NISWITCH_TOPOLOGY_2529_2_WIRE_4X32_MATRIX "2529/2-Wire 4x32 Matrix" 120 | #define NISWITCH_TOPOLOGY_2529_2_WIRE_DUAL_4X16_MATRIX "2529/2-Wire Dual 4x16 Matrix" 121 | 122 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_128X1_MUX "2530/1-Wire 128x1 Mux" 123 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_DUAL_64X1_MUX "2530/1-Wire Dual 64x1 Mux" 124 | #define NISWITCH_TOPOLOGY_2530_2_WIRE_64X1_MUX "2530/2-Wire 64x1 Mux" 125 | #define NISWITCH_TOPOLOGY_2530_4_WIRE_32X1_MUX "2530/4-Wire 32x1 Mux" 126 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_4X32_MATRIX "2530/1-Wire 4x32 Matrix" 127 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_8X16_MATRIX "2530/1-Wire 8x16 Matrix" 128 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_OCTAL_16X1_MUX "2530/1-Wire Octal 16x1 Mux" 129 | #define NISWITCH_TOPOLOGY_2530_1_WIRE_QUAD_32X1_MUX "2530/1-Wire Quad 32x1 Mux" 130 | #define NISWITCH_TOPOLOGY_2530_2_WIRE_4X16_MATRIX "2530/2-Wire 4x16 Matrix" 131 | #define NISWITCH_TOPOLOGY_2530_2_WIRE_DUAL_32X1_MUX "2530/2-Wire Dual 32x1 Mux" 132 | #define NISWITCH_TOPOLOGY_2530_2_WIRE_QUAD_16X1_MUX "2530/2-Wire Quad 16x1 Mux" 133 | #define NISWITCH_TOPOLOGY_2530_4_WIRE_DUAL_16X1_MUX "2530/4-Wire Dual 16x1 Mux" 134 | #define NISWITCH_TOPOLOGY_2530_INDEPENDENT "2530/Independent" 135 | 136 | #define NISWITCH_TOPOLOGY_2531_1_WIRE_4X128_MATRIX "2531/1-Wire 4x128 Matrix" 137 | #define NISWITCH_TOPOLOGY_2531_1_WIRE_8X64_MATRIX "2531/1-Wire 8x64 Matrix" 138 | #define NISWITCH_TOPOLOGY_2531_1_WIRE_DUAL_4X64_MATRIX "2531/1-Wire Dual 4x64 Matrix" 139 | #define NISWITCH_TOPOLOGY_2531_1_WIRE_DUAL_8X32_MATRIX "2531/1-Wire Dual 8x32 Matrix" 140 | #define NISWITCH_TOPOLOGY_2531_2_WIRE_4X64_MATRIX "2531/2-Wire 4x64 Matrix" 141 | #define NISWITCH_TOPOLOGY_2531_2_WIRE_8X32_MATRIX "2531/2-Wire 8x32 Matrix" 142 | 143 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_16X32_MATRIX "2532/1-Wire 16x32 Matrix" 144 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_4X128_MATRIX "2532/1-Wire 4x128 Matrix" 145 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_8X64_MATRIX "2532/1-Wire 8x64 Matrix" 146 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_DUAL_16X16_MATRIX "2532/1-Wire Dual 16x16 Matrix" 147 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_DUAL_4X64_MATRIX "2532/1-Wire Dual 4x64 Matrix" 148 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_DUAL_8X32_MATRIX "2532/1-Wire Dual 8x32 Matrix" 149 | #define NISWITCH_TOPOLOGY_2532_1_WIRE_SIXTEEN_2X16_MATRIX "2532/1-Wire Sixteen 2x16 Matrix" 150 | #define NISWITCH_TOPOLOGY_2532_2_WIRE_16X16_MATRIX "2532/2-Wire 16x16 Matrix" 151 | #define NISWITCH_TOPOLOGY_2532_2_WIRE_4X64_MATRIX "2532/2-Wire 4x64 Matrix" 152 | #define NISWITCH_TOPOLOGY_2532_2_WIRE_8X32_MATRIX "2532/2-Wire 8x32 Matrix" 153 | 154 | #define NISWITCH_TOPOLOGY_2533_1_WIRE_4X64_MATRIX "2533/1-Wire 4x64 Matrix" 155 | 156 | #define NISWITCH_TOPOLOGY_2534_1_WIRE_8X32_MATRIX "2534/1-Wire 8x32 Matrix" 157 | 158 | #define NISWITCH_TOPOLOGY_2535_1_WIRE_4X136_MATRIX "2535/1-Wire 4x136 Matrix" 159 | 160 | #define NISWITCH_TOPOLOGY_2536_1_WIRE_8X68_MATRIX "2536/1-Wire 8x68 Matrix" 161 | 162 | #define NISWITCH_TOPOLOGY_2545_4X1_TERMINATED_MUX "2545/4x1 Terminated Mux" 163 | 164 | #define NISWITCH_TOPOLOGY_2546_DUAL_4X1_MUX "2546/Dual 4x1 Mux" 165 | 166 | #define NISWITCH_TOPOLOGY_2547_8X1_MUX "2547/8x1 Mux" 167 | 168 | #define NISWITCH_TOPOLOGY_2548_4_SPDT "2548/4-SPDT" 169 | 170 | #define NISWITCH_TOPOLOGY_2549_TERMINATED_2_SPDT "2549/Terminated 2-SPDT" 171 | 172 | #define NISWITCH_TOPOLOGY_2554_4X1_MUX "2554/4x1 Mux" 173 | 174 | #define NISWITCH_TOPOLOGY_2555_4X1_TERMINATED_MUX "2555/4x1 Terminated Mux" 175 | 176 | #define NISWITCH_TOPOLOGY_2556_DUAL_4X1_MUX "2556/Dual 4x1 Mux" 177 | 178 | #define NISWITCH_TOPOLOGY_2557_8X1_MUX "2557/8x1 Mux" 179 | 180 | #define NISWITCH_TOPOLOGY_2558_4_SPDT "2558/4-SPDT" 181 | 182 | #define NISWITCH_TOPOLOGY_2559_TERMINATED_2_SPDT "2559/Terminated 2-SPDT" 183 | 184 | #define NISWITCH_TOPOLOGY_2564_16_SPST "2564/16-SPST" 185 | #define NISWITCH_TOPOLOGY_2564_8_DPST "2564/8-DPST" 186 | 187 | #define NISWITCH_TOPOLOGY_2565_16_SPST "2565/16-SPST" 188 | 189 | #define NISWITCH_TOPOLOGY_2566_16_SPDT "2566/16-SPDT" 190 | #define NISWITCH_TOPOLOGY_2566_8_DPDT "2566/8-DPDT" 191 | 192 | #define NISWITCH_TOPOLOGY_2567_INDEPENDENT "2567/Independent" 193 | 194 | #define NISWITCH_TOPOLOGY_2568_31_SPST "2568/31-SPST" 195 | #define NISWITCH_TOPOLOGY_2568_15_DPST "2568/15-DPST" 196 | 197 | #define NISWITCH_TOPOLOGY_2569_100_SPST "2569/100-SPST" 198 | #define NISWITCH_TOPOLOGY_2569_50_DPST "2569/50-DPST" 199 | 200 | #define NISWITCH_TOPOLOGY_2570_40_SPDT "2570/40-SPDT" 201 | #define NISWITCH_TOPOLOGY_2570_20_DPDT "2570/20-DPDT" 202 | 203 | #define NISWITCH_TOPOLOGY_2571_66_SPDT "2571/66-SPDT" 204 | 205 | #define NISWITCH_TOPOLOGY_2575_1_WIRE_196X1_MUX "2575/1-Wire 196x1 Mux" 206 | #define NISWITCH_TOPOLOGY_2575_2_WIRE_98X1_MUX "2575/2-Wire 98x1 Mux" 207 | #define NISWITCH_TOPOLOGY_2575_2_WIRE_95X1_MUX "2575/2-Wire 95x1 Mux" 208 | 209 | #define NISWITCH_TOPOLOGY_2576_2_WIRE_64X1_MUX "2576/2-Wire 64x1 Mux" 210 | #define NISWITCH_TOPOLOGY_2576_2_WIRE_DUAL_32X1_MUX "2576/2-Wire Dual 32x1 Mux" 211 | #define NISWITCH_TOPOLOGY_2576_2_WIRE_OCTAL_8X1_MUX "2576/2-Wire Octal 8x1 Mux" 212 | #define NISWITCH_TOPOLOGY_2576_2_WIRE_QUAD_16X1_MUX "2576/2-Wire Quad 16x1 Mux" 213 | #define NISWITCH_TOPOLOGY_2576_2_WIRE_SIXTEEN_4X1_MUX "2576/2-Wire Sixteen 4x1 Mux" 214 | #define NISWITCH_TOPOLOGY_2576_INDEPENDENT "2576/Independent" 215 | 216 | #define NISWITCH_TOPOLOGY_2584_1_WIRE_12X1_MUX "2584/1-Wire 12x1 Mux" 217 | #define NISWITCH_TOPOLOGY_2584_1_WIRE_DUAL_6X1_MUX "2584/1-Wire Dual 6x1 Mux" 218 | #define NISWITCH_TOPOLOGY_2584_2_WIRE_6X1_MUX "2584/2-Wire 6x1 Mux" 219 | #define NISWITCH_TOPOLOGY_2584_INDEPENDENT "2584/Independent" 220 | 221 | #define NISWITCH_TOPOLOGY_2585_1_WIRE_10X1_MUX "2585/1-Wire 10x1 Mux" 222 | 223 | #define NISWITCH_TOPOLOGY_2586_10_SPST "2586/10-SPST" 224 | #define NISWITCH_TOPOLOGY_2586_5_DPST "2586/5-DPST" 225 | 226 | #define NISWITCH_TOPOLOGY_2590_4X1_MUX "2590/4x1 Mux" 227 | 228 | #define NISWITCH_TOPOLOGY_2591_4X1_MUX "2591/4x1 Mux" 229 | 230 | #define NISWITCH_TOPOLOGY_2593_16X1_MUX "2593/16x1 Mux" 231 | #define NISWITCH_TOPOLOGY_2593_DUAL_8X1_MUX "2593/Dual 8x1 Mux" 232 | #define NISWITCH_TOPOLOGY_2593_8X1_TERMINATED_MUX "2593/8x1 Terminated Mux" 233 | #define NISWITCH_TOPOLOGY_2593_DUAL_4X1_TERMINATED_MUX "2593/Dual 4x1 Terminated Mux" 234 | #define NISWITCH_TOPOLOGY_2593_INDEPENDENT "2593/Independent" 235 | 236 | #define NISWITCH_TOPOLOGY_2594_4X1_MUX "2594/4x1 Mux" 237 | 238 | #define NISWITCH_TOPOLOGY_2595_4X1_MUX "2595/4x1 Mux" 239 | 240 | #define NISWITCH_TOPOLOGY_2596_DUAL_6X1_MUX "2596/Dual 6x1 Mux" 241 | 242 | #define NISWITCH_TOPOLOGY_2597_6X1_TERMINATED_MUX "2597/6x1 Terminated Mux" 243 | 244 | #define NISWITCH_TOPOLOGY_2598_DUAL_TRANSFER "2598/Dual Transfer" 245 | 246 | #define NISWITCH_TOPOLOGY_2599_2_SPDT "2599/2-SPDT" 247 | 248 | #endif // ___niswitch_topologies_h___ 249 | -------------------------------------------------------------------------------- /Ni/include/visatype.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*/ 2 | /* Distributed by IVI Foundation Inc. */ 3 | /* */ 4 | /* Do not modify the contents of this file. */ 5 | /*---------------------------------------------------------------------------*/ 6 | /* */ 7 | /* Title : VISATYPE.H */ 8 | /* Date : 04-14-2006 */ 9 | /* Purpose : Fundamental VISA data types and macro definitions */ 10 | /* */ 11 | /*---------------------------------------------------------------------------*/ 12 | 13 | #ifndef __VISATYPE_HEADER__ 14 | #define __VISATYPE_HEADER__ 15 | 16 | #if defined(_WIN64) 17 | #define _VI_FAR 18 | #define _VI_FUNC __fastcall 19 | #define _VI_FUNCC __fastcall 20 | #define _VI_FUNCH __fastcall 21 | #define _VI_SIGNED signed 22 | #elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_) 23 | #define _VI_FAR 24 | #define _VI_FUNC __stdcall 25 | #define _VI_FUNCC __cdecl 26 | #define _VI_FUNCH __stdcall 27 | #define _VI_SIGNED signed 28 | #elif defined(_CVI_) && defined(_NI_i386_) 29 | #define _VI_FAR 30 | #define _VI_FUNC _pascal 31 | #define _VI_FUNCC 32 | #define _VI_FUNCH _pascal 33 | #define _VI_SIGNED signed 34 | #elif (defined(_WINDOWS) || defined(_Windows)) && !defined(_NI_mswin16_) 35 | #define _VI_FAR _far 36 | #define _VI_FUNC _far _pascal _export 37 | #define _VI_FUNCC _far _cdecl _export 38 | #define _VI_FUNCH _far _pascal 39 | #define _VI_SIGNED signed 40 | #elif (defined(hpux) || defined(__hpux)) && (defined(__cplusplus) || defined(__cplusplus__)) 41 | #define _VI_FAR 42 | #define _VI_FUNC 43 | #define _VI_FUNCC 44 | #define _VI_FUNCH 45 | #define _VI_SIGNED 46 | #else 47 | #define _VI_FAR 48 | #define _VI_FUNC 49 | #define _VI_FUNCC 50 | #define _VI_FUNCH 51 | #define _VI_SIGNED signed 52 | #endif 53 | 54 | #define _VI_ERROR (-2147483647L-1) /* 0x80000000 */ 55 | #define _VI_PTR _VI_FAR * 56 | 57 | /*- VISA Types --------------------------------------------------------------*/ 58 | 59 | #ifndef _VI_INT64_UINT64_DEFINED 60 | #if defined(_WIN64) || ((defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_)) 61 | #if (defined(_MSC_VER) && (_MSC_VER >= 1200)) || (defined(_CVI_) && (_CVI_ >= 700)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) 62 | typedef unsigned __int64 ViUInt64; 63 | typedef _VI_SIGNED __int64 ViInt64; 64 | #define _VI_INT64_UINT64_DEFINED 65 | #if defined(_WIN64) 66 | #define _VISA_ENV_IS_64_BIT 67 | #else 68 | /* This is a 32-bit OS, not a 64-bit OS */ 69 | #endif 70 | #endif 71 | #elif defined(__GNUC__) && (__GNUC__ >= 3) 72 | #include 73 | #include 74 | typedef u_int64_t ViUInt64; 75 | typedef int64_t ViInt64; 76 | #define _VI_INT64_UINT64_DEFINED 77 | #if defined(LONG_MAX) && (LONG_MAX > 0x7FFFFFFFL) 78 | #define _VISA_ENV_IS_64_BIT 79 | #else 80 | /* This is a 32-bit OS, not a 64-bit OS */ 81 | #endif 82 | #else 83 | /* This platform does not support 64-bit types */ 84 | #endif 85 | #endif 86 | 87 | #if defined(_VI_INT64_UINT64_DEFINED) 88 | typedef ViUInt64 _VI_PTR ViPUInt64; 89 | typedef ViUInt64 _VI_PTR ViAUInt64; 90 | typedef ViInt64 _VI_PTR ViPInt64; 91 | typedef ViInt64 _VI_PTR ViAInt64; 92 | #endif 93 | 94 | #if defined(LONG_MAX) && (LONG_MAX > 0x7FFFFFFFL) 95 | typedef unsigned int ViUInt32; 96 | typedef _VI_SIGNED int ViInt32; 97 | #else 98 | typedef unsigned long ViUInt32; 99 | typedef _VI_SIGNED long ViInt32; 100 | #endif 101 | 102 | typedef ViUInt32 _VI_PTR ViPUInt32; 103 | typedef ViUInt32 _VI_PTR ViAUInt32; 104 | typedef ViInt32 _VI_PTR ViPInt32; 105 | typedef ViInt32 _VI_PTR ViAInt32; 106 | 107 | typedef unsigned short ViUInt16; 108 | typedef ViUInt16 _VI_PTR ViPUInt16; 109 | typedef ViUInt16 _VI_PTR ViAUInt16; 110 | 111 | typedef _VI_SIGNED short ViInt16; 112 | typedef ViInt16 _VI_PTR ViPInt16; 113 | typedef ViInt16 _VI_PTR ViAInt16; 114 | 115 | typedef unsigned char ViUInt8; 116 | typedef ViUInt8 _VI_PTR ViPUInt8; 117 | typedef ViUInt8 _VI_PTR ViAUInt8; 118 | 119 | typedef _VI_SIGNED char ViInt8; 120 | typedef ViInt8 _VI_PTR ViPInt8; 121 | typedef ViInt8 _VI_PTR ViAInt8; 122 | 123 | typedef char ViChar; 124 | typedef ViChar _VI_PTR ViPChar; 125 | typedef ViChar _VI_PTR ViAChar; 126 | 127 | typedef unsigned char ViByte; 128 | typedef ViByte _VI_PTR ViPByte; 129 | typedef ViByte _VI_PTR ViAByte; 130 | 131 | typedef void _VI_PTR ViAddr; 132 | typedef ViAddr _VI_PTR ViPAddr; 133 | typedef ViAddr _VI_PTR ViAAddr; 134 | 135 | typedef float ViReal32; 136 | typedef ViReal32 _VI_PTR ViPReal32; 137 | typedef ViReal32 _VI_PTR ViAReal32; 138 | 139 | typedef double ViReal64; 140 | typedef ViReal64 _VI_PTR ViPReal64; 141 | typedef ViReal64 _VI_PTR ViAReal64; 142 | 143 | typedef ViPByte ViBuf; 144 | typedef ViPByte ViPBuf; 145 | typedef ViPByte _VI_PTR ViABuf; 146 | 147 | typedef ViPChar ViString; 148 | typedef ViPChar ViPString; 149 | typedef ViPChar _VI_PTR ViAString; 150 | 151 | typedef ViString ViRsrc; 152 | typedef ViString ViPRsrc; 153 | typedef ViString _VI_PTR ViARsrc; 154 | 155 | typedef ViUInt16 ViBoolean; 156 | typedef ViBoolean _VI_PTR ViPBoolean; 157 | typedef ViBoolean _VI_PTR ViABoolean; 158 | 159 | typedef ViInt32 ViStatus; 160 | typedef ViStatus _VI_PTR ViPStatus; 161 | typedef ViStatus _VI_PTR ViAStatus; 162 | 163 | typedef ViUInt32 ViVersion; 164 | typedef ViVersion _VI_PTR ViPVersion; 165 | typedef ViVersion _VI_PTR ViAVersion; 166 | 167 | typedef ViUInt32 ViObject; 168 | typedef ViObject _VI_PTR ViPObject; 169 | typedef ViObject _VI_PTR ViAObject; 170 | 171 | typedef ViObject ViSession; 172 | typedef ViSession _VI_PTR ViPSession; 173 | typedef ViSession _VI_PTR ViASession; 174 | 175 | typedef ViUInt32 ViAttr; 176 | 177 | #ifndef _VI_CONST_STRING_DEFINED 178 | typedef const ViChar * ViConstString; 179 | #define _VI_CONST_STRING_DEFINED 180 | #endif 181 | 182 | /*- Completion and Error Codes ----------------------------------------------*/ 183 | 184 | #define VI_SUCCESS (0L) 185 | 186 | /*- Other VISA Definitions --------------------------------------------------*/ 187 | 188 | #define VI_NULL (0) 189 | 190 | #define VI_TRUE (1) 191 | #define VI_FALSE (0) 192 | 193 | /*- Backward Compatibility Macros -------------------------------------------*/ 194 | 195 | #define VISAFN _VI_FUNC 196 | #define ViPtr _VI_PTR 197 | 198 | #endif 199 | 200 | /*- The End -----------------------------------------------------------------*/ 201 | 202 | -------------------------------------------------------------------------------- /Ni/include/vpptype.bas: -------------------------------------------------------------------------------- 1 | ' ------------------------------------------------------------------------- 2 | ' Distributed by VXIplug&play Systems Alliance 3 | ' Do not modify the contents of this file. 4 | ' ------------------------------------------------------------------------- 5 | ' Title : VPPTYPE.BAS 6 | ' Date : 02-14-95 7 | ' Purpose : VXIplug&play instrument driver header file 8 | ' ------------------------------------------------------------------------- 9 | 10 | Global Const VI_NULL = 0 11 | Global Const VI_TRUE = 1 12 | Global Const VI_FALSE = 0 13 | 14 | ' - Completion and Error Codes -------------------------------------------- 15 | 16 | Global Const VI_WARN_NSUP_ID_QUERY = &H3FFC0101& 17 | Global Const VI_WARN_NSUP_RESET = &H3FFC0102& 18 | Global Const VI_WARN_NSUP_SELF_TEST = &H3FFC0103& 19 | Global Const VI_WARN_NSUP_ERROR_QUERY = &H3FFC0104& 20 | Global Const VI_WARN_NSUP_REV_QUERY = &H3FFC0105& 21 | 22 | Global Const VI_ERROR_PARAMETER1 = &HBFFC0001& 23 | Global Const VI_ERROR_PARAMETER2 = &HBFFC0002& 24 | Global Const VI_ERROR_PARAMETER3 = &HBFFC0003& 25 | Global Const VI_ERROR_PARAMETER4 = &HBFFC0004& 26 | Global Const VI_ERROR_PARAMETER5 = &HBFFC0005& 27 | Global Const VI_ERROR_PARAMETER6 = &HBFFC0006& 28 | Global Const VI_ERROR_PARAMETER7 = &HBFFC0007& 29 | Global Const VI_ERROR_PARAMETER8 = &HBFFC0008& 30 | Global Const VI_ERROR_FAIL_ID_QUERY = &HBFFC0011& 31 | Global Const VI_ERROR_INV_RESPONSE = &HBFFC0012& 32 | 33 | ' - Additional Definitions ------------------------------------------------ 34 | 35 | Global Const VI_ON = 1 36 | Global Const VI_OFF = 0 37 | 38 | -------------------------------------------------------------------------------- /Ni/include/vpptype.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*/ 2 | /* Distributed by VXIplug&play Systems Alliance */ 3 | /* */ 4 | /* Do not modify the contents of this file. */ 5 | /*---------------------------------------------------------------------------*/ 6 | /* */ 7 | /* Title : VPPTYPE.H */ 8 | /* Date : 02-14-95 */ 9 | /* Purpose : VXIplug&play instrument driver header file */ 10 | /* */ 11 | /*---------------------------------------------------------------------------*/ 12 | 13 | #ifndef __VPPTYPE_HEADER__ 14 | #define __VPPTYPE_HEADER__ 15 | 16 | #include "visatype.h" 17 | 18 | /*- Completion and Error Codes ----------------------------------------------*/ 19 | 20 | #define VI_WARN_NSUP_ID_QUERY ( 0x3FFC0101L) 21 | #define VI_WARN_NSUP_RESET ( 0x3FFC0102L) 22 | #define VI_WARN_NSUP_SELF_TEST ( 0x3FFC0103L) 23 | #define VI_WARN_NSUP_ERROR_QUERY ( 0x3FFC0104L) 24 | #define VI_WARN_NSUP_REV_QUERY ( 0x3FFC0105L) 25 | 26 | #define VI_ERROR_PARAMETER1 (_VI_ERROR+0x3FFC0001L) 27 | #define VI_ERROR_PARAMETER2 (_VI_ERROR+0x3FFC0002L) 28 | #define VI_ERROR_PARAMETER3 (_VI_ERROR+0x3FFC0003L) 29 | #define VI_ERROR_PARAMETER4 (_VI_ERROR+0x3FFC0004L) 30 | #define VI_ERROR_PARAMETER5 (_VI_ERROR+0x3FFC0005L) 31 | #define VI_ERROR_PARAMETER6 (_VI_ERROR+0x3FFC0006L) 32 | #define VI_ERROR_PARAMETER7 (_VI_ERROR+0x3FFC0007L) 33 | #define VI_ERROR_PARAMETER8 (_VI_ERROR+0x3FFC0008L) 34 | #define VI_ERROR_FAIL_ID_QUERY (_VI_ERROR+0x3FFC0011L) 35 | #define VI_ERROR_INV_RESPONSE (_VI_ERROR+0x3FFC0012L) 36 | 37 | 38 | /*- Additional Definitions --------------------------------------------------*/ 39 | 40 | #define VI_ON (1) 41 | #define VI_OFF (0) 42 | 43 | #endif 44 | 45 | /*- The End -----------------------------------------------------------------*/ 46 | 47 | -------------------------------------------------------------------------------- /Ni/lib/bc/ivi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/ivi.lib -------------------------------------------------------------------------------- /Ni/lib/bc/niHSDIO.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/niHSDIO.lib -------------------------------------------------------------------------------- /Ni/lib/bc/niScope.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/niScope.lib -------------------------------------------------------------------------------- /Ni/lib/bc/niTClk.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/niTClk.lib -------------------------------------------------------------------------------- /Ni/lib/bc/nidcpower.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/nidcpower.lib -------------------------------------------------------------------------------- /Ni/lib/bc/nidmm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/nidmm.lib -------------------------------------------------------------------------------- /Ni/lib/bc/niswitch.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/niswitch.lib -------------------------------------------------------------------------------- /Ni/lib/bc/visa32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/bc/visa32.lib -------------------------------------------------------------------------------- /Ni/lib/msc/ivi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/ivi.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niArbCal.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niArbCal.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niFgen.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niFgen.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niHSDIO.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niHSDIO.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niModInst.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niModInst.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niRFSA.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niRFSA.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niScope.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niScope.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niTClk.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niTClk.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niTuner.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niTuner.lib -------------------------------------------------------------------------------- /Ni/lib/msc/nidcpower.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/nidcpower.lib -------------------------------------------------------------------------------- /Ni/lib/msc/nidmm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/nidmm.lib -------------------------------------------------------------------------------- /Ni/lib/msc/nidmm_32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/nidmm_32.lib -------------------------------------------------------------------------------- /Ni/lib/msc/niswitch.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/niswitch.lib -------------------------------------------------------------------------------- /Ni/lib/msc/visa32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Ni/lib/msc/visa32.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DeviceOpr 2 | Qt框架调用Visa库控制频率计采集数据 3 | -------------------------------------------------------------------------------- /Visadll/AppIco.rc: -------------------------------------------------------------------------------- 1 | #include "winver.h" 2 | 3 | IDI_ICON1 ICON DISCARDABLE "labview.ico" 4 | 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,0 8 | PRODUCTVERSION 1,0,0,0 9 | FILEFLAGS 0x0L 10 | FILEFLAGSMASK 0x3fL 11 | FILEOS 0x00040004L 12 | FILETYPE 0x1L 13 | FILESUBTYPE 0x0L 14 | BEGIN 15 | BLOCK "StringFileInfo" 16 | BEGIN 17 | BLOCK "000004b0" 18 | BEGIN 19 | VALUE "CompanyName", "National Instruments Corporation" 20 | VALUE "FileDescription", "LabVIEW Instrument" 21 | VALUE "FileVersion", "12.0.0" 22 | VALUE "LegalCopyright", "Copyright (C) 2013 National Instruments Corporation." 23 | VALUE "InternalName", "LabVIEW" 24 | VALUE "OriginalFilename", "labview.exe" 25 | VALUE "ProductName", "National Instruments LabVIEW" 26 | VALUE "ProductVersion", "12.0.0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /Visadll/Visadll.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-10-18T14:25:55 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = Device_Control 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | widget.cpp \ 17 | widget_measure.cpp \ 18 | widget_cmd.cpp \ 19 | widget_timer_recorder.cpp \ 20 | measurethread.cpp 21 | 22 | HEADERS += widget.h\ 23 | ../Ni/include/visa.h \ 24 | measurethread.h 25 | 26 | FORMS += widget.ui 27 | 28 | LIBS += ../Ni/lib/msc/visa32.lib 29 | 30 | win32:RC_FILE += AppIco.rc 31 | 32 | OTHER_FILES += 33 | 34 | -------------------------------------------------------------------------------- /Visadll/labview.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuanglengyunji/DeviceOpr/92013cbae38e338dcc65d1c694934411a17b408c/Visadll/labview.ico -------------------------------------------------------------------------------- /Visadll/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /Visadll/measurethread.cpp: -------------------------------------------------------------------------------- 1 | #include "measurethread.h" 2 | 3 | Widget * m_pwidget; 4 | 5 | MeasureThread::MeasureThread() 6 | { 7 | 8 | } 9 | 10 | void MeasureThread::run() 11 | { 12 | flag = 1; 13 | while(true) 14 | { 15 | m_pwidget->Timing1(); 16 | if(!flag) 17 | return; 18 | } 19 | } 20 | 21 | void MeasureThread::mystop() 22 | { 23 | flag = 0; 24 | } 25 | -------------------------------------------------------------------------------- /Visadll/measurethread.h: -------------------------------------------------------------------------------- 1 | #ifndef MEASURETHREAD_H 2 | #define MEASURETHREAD_H 3 | 4 | #include 5 | #include "widget.h" 6 | 7 | class MeasureThread : public QThread 8 | { 9 | Q_OBJECT 10 | public: 11 | MeasureThread(); 12 | void run(); 13 | void mystop(); 14 | 15 | private: 16 | int flag; 17 | }; 18 | 19 | #endif // MEASURETHREAD_H 20 | -------------------------------------------------------------------------------- /Visadll/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | extern Widget * m_pwidget; 5 | 6 | Widget::Widget(QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::Widget) 9 | { 10 | ui->setupUi(this); 11 | 12 | state_1s = false; 13 | state_10s = false; 14 | state_100s = false; 15 | state_1000s = false; 16 | state_10000s = false; 17 | state_86400s = false; 18 | state_300s = false; 19 | 20 | QString file_full = QCoreApplication::applicationFilePath(); //获取路径信息 21 | QFileInfo fi = QFileInfo(file_full); //建立文件信息对象 22 | file_path = fi.absolutePath(); //提取路径信息 23 | ui->lineEdit_filepath->setText(file_path); 24 | 25 | //测量次数初始化 26 | measure_counter = 0; 27 | 28 | //显示计数数值 29 | QString str; 30 | str.setNum(measure_counter); 31 | ui->lineEdit_counter->setText(str); 32 | 33 | m_pwidget = this; 34 | 35 | } 36 | 37 | Widget::~Widget() 38 | { 39 | delete ui; 40 | } 41 | 42 | 43 | void Widget::on_bt_Search_clicked() 44 | { 45 | static ViString DevCmd; //指令字符串 46 | 47 | int DevIte=1; 48 | 49 | //获取新数据前清空列表框和下拉框 50 | ui->listWidget->clear(); 51 | ui->comboBox->clear(); 52 | 53 | //打开与默认资源管理器的通话 54 | status=viOpenDefaultRM (&defaultRM); 55 | if (status < VI_SUCCESS) 56 | { 57 | QMessageBox::information(this,tr("Information"),tr("Could no open a session to the VISA Resource!"),QMessageBox::Ok); 58 | return; 59 | } 60 | 61 | char myCmd[]={'?','*','I','N','S','T','R','\0'}; 62 | // char myCmd[]={'T','C','P','I','P','?','*','I','N','S','T','R','\0'}; //TCPIP?*INSTR 63 | DevCmd=myCmd; 64 | status = viFindRsrc (defaultRM, DevCmd, &findList, &numInstrs, instrDescriptor); //查询VISA系统进行资源定位 65 | 66 | if (status < VI_SUCCESS) 67 | { 68 | QMessageBox::information(this,tr("Information"),tr("An error occurred while finding resources."),QMessageBox::Ok); 69 | viClose (defaultRM); 70 | return; 71 | } 72 | 73 | ui->listWidget->addItem(tr("Instruments and serial ports found: %1\n").arg(numInstrs)); 74 | ui->listWidget->addItem(tr("Other resources found: %1\n").arg(instrDescriptor)); //显示找到设备的数量 75 | ui->listWidget->addItem(tr("--------------------Device list----------------\n")); 76 | 77 | status = viOpen(defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr); 78 | if (status < VI_SUCCESS) 79 | { 80 | QMessageBox::information(this,tr("Information"),tr("An error occurred opening a session to %1").arg(instrDescriptor),QMessageBox::Ok); 81 | } 82 | else 83 | { 84 | /* Now close the session we just opened. */ 85 | /* In actuality, we would probably use an attribute to determine */ 86 | /* if this is the instrument we are looking for. */ 87 | ui->listWidget->addItem(QString::number(DevIte++,10) + tr(": %1\n").arg(instrDescriptor)); 88 | ui->comboBox->addItem(tr("%1").arg(instrDescriptor)); 89 | viClose (instr); 90 | } 91 | 92 | 93 | while (--numInstrs) 94 | { 95 | /* stay in this loop until we find all instruments */ 96 | status = viFindNext (findList, instrDescriptor); /* find next desriptor */ 97 | if (status < VI_SUCCESS) 98 | { 99 | /* did we find the next resource? */ 100 | QMessageBox::information(this,tr("Information"),tr("An error occurred finding the next resource.\nHit enter to continue."),QMessageBox::Ok); 101 | viClose (defaultRM); 102 | } 103 | 104 | ui->listWidget->addItem(QString::number(DevIte++,10) + tr(": %1\n").arg(instrDescriptor)); 105 | ui->comboBox->addItem(tr("%1").arg(instrDescriptor)); 106 | 107 | 108 | /* Now we will open a session to the instrument we just found */ 109 | status = viOpen (defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr); 110 | if (status < VI_SUCCESS) 111 | { 112 | //printf ("An error occurred opening a session to %s\n",instrDescriptor); 113 | QMessageBox::information(this,tr("Information"),tr("An error occurred opening a session to %1 \n").arg(instrDescriptor),QMessageBox::Ok); 114 | } 115 | else 116 | { 117 | /* Now close the session we just opened. */ 118 | /* In actuality, we would probably use an attribute to determine */ 119 | /* if this is the instrument we are looking for. */ 120 | viClose (instr); 121 | } 122 | } /* end while */ 123 | 124 | status = viClose(findList); 125 | status = viClose (defaultRM); 126 | 127 | if(ui->comboBox->count()>0) 128 | { 129 | //手动发送指令部分使能 130 | ui->bt_SendCMD->setEnabled(true); 131 | ui->bt_SendCMD_Get->setEnabled(true); 132 | ui->lineEdit_Cmd->setEnabled(true); 133 | 134 | //进入时间间隔测量模式按钮使能 135 | ui->CMD_TINTerval->setEnabled(true); 136 | } 137 | 138 | } 139 | 140 | //防止文本框内容过多 141 | void Widget::on_textEdit_Receive_textChanged() 142 | { 143 | int length = ui->textEdit_Receive->toPlainText().length(); 144 | if(length>2000) 145 | ui->textEdit_Receive->clear(); 146 | } 147 | 148 | 149 | 150 | // //创建文件路径和文件 151 | // QDir TEST; 152 | // bool exist = TEST.exists("TEST"); 153 | // if(!exist) 154 | // TEST.mkdir("TEST"); 155 | // QString fileName = "TEST/1.txt"; 156 | // QFile file(fileName); 157 | 158 | // //打开文件 159 | // if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) 160 | // { 161 | // QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 162 | // } 163 | 164 | // //写入数据 165 | // QTextStream out(&file); 166 | // out << str << "\n" ; 167 | 168 | // //关闭文件 169 | // file.close(); 170 | 171 | // QString sFilePath = "C:\\test.txt"; 172 | 173 | // QFile file(sFilePath); 174 | // //方式:Append为追加,WriteOnly,ReadOnly 175 | // if (!file.open(QIODevice::WriteOnly|QIODevice::Text)) { 176 | // QMessageBox::critical(NULL, "提示", "无法创建文件"); 177 | // return; 178 | // } 179 | // QTextStream out(&file); 180 | // out<<"要写入内容"<textEdit_Receive->setText(rdBuff); 223 | // cout << rdBuff << endl; 224 | 225 | // /* Close */ 226 | // viClose( pInstrHandle); 227 | // viClose( rmSession); 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | void Widget::on_pushButton_3_clicked() 258 | { 259 | QMessageBox::information(this,"关于"," 本软件用途为测量两路秒信号的时间间隔和相关数据分析。\n 工作方式为协同Keysight 53230A频率计进行时间数据的精确采集,\ 260 | 通过内置算法对所采数据进行分析运算。\n 开发人员:仲崇霞、刘涵、高觊"); 261 | } 262 | 263 | 264 | -------------------------------------------------------------------------------- /Visadll/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "measurethread.h" 14 | 15 | #include "../Ni/include/visa.h" 16 | 17 | 18 | namespace Ui { 19 | class Widget; 20 | } 21 | 22 | 23 | class Widget : public QWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit Widget(QWidget *parent = 0); 29 | ~Widget(); 30 | 31 | //操作函数 32 | 33 | QString Send_And_Get(QString cmd); //发送指令读取回参 34 | 35 | void Send_No_Get(QString cmd); //发送指令不读取回参 36 | 37 | double Get_Number(QString cmd); //获取1个数据 38 | 39 | //定时采样控制函数 40 | 41 | void Timer_Start(int ms); 42 | 43 | void Timer_Stop(); 44 | 45 | //单独的采样函数 46 | void Timing1(); //定时器服务函数 47 | 48 | void Continue_Start(); 49 | void Continue_Stop(); 50 | double Continue_Get_Number(QString cmd); 51 | 52 | //设置生成剔除文件的起始与终止日期 53 | QDate BeginDate; 54 | QDate EndDate; 55 | //剔除算法部分 56 | int dataType = 1;//用来存放所要剔除的数据的类型 57 | void tichu(QString srcFile,QString trgFile,int dataType);//一共进行3次剔除,dataType用来标识数据是以多大间隔测量的 58 | 59 | //性能评定算法部分 60 | void performanceEvaluation(int dataType,QString srcFile); 61 | 62 | 63 | private slots: 64 | void on_bt_Search_clicked(); 65 | 66 | void on_bt_SendCMD_clicked(); 67 | 68 | void on_Time_Interval_clicked(); 69 | 70 | void on_Timer_button_clicked(); 71 | 72 | void on_bt_SendCMD_Get_clicked(); 73 | 74 | void on_Voltage_Set_clicked(); 75 | 76 | void on_CMD_TINTerval_clicked(); 77 | 78 | void on_textEdit_Receive_textChanged(); 79 | 80 | void Record_Data1(double s); //1s保存数据函数 81 | 82 | void Record_Data10(double s); //10s保存数据函数 83 | 84 | void Record_Data100(double s); //100s保存数据函数 85 | 86 | void Record_Data1000(double s); //1000s保存数据函数 87 | 88 | void Record_Data10000(double s); //10000s保存数据函数 89 | 90 | void Record_Data86400(double s); //86400保存数据函数 91 | void Record_Data300(double s); //86400保存数据函数 92 | 93 | void on_checkBox_1s_stateChanged(int arg1); 94 | 95 | void on_checkBox_10s_stateChanged(int arg1); 96 | 97 | void on_checkBox_100s_stateChanged(int arg1); 98 | 99 | void on_checkBox_1000s_stateChanged(int arg1); 100 | 101 | void on_checkBox_10000s_stateChanged(int arg1); 102 | 103 | void on_checkBox_86400s_stateChanged(int arg1); 104 | 105 | void on_filepath_clicked(); 106 | 107 | void on_clear_counter_clicked(); 108 | 109 | 110 | 111 | void on_pushButton_clicked(); 112 | 113 | void on_tichu_button_clicked(); 114 | 115 | void on_comboBox_2_currentIndexChanged(int index); 116 | 117 | void on_comboBox_3_currentIndexChanged(int index); 118 | 119 | void on_comboBox_4_currentIndexChanged(int index); 120 | 121 | void on_pushButton_2_clicked(); 122 | 123 | void on_BeginDate_dateChanged(const QDate &date); 124 | 125 | void on_EndDate_dateChanged(const QDate &date); 126 | 127 | void on_pushButton_3_clicked(); 128 | 129 | void on_checkBox_300s_stateChanged(int arg1); 130 | 131 | private: 132 | Ui::Widget *ui; 133 | 134 | QTimer timer1; 135 | 136 | //连接设备所需 137 | char instrDescriptor[VI_FIND_BUFLEN]; 138 | ViUInt32 numInstrs; 139 | ViFindList findList; 140 | ViSession defaultRM, instr; 141 | ViStatus status; 142 | ViUInt32 retCount; 143 | ViUInt32 writeCount; 144 | unsigned char buffer[100]; 145 | char stringinput[512]; //将指令转换为字符串后的默认存储位置 146 | 147 | //选择是否保存数据 148 | bool state_1s; 149 | bool state_10s; 150 | bool state_100s; 151 | bool state_1000s; 152 | bool state_10000s; 153 | bool state_86400s; 154 | bool state_300s; 155 | 156 | QString file_path; 157 | 158 | qulonglong measure_counter; 159 | }; 160 | 161 | #endif // WIDGET_H 162 | -------------------------------------------------------------------------------- /Visadll/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | Qt::NonModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 840 13 | 468 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | 24 | 1000000 25 | 1000000 26 | 27 | 28 | 29 | 秒信号测量辅助程序 30 | 31 | 32 | 33 | false 34 | 35 | 36 | 37 | 730 38 | 110 39 | 91 40 | 23 41 | 42 | 43 | 44 | Send_And_Get 45 | 46 | 47 | 48 | 49 | false 50 | 51 | 52 | 53 | 450 54 | 80 55 | 371 56 | 21 57 | 58 | 59 | 60 | 61 | 62 | false 63 | 64 | 65 | 66 | 630 67 | 110 68 | 91 69 | 23 70 | 71 | 72 | 73 | Send_No_Get 74 | 75 | 76 | 77 | 78 | 79 | 450 80 | 60 81 | 71 82 | 16 83 | 84 | 85 | 86 | 测试指令输入 87 | 88 | 89 | 90 | 91 | 92 | 450 93 | 390 94 | 371 95 | 54 96 | 97 | 98 | 99 | 100 | 101 | 102 | false 103 | 104 | 105 | 定时测量 106 | 107 | 108 | 109 | 110 | 111 | 112 | false 113 | 114 | 115 | 测量次数: 116 | 117 | 118 | 119 | 120 | 121 | 122 | false 123 | 124 | 125 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 126 | 127 | 128 | true 129 | 130 | 131 | 132 | 133 | 134 | 135 | false 136 | 137 | 138 | 清零计数器 139 | 140 | 141 | 142 | 143 | 144 | 145 | false 146 | 147 | 148 | 测量时间间隔(ms) 149 | 150 | 151 | 152 | 153 | 154 | 155 | false 156 | 157 | 158 | Qt::LeftToRight 159 | 160 | 161 | 1000 162 | 163 | 164 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 165 | 166 | 167 | true 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | false 176 | 177 | 178 | 179 | 450 180 | 140 181 | 369 182 | 23 183 | 184 | 185 | 186 | 进入时间间隔测模式 187 | 188 | 189 | 190 | 191 | false 192 | 193 | 194 | 195 | 450 196 | 170 197 | 101 198 | 20 199 | 200 | 201 | 202 | CH1门限电压(V) 203 | 204 | 205 | 206 | 207 | false 208 | 209 | 210 | 211 | 640 212 | 170 213 | 101 214 | 20 215 | 216 | 217 | 218 | CH2门限电压(V) 219 | 220 | 221 | 222 | 223 | false 224 | 225 | 226 | 227 | 450 228 | 190 229 | 181 230 | 20 231 | 232 | 233 | 234 | 0 235 | 236 | 237 | 238 | 239 | false 240 | 241 | 242 | 243 | 640 244 | 190 245 | 181 246 | 20 247 | 248 | 249 | 250 | 0 251 | 252 | 253 | 254 | 255 | false 256 | 257 | 258 | 259 | 450 260 | 220 261 | 371 262 | 23 263 | 264 | 265 | 266 | 设置门限电压 267 | 268 | 269 | 270 | 271 | 272 | 450 273 | 310 274 | 371 275 | 62 276 | 277 | 278 | 279 | 280 | 281 | 282 | false 283 | 284 | 285 | 数据(10s) 286 | 287 | 288 | 289 | 290 | 291 | 292 | false 293 | 294 | 295 | 数据(100s) 296 | 297 | 298 | 299 | 300 | 301 | 302 | false 303 | 304 | 305 | 数据(1s) 306 | 307 | 308 | 309 | 310 | 311 | 312 | false 313 | 314 | 315 | 数据(86400s) 316 | 317 | 318 | 319 | 320 | 321 | 322 | false 323 | 324 | 325 | 数据(10000s) 326 | 327 | 328 | 329 | 330 | 331 | 332 | false 333 | 334 | 335 | 数据(1000s) 336 | 337 | 338 | 339 | 340 | 341 | 342 | false 343 | 344 | 345 | 数据(300s) 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | false 354 | 355 | 356 | 357 | 750 358 | 280 359 | 71 360 | 23 361 | 362 | 363 | 364 | 选择路径 365 | 366 | 367 | 368 | 369 | false 370 | 371 | 372 | 373 | 450 374 | 280 375 | 291 376 | 20 377 | 378 | 379 | 380 | 381 | 382 | false 383 | 384 | 385 | 386 | 450 387 | 250 388 | 371 389 | 23 390 | 391 | 392 | 393 | 单次测量 394 | 395 | 396 | 397 | 398 | 399 | 20 400 | 10 401 | 421 402 | 391 403 | 404 | 405 | 406 | 4 407 | 408 | 409 | 410 | 设备列表 411 | 412 | 413 | 414 | 415 | 10 416 | 10 417 | 391 418 | 341 419 | 420 | 421 | 422 | 423 | 424 | 425 | 数据监控 426 | 427 | 428 | 429 | true 430 | 431 | 432 | 433 | 10 434 | 10 435 | 391 436 | 341 437 | 438 | 439 | 440 | true 441 | 442 | 443 | 444 | 445 | 446 | 生成剔除文件 447 | 448 | 449 | 450 | 451 | 20 452 | 170 453 | 371 454 | 191 455 | 456 | 457 | 458 | 459 | 460 | 461 | 20 462 | 80 463 | 160 464 | 80 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 190 477 | 95 478 | 31 479 | 41 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 210 490 | 80 491 | 160 492 | 80 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 20 505 | 10 506 | 379 507 | 80 508 | 509 | 510 | 511 | 512 | 513 | 514 | 请选择生成日期及类型并点击生成: 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 每1s数据 523 | 524 | 525 | 526 | 527 | 每10s数据 528 | 529 | 530 | 531 | 532 | 每100s数据 533 | 534 | 535 | 536 | 537 | 每300s数据 538 | 539 | 540 | 541 | 542 | 每1000s数据 543 | 544 | 545 | 546 | 547 | 每10000s数据 548 | 549 | 550 | 551 | 552 | 每86400s数据 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 生成文件 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 数据剔除 570 | 571 | 572 | 573 | 574 | 20 575 | 60 576 | 371 577 | 301 578 | 579 | 580 | 581 | 582 | 583 | 584 | 20 585 | 10 586 | 371 587 | 51 588 | 589 | 590 | 591 | 592 | 593 | 594 | 剔除数据类型: 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 每1s数据 603 | 604 | 605 | 606 | 607 | 每10s数据 608 | 609 | 610 | 611 | 612 | 每100s数据 613 | 614 | 615 | 616 | 617 | 每300s数据 618 | 619 | 620 | 621 | 622 | 每1000s数据 623 | 624 | 625 | 626 | 627 | 每10000s数据 628 | 629 | 630 | 631 | 632 | 每86400s数据 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 剔除 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 性能评定 650 | 651 | 652 | 653 | 654 | 20 655 | 60 656 | 371 657 | 301 658 | 659 | 660 | 661 | 662 | 663 | 664 | 20 665 | 10 666 | 371 667 | 51 668 | 669 | 670 | 671 | 672 | 673 | 674 | 评定数据类型: 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 每1s数据 683 | 684 | 685 | 686 | 687 | 每10s数据 688 | 689 | 690 | 691 | 692 | 每100s数据 693 | 694 | 695 | 696 | 697 | 每300s数据 698 | 699 | 700 | 701 | 702 | 每1000s数据 703 | 704 | 705 | 706 | 707 | 每10000s数据 708 | 709 | 710 | 711 | 712 | 每86400s数据 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 评定 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 450 732 | 30 733 | 271 734 | 22 735 | 736 | 737 | 738 | 739 | 740 | 741 | 730 742 | 30 743 | 91 744 | 23 745 | 746 | 747 | 748 | Search Device 749 | 750 | 751 | 752 | 753 | 754 | 20 755 | 410 756 | 75 757 | 23 758 | 759 | 760 | 761 | 关于 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | -------------------------------------------------------------------------------- /Visadll/widget_cmd.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | #include 5 | 6 | //发送指令不回读 7 | void Widget::on_bt_SendCMD_clicked() 8 | { 9 | int iCmdLeng; 10 | iCmdLeng=ui->lineEdit_Cmd->text().length(); 11 | if(iCmdLeng==0) 12 | { 13 | QMessageBox::warning(this,tr("Warning!"),tr("Please enter you Command!"),QMessageBox::Ok); 14 | } 15 | else 16 | { 17 | Send_No_Get(ui->lineEdit_Cmd->text()); 18 | } 19 | } 20 | 21 | //发送指令且回读 22 | void Widget::on_bt_SendCMD_Get_clicked() 23 | { 24 | int iCmdLeng; 25 | 26 | iCmdLeng=ui->lineEdit_Cmd->text().length(); 27 | 28 | if(iCmdLeng==0) 29 | { 30 | QMessageBox::warning(this,tr("Warning!"),tr("Please enter you Command!"),QMessageBox::Ok); 31 | return; 32 | } 33 | 34 | QString receive = Send_And_Get(ui->lineEdit_Cmd->text()); 35 | 36 | ui->textEdit_Receive->append(receive); //清空文本框 37 | } 38 | 39 | //发送门限电压设置指令 40 | void Widget::on_Voltage_Set_clicked() 41 | { 42 | double vol1 = ui->Voltage1->text().toDouble(); 43 | QString volinput1 = "INPut1:LEVel:ABSolute " + QString::number(vol1,10,2); 44 | Send_No_Get(volinput1); 45 | volinput1.clear(); 46 | 47 | double vol2 = ui->Voltage2->text().toDouble(); 48 | QString volinput2 = "INPut2:LEVel:ABSolute " + QString::number(vol2,10,2); 49 | Send_No_Get(volinput2); 50 | volinput2.clear(); 51 | 52 | //单次测量按钮使能 53 | ui->Time_Interval->setEnabled(true); 54 | 55 | //定时测量使能 56 | ui->Timer_button->setEnabled(true); 57 | ui->set_timer->setEnabled(true); 58 | ui->label_timer->setEnabled(true); 59 | 60 | //路径选择使能 61 | ui->lineEdit_filepath->setEnabled(true); 62 | ui->filepath->setEnabled(true); 63 | 64 | //定时保持按钮使能 65 | ui->checkBox_86400s->setEnabled(true); 66 | ui->checkBox_10000s->setEnabled(true); 67 | ui->checkBox_1000s->setEnabled(true); 68 | ui->checkBox_100s->setEnabled(true); 69 | ui->checkBox_10s->setEnabled(true); 70 | ui->checkBox_1s->setEnabled(true); 71 | ui->checkBox_300s->setEnabled(true); 72 | 73 | //测量计数器使能 74 | ui->clear_counter->setEnabled(true); 75 | ui->lineEdit_counter->setEnabled(true); 76 | ui->label_counter->setEnabled(true); 77 | } 78 | 79 | //进入时间间隔测量模式 80 | void Widget::on_CMD_TINTerval_clicked() 81 | { 82 | //单次测量按钮失能 83 | ui->Time_Interval->setEnabled(false); 84 | 85 | //定时测量失能 86 | ui->Timer_button->setEnabled(false); 87 | ui->set_timer->setEnabled(false); 88 | ui->label_timer->setEnabled(false); 89 | 90 | //停止定时测量 91 | Timer_Stop(); 92 | 93 | //路径选择失能 94 | ui->lineEdit_filepath->setEnabled(false); 95 | ui->filepath->setEnabled(false); 96 | 97 | //定时保持按钮失能 98 | ui->checkBox_86400s->setEnabled(false); 99 | ui->checkBox_10000s->setEnabled(false); 100 | ui->checkBox_1000s->setEnabled(false); 101 | ui->checkBox_100s->setEnabled(false); 102 | ui->checkBox_10s->setEnabled(false); 103 | ui->checkBox_1s->setEnabled(false); 104 | ui->checkBox_300s->setEnabled(false); 105 | 106 | //测量计数器失能 107 | ui->clear_counter->setEnabled(false); 108 | ui->lineEdit_counter->setEnabled(false); 109 | ui->label_counter->setEnabled(false); 110 | 111 | //计数器清零 112 | measure_counter = 0; 113 | 114 | QString cmd2 = "SYSTem:TIMeout 2"; //设置测量时间间隔为2s(由于信号1s才出现一次,再加上测量时间,1s的超时时间很容易导致超时) 115 | Send_No_Get(cmd2); 116 | cmd2.clear(); 117 | 118 | QString cmd = "CONFigure:SCALar:VOLTage:TINTerval (@1),(@2)"; 119 | Send_No_Get(cmd); 120 | cmd.clear(); 121 | 122 | //使能电压门限,失能时间间隔测量 123 | 124 | //电压门限设置窗口使能 125 | ui->Voltage1->setEnabled(true); 126 | ui->Voltage2->setEnabled(true); 127 | ui->Voltage_Set->setEnabled(true); 128 | ui->label_Gate1->setEnabled(true); 129 | ui->label_Gate2->setEnabled(true); 130 | } 131 | 132 | //单次测量 133 | void Widget::on_Time_Interval_clicked() 134 | { 135 | ui->Time_Interval->setEnabled(false); 136 | 137 | double time = Get_Number("READ?"); 138 | QString str = QString("time interval: %1").arg(time, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 139 | ui->textEdit_Receive->append(str); //.arg(retCount)的作用是格式化输出,意思在%1的地方输出retCount 140 | str.clear(); 141 | 142 | ui->Time_Interval->setEnabled(true); 143 | } 144 | 145 | //定时测量 146 | void Widget::Timing1() 147 | { 148 | double time = Continue_Get_Number("READ?"); 149 | 150 | if(time>0.0 && time<1) //只接受1ms~1s之间的值 151 | { 152 | QString str = QString("time interval: %1").arg(time, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 153 | ui->textEdit_Receive->append(str); //.arg(retCount)的作用是格式化输出,意思在%1的地方输出retCount 154 | } 155 | else 156 | { 157 | ui->textEdit_Receive->append("测量错误!"); //.arg(retCount)的作用是格式化输出,意思在%1的地方输出retCount 158 | time = -1; 159 | } 160 | 161 | //测量计数器累加 162 | measure_counter++; 163 | 164 | //显示measure_counter变量值 165 | QString str1; 166 | str1.setNum(measure_counter); 167 | ui->lineEdit_counter->setText(str1); 168 | 169 | //存储数据 170 | if(state_1s) 171 | { 172 | Record_Data1(time); 173 | } 174 | 175 | if(state_10s) 176 | { 177 | if(measure_counter % 10 == 0) 178 | Record_Data10(time); 179 | } 180 | 181 | if(state_100s) 182 | { 183 | if(measure_counter % 100 == 0) 184 | Record_Data100(time); 185 | } 186 | 187 | if(state_1000s) 188 | { 189 | if(measure_counter % 1000 == 0) 190 | Record_Data1000(time); 191 | } 192 | 193 | if(state_10000s) 194 | { 195 | if(measure_counter % 10000 == 0) 196 | Record_Data10000(time); 197 | } 198 | 199 | if(state_86400s) 200 | { 201 | if(measure_counter % 86400 == 0) 202 | Record_Data86400(time); 203 | } 204 | if(state_300s) 205 | { 206 | if(measure_counter % 300 == 0) 207 | Record_Data300(time); 208 | } 209 | } 210 | 211 | //清零测量次数统计 212 | void Widget::on_clear_counter_clicked() 213 | { 214 | measure_counter = 0; 215 | 216 | QString str1; 217 | str1.setNum(measure_counter); 218 | ui->lineEdit_counter->setText(str1); 219 | } 220 | 221 | //剔除错误数据按钮按下 222 | void Widget::on_tichu_button_clicked() 223 | { 224 | QString srcFile="sample"; 225 | 226 | ui->tichu_text3->clear(); 227 | ui->tichu_text3->append("剔除每"+QString::number(dataType)+"秒的数据\n"); 228 | tichu(srcFile,"test1",dataType); 229 | tichu("test1","test2",dataType); 230 | tichu("test2","test3",dataType); 231 | ui->tichu_text3->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); 232 | } 233 | 234 | //剔除类型选择 235 | void Widget::on_comboBox_2_currentIndexChanged(int index) 236 | { 237 | switch (index) { 238 | case 0: 239 | dataType = 1; 240 | break; 241 | case 1: 242 | dataType = 10; 243 | break; 244 | case 2: 245 | dataType = 100; 246 | break; 247 | case 3: 248 | dataType = 300; 249 | break; 250 | case 4: 251 | dataType = 1000; 252 | break; 253 | case 5: 254 | dataType = 10000; 255 | break; 256 | case 6: 257 | dataType = 86400; 258 | break; 259 | default: 260 | break; 261 | } 262 | } 263 | 264 | //剔除错误数据操作函数 265 | void Widget::tichu(QString srcFile,QString trgFile,int dataType ) 266 | { 267 | double initialData=0; 268 | int dataNumber=0;//数据总数 269 | double standardError=0;//标准偏差 270 | double average=0;//平均 271 | static int tichuNum=0;//剔除操作执行次数 272 | 273 | 274 | ui->tichu_text3->append("__________________________________________\n"); 275 | ui->tichu_text3->append("第"+QString::number(tichuNum+1)+"次剔除:\n"); 276 | tichuNum += 1; 277 | tichuNum = tichuNum%3 ; 278 | 279 | QFile file(file_path+"/"+"sample/"+srcFile+"-"+QString::number(dataType)+".txt"); 280 | if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { 281 | qDebug()<<"Can't open the file!"<tichu_text3->append("打不开文件或文件不存在:"+file_path+"/"+"sample/"+srcFile+"-"+QString::number(dataType)+".txt"); 283 | return; 284 | } 285 | //清空原有数据 286 | QFile file2(file_path+"/"+"sample/"+trgFile+"-"+QString::number(dataType)+".txt"); 287 | if(!file2.open(QIODevice::WriteOnly | QIODevice::Text)) { 288 | qDebug()<<"Can't open the file1!"<tichu_text3->append("数据总数:"+QString::number(dataNumber,'g',16)); 308 | 309 | //求平均值 310 | in.seek(0); 311 | while(!in.atEnd()){ 312 | QString line = in.readLine(); 313 | double x; 314 | initialData = line.toDouble(); /*读入字符转转换成double型数值*/ 315 | x = initialData/dataNumber; 316 | average +=x; 317 | } 318 | ui->tichu_text3->append("平均:\n"+QString::number(average,'g',16)); 319 | 320 | //求实验标准偏差 321 | in.seek(0);//将当前读取文件指针移动到文件开始 322 | while(!in.atEnd()){ 323 | QString line = in.readLine(); 324 | double x; 325 | initialData = line.toDouble(); /*读入字符转转换成double型数值*/ 326 | x=pow((initialData-average),2); 327 | x= x/(dataNumber-1); 328 | standardError +=x; 329 | } 330 | standardError = sqrt(standardError); 331 | ui->tichu_text3->append("标准偏差:\n"+QString::number(standardError,'g',16)); 332 | 333 | //判别 334 | in.seek(0);//将当前读取文件指针移动到文件开始 335 | while(!in.atEnd()){ 336 | QString line = in.readLine(); 337 | double x; 338 | initialData = line.toDouble(); /*读入字符转转换成double型数值*/ 339 | x=qAbs((initialData-average)); 340 | if(x<=(3*standardError)){ 341 | in_1<tichu_text3->append("剔除 "+QString::number(initialData,'g',16)); 345 | } 346 | } 347 | 348 | //看剔除后总数 349 | dataNumber = 0; 350 | in_1.seek(0); 351 | while(!in_1.atEnd()){ 352 | QString line; 353 | line = in_1.readLine(); 354 | dataNumber += 1; 355 | } 356 | ui->tichu_text3->append("剔除后数据总数:\n"+QString::number(dataNumber,'g',16)); 357 | 358 | //关闭文件 359 | file.close(); 360 | file_1.close(); 361 | 362 | 363 | } 364 | 365 | //性能评定数据按钮按下 366 | void Widget::on_pushButton_clicked() 367 | { 368 | ui->performanceEvaluateOutput->clear(); 369 | ui->performanceEvaluateOutput->append("评定每"+QString::number(dataType)+"秒测量数据的性能\n"); 370 | performanceEvaluation(dataType,"test3"); 371 | } 372 | 373 | //性能评定类型选择 374 | void Widget::on_comboBox_3_currentIndexChanged(int index) 375 | { 376 | switch (index) { 377 | case 0: 378 | dataType = 1; 379 | break; 380 | case 1: 381 | dataType = 10; 382 | break; 383 | case 2: 384 | dataType = 100; 385 | break; 386 | case 3: 387 | dataType = 300; 388 | break; 389 | case 4: 390 | dataType = 1000; 391 | break; 392 | case 5: 393 | dataType = 10000; 394 | break; 395 | case 6: 396 | dataType = 86400; 397 | break; 398 | default: 399 | break; 400 | } 401 | } 402 | 403 | //性能评定操作函数 404 | void Widget::performanceEvaluation(int dataType, QString srcFile) 405 | { 406 | double initialData[2];//用来求取频率偏差的数组 407 | double initialData2[4]; 408 | int index=0;//initialData索引 409 | int index2=0;//initialData2索引 410 | double frequencyStability =0;//频率稳定度 411 | double frequencyDeparture =0;//频率偏差 412 | int dataNumber=0; 413 | int i;//各种for中的索引 414 | QString line1;//文本流,定义在这里有特别用处 415 | //打开源文件定义文本流 416 | QFile file(file_path+"/"+"sample/"+srcFile+"-"+QString::number(dataType)+".txt"); 417 | if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { 418 | qDebug()<<"Can't open the file!"<performanceEvaluateOutput->append("打不开文件或文件不存在:"+file_path+"/"+"sample/"+srcFile+"-"+QString::number(dataType)+".txt"); 420 | return; 421 | } 422 | QTextStream in(&file); 423 | 424 | //头文本 425 | ui->performanceEvaluateOutput->append("__________________________________________\n"); 426 | 427 | //求数据总数 428 | in.seek(0); 429 | while(!in.atEnd()){ 430 | QString line; 431 | line = in.readLine(); 432 | dataNumber += 1; 433 | } 434 | ui->performanceEvaluateOutput->append("数据总数:"+QString::number(dataNumber,'g',16)); 435 | //计算相对频率偏差y=(x1-x2)/d_t 436 | in.seek(0); 437 | line1 = in.readLine(); 438 | initialData[index] = line1.toDouble(); /*读入字符转转换成double型数值*/ 439 | index = !index; 440 | frequencyDeparture = 0; 441 | while(!in.atEnd()){ 442 | double x; 443 | line1 = in.readLine(); 444 | initialData[index] = line1.toDouble(); 445 | index = !index; 446 | x = qAbs(initialData[!index]-initialData[index]); 447 | x = x/dataType; 448 | frequencyDeparture += x/(dataNumber-1); 449 | // ui->performanceEvaluateOutput->append(QString::number(x,'g',16)); 450 | } 451 | ui->performanceEvaluateOutput->append("相对平均频率偏差:\n"+QString::number(frequencyDeparture,'g',16)); 452 | 453 | //计算频率稳定度 454 | in.seek(0); 455 | for(i=0;i<3;i++){ 456 | line1 = in.readLine(); 457 | initialData2[i] = line1.toDouble(); 458 | } 459 | frequencyStability = 0; 460 | while(!in.atEnd()){ 461 | double x; 462 | line1 = in.readLine(); 463 | initialData2[3] = line1.toDouble(); 464 | x=initialData2[3]-(3*initialData2[2])+(3*initialData2[1])-initialData2[0]; 465 | x = pow(x,2); 466 | x = x*(1/(6*pow(dataType,2)*(dataNumber-3))); 467 | frequencyStability +=x; 468 | for(index2=0;index2<3;index2++){ 469 | initialData2[index2] = initialData2[index2+1]; 470 | } 471 | // ui->performanceEvaluateOutput->append(" "+QString::number(x,'g',16)); 472 | } 473 | frequencyStability = sqrt(frequencyStability); 474 | ui->performanceEvaluateOutput->append("频率稳定度:\n"+QString::number(frequencyStability,'g',16)); 475 | 476 | file.close(); 477 | 478 | } 479 | 480 | 481 | //选择生成性能评定文件的类型 482 | void Widget::on_comboBox_4_currentIndexChanged(int index) 483 | { 484 | switch (index) { 485 | case 0: 486 | dataType = 1; 487 | break; 488 | case 1: 489 | dataType = 10; 490 | break; 491 | case 2: 492 | dataType = 100; 493 | break; 494 | case 3: 495 | dataType = 300; 496 | break; 497 | case 4: 498 | dataType = 1000; 499 | break; 500 | case 5: 501 | dataType = 10000; 502 | break; 503 | case 6: 504 | dataType = 86400; 505 | break; 506 | default: 507 | break; 508 | } 509 | 510 | } 511 | 512 | //改变改变起始和结束日期 513 | void Widget::on_BeginDate_dateChanged(const QDate &date) 514 | { 515 | BeginDate = date; 516 | 517 | } 518 | 519 | void Widget::on_EndDate_dateChanged(const QDate &date) 520 | { 521 | EndDate = date; 522 | 523 | } 524 | //"生成文件"按钮按下 525 | void Widget::on_pushButton_2_clicked() 526 | { 527 | 528 | 529 | QString beginDate = BeginDate.toString("yyyy-MM-dd"); 530 | QString endDate = EndDate.toString("yyyy-MM-dd"); 531 | QDate myDate=BeginDate;//循环变量 532 | 533 | //生成样本文件夹 534 | QDir *temp = new QDir; 535 | bool exist = temp->exists(file_path+"/sample"); 536 | if(exist) 537 | ui->samlpe_edit->append("文件夹已经存在!"); 538 | else 539 | { 540 | bool ok = temp->mkdir(file_path+"/sample"); 541 | if( ok ) 542 | ui->samlpe_edit->append("文件夹创建成功!"); 543 | } 544 | delete temp; 545 | ui->samlpe_edit->append("抽取从"+beginDate+"到"+endDate+"每"+QString::number(dataType)+"秒"+"的数据"); 546 | 547 | //清空原有数据 548 | QFile file2(file_path+"/"+"sample/"+"sample-"+QString::number(dataType)+".txt"); 549 | if(!file2.open(QIODevice::WriteOnly | QIODevice::Text)) { 550 | qDebug()<<"Can't open the file1!"<samlpe_edit->append("打不开文件或文件不存在:"+srcFile); 563 | } 564 | QTextStream in(&file); 565 | 566 | QFile file1(file_path+"/"+"sample/"+"sample-"+QString::number(dataType)+".txt"); 567 | if(!file1.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) { 568 | qDebug()<<"Can't open the file1!"<samlpe_edit->append("文件生成完毕"); 581 | 582 | 583 | 584 | } 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | -------------------------------------------------------------------------------- /Visadll/widget_measure.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | //发送指令读取回参 5 | QString Widget::Send_And_Get(QString cmd) 6 | { 7 | QString returndata = "ERROR"; 8 | 9 | status = viOpenDefaultRM (&defaultRM); //返回与默认资源管理器的通话 10 | if (status < VI_SUCCESS) 11 | { 12 | //失败处理 13 | QMessageBox::information(this,tr("Information"),tr("Could no open a session to the VISA Resource!"),QMessageBox::Ok); 14 | return returndata; 15 | } 16 | 17 | //获取设备名称 18 | QByteArray ba=ui->comboBox->currentText().toLatin1(); 19 | ViRsrc DevName=ba.data(); 20 | 21 | //打开设备端口 22 | status = viOpen (defaultRM, DevName, VI_NULL, VI_NULL, &instr); 23 | if (status < VI_SUCCESS) 24 | { 25 | QMessageBox::information(this,tr("Information"),tr("Cannot open a session to the device."),QMessageBox::Ok); 26 | } 27 | 28 | /* 设置连接超时时间为5s Set timeout value to 5000 milliseconds (5 seconds).*/ 29 | status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000); //设置资源属性状态值。 30 | 31 | //定义指令 32 | QByteArray baCmd = cmd.toLatin1(); 33 | 34 | int iCmdLeng = baCmd.length(); //获取指令长度 35 | if(iCmdLeng==0) 36 | { 37 | QMessageBox::warning(this,tr("Warning!"),tr("CMD Error!"),QMessageBox::Ok); 38 | return returndata; 39 | } 40 | 41 | //指令拷贝进入char型数组 42 | for(int i=0;i<=iCmdLeng;i++) 43 | { 44 | stringinput[i]=baCmd[i]; 45 | if(i==iCmdLeng) 46 | stringinput[i]='\0'; 47 | } 48 | 49 | //指令写入 50 | status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount); 51 | if (status < VI_SUCCESS) 52 | { 53 | //写入失败处理 54 | QMessageBox::information(this,tr("Information"),tr("Error writing to the device."),QMessageBox::Ok); 55 | } 56 | 57 | //读取数据 58 | status = viRead (instr, buffer, 100, &retCount); 59 | if (status < VI_SUCCESS) 60 | { 61 | //读取失败处理 62 | QMessageBox::information(this,tr("Information"),tr("Error reading a response from the device."),QMessageBox::Ok); 63 | } 64 | else 65 | { 66 | returndata=(char*)buffer; 67 | } 68 | 69 | viClose(instr); //关闭同设备的连接 70 | viClose(defaultRM); //关闭与默认资源管理器的通话 71 | 72 | return returndata; 73 | 74 | } 75 | 76 | //发送指令不读取回参 77 | void Widget::Send_No_Get(QString cmd) 78 | { 79 | status=viOpenDefaultRM (&defaultRM); //返回与默认资源管理器的通话 80 | if (status < VI_SUCCESS) 81 | { 82 | //失败处理 83 | QMessageBox::information(this,tr("Information"),tr("Could no open a session to the VISA Resource!"),QMessageBox::Ok); 84 | return ; 85 | } 86 | 87 | //获取设备名称 88 | QByteArray ba=ui->comboBox->currentText().toLatin1(); 89 | ViRsrc DevName=ba.data(); 90 | 91 | //打开设备端口 92 | status = viOpen (defaultRM, DevName, VI_NULL, VI_NULL, &instr); 93 | if (status < VI_SUCCESS) 94 | { 95 | QMessageBox::information(this,tr("Information"),tr("Cannot open a session to the device."),QMessageBox::Ok); 96 | } 97 | 98 | /* 设置连接超时时间为5s Set timeout value to 5000 milliseconds (5 seconds).*/ 99 | status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000); //设置资源属性状态值。 100 | 101 | //定义指令 102 | QByteArray baCmd = cmd.toLatin1(); 103 | 104 | int iCmdLeng = baCmd.length(); //获取指令长度 105 | if(iCmdLeng==0) 106 | { 107 | QMessageBox::warning(this,tr("Warning!"),tr("CMD Error!"),QMessageBox::Ok); 108 | return ; 109 | } 110 | 111 | //指令拷贝进入char型数组 112 | for(int i=0;i<=iCmdLeng;i++) 113 | { 114 | stringinput[i]=baCmd[i]; 115 | if(i==iCmdLeng) 116 | stringinput[i]='\0'; 117 | } 118 | 119 | //指令写入 120 | status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount); 121 | if (status < VI_SUCCESS) 122 | { 123 | //写入失败处理 124 | QMessageBox::information(this,tr("Information"),tr("Error writing to the device."),QMessageBox::Ok); 125 | } 126 | 127 | ui->textEdit_Receive->append("指令发送成功!"); 128 | 129 | viClose(instr); //关闭同设备的连接 130 | viClose(defaultRM); //关闭与默认资源管理器的通话 131 | } 132 | 133 | 134 | //获取一个数据 135 | double Widget::Get_Number(QString cmd) 136 | { 137 | double number = 0; 138 | 139 | status=viOpenDefaultRM (&defaultRM); //返回与默认资源管理器的通话 140 | if (status < VI_SUCCESS) 141 | { 142 | //失败处理 143 | QMessageBox::information(this,tr("Information"),tr("Could no open a session to the VISA Resource!"),QMessageBox::Ok); 144 | return -1; 145 | } 146 | 147 | //获取设备名称 148 | QByteArray ba=ui->comboBox->currentText().toLatin1(); 149 | ViRsrc DevName=ba.data(); 150 | 151 | //打开设备端口 152 | status = viOpen (defaultRM, DevName, VI_NULL, VI_NULL, &instr); 153 | if (status < VI_SUCCESS) 154 | { 155 | QMessageBox::information(this,tr("Information"),tr("Cannot open a session to the device."),QMessageBox::Ok); 156 | } 157 | 158 | /* 设置连接超时时间为5s Set timeout value to 5000 milliseconds (5 seconds).*/ 159 | status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000); //设置资源属性状态值 160 | 161 | //定义指令 162 | QByteArray baCmd = cmd.toLatin1(); 163 | 164 | int iCmdLeng = baCmd.length(); //获取指令长度 165 | 166 | //指令拷贝进入char型数组 167 | for(int i=0;i<=iCmdLeng;i++) 168 | { 169 | stringinput[i]=baCmd[i]; 170 | if(i==iCmdLeng) 171 | stringinput[i]='\0'; 172 | } 173 | 174 | //指令写入 175 | status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount); 176 | if (status < VI_SUCCESS) 177 | { 178 | //写入失败处理 179 | QMessageBox::information(this,tr("Information"),tr("Error writing to the device."),QMessageBox::Ok); 180 | } 181 | 182 | //读取数据 183 | 184 | //buffer清零 185 | for(int i=0;i<100;i++) 186 | { 187 | buffer[i]=0; 188 | } 189 | 190 | status = viRead (instr, buffer, 100, &retCount); 191 | if (status < VI_SUCCESS) 192 | { 193 | //读取失败处理 194 | QMessageBox::information(this,tr("Information"),tr("Error reading a response from the device."),QMessageBox::Ok); 195 | } 196 | else 197 | { 198 | QString strbuffer = (char*)buffer; 199 | number = strbuffer.toDouble(); 200 | } 201 | 202 | viClose(instr); //关闭同设备的连接 203 | viClose(defaultRM); //关闭与默认资源管理器的通话 204 | 205 | return number; 206 | } 207 | 208 | 209 | 210 | void Widget::Continue_Start() 211 | { 212 | status=viOpenDefaultRM (&defaultRM); //返回与默认资源管理器的通话 213 | if (status < VI_SUCCESS) 214 | { 215 | //失败处理 216 | QMessageBox::information(this,tr("Information"),tr("Could no open a session to the VISA Resource!"),QMessageBox::Ok); 217 | return; 218 | } 219 | 220 | //获取设备名称 221 | QByteArray ba=ui->comboBox->currentText().toLatin1(); 222 | ViRsrc DevName=ba.data(); 223 | 224 | //打开设备端口 225 | status = viOpen (defaultRM, DevName, VI_NULL, VI_NULL, &instr); 226 | if (status < VI_SUCCESS) 227 | { 228 | QMessageBox::information(this,tr("Information"),tr("Cannot open a session to the device."),QMessageBox::Ok); 229 | } 230 | 231 | /* 设置连接超时时间为5s Set timeout value to 5000 milliseconds (5 seconds).*/ 232 | status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000); //设置资源属性状态值 233 | } 234 | 235 | void Widget::Continue_Stop() 236 | { 237 | viClose(instr); //关闭同设备的连接 238 | viClose(defaultRM); //关闭与默认资源管理器的通话 239 | } 240 | 241 | 242 | //连续获取数据 243 | double Widget::Continue_Get_Number(QString cmd) 244 | { 245 | double number = 0; 246 | 247 | //定义指令 248 | QByteArray baCmd = cmd.toLatin1(); 249 | 250 | int iCmdLeng = baCmd.length(); //获取指令长度 251 | 252 | //指令拷贝进入char型数组 253 | for(int i=0;i<=iCmdLeng;i++) 254 | { 255 | stringinput[i]=baCmd[i]; 256 | if(i==iCmdLeng) 257 | stringinput[i]='\0'; 258 | } 259 | 260 | //指令写入 261 | status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount); 262 | if (status < VI_SUCCESS) 263 | { 264 | //写入失败处理 265 | QMessageBox::information(this,tr("Information"),tr("Error writing to the device."),QMessageBox::Ok); 266 | } 267 | 268 | //读取数据 269 | 270 | //buffer清零 271 | for(int i=0;i<100;i++) 272 | { 273 | buffer[i]=0; 274 | } 275 | 276 | status = viRead (instr, buffer, 100, &retCount); 277 | if (status < VI_SUCCESS) 278 | { 279 | //读取失败处理 280 | QMessageBox::information(this,tr("Information"),tr("Error reading a response from the device."),QMessageBox::Ok); 281 | } 282 | else 283 | { 284 | QString strbuffer = (char*)buffer; 285 | number = strbuffer.toDouble(); 286 | } 287 | 288 | 289 | 290 | return number; 291 | } 292 | 293 | 294 | 295 | 296 | 297 | -------------------------------------------------------------------------------- /Visadll/widget_timer_recorder.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | //启动定时定时器 5 | void Widget::Timer_Start(int ms) 6 | { 7 | connect(&timer1,SIGNAL(timeout()), this, SLOT(Timing1())); //定时器槽函数连接 8 | timer1.start(ms); //1s 9 | } 10 | 11 | //停止定时器 12 | void Widget::Timer_Stop() 13 | { 14 | if(timer1.isActive()) 15 | { 16 | timer1.stop(); 17 | disconnect(&timer1,SIGNAL(timeout()), this, SLOT(Timing1())); 18 | } 19 | } 20 | 21 | //开始定时测量按钮 22 | MeasureThread Mythread; 23 | void Widget::on_Timer_button_clicked() 24 | { 25 | if(ui->Timer_button->text() == "定时测量") 26 | { 27 | Continue_Start(); 28 | Mythread.start(); 29 | 30 | ui->Timer_button->setText("停止"); 31 | } 32 | else 33 | { 34 | Mythread.mystop(); 35 | Continue_Stop(); 36 | ui->Timer_button->setText("定时测量"); 37 | } 38 | } 39 | 40 | void Widget::on_filepath_clicked() 41 | { 42 | QString file_path_tmp = QFileDialog::getExistingDirectory(this,"请选择数据保存文件夹","./"); 43 | if(file_path_tmp.isEmpty()) 44 | { 45 | return; 46 | } 47 | else 48 | { 49 | file_path = file_path_tmp; 50 | ui->lineEdit_filepath->setText(file_path); 51 | } 52 | } 53 | 54 | void Widget::Record_Data1(double s) 55 | { 56 | //获取当前时间 57 | QDateTime da_time; 58 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 59 | QString tmp = time_str.left(10); 60 | 61 | //建立、打开文件 62 | QString fileName = file_path + "/" + tmp + "-1.txt"; 63 | QFile file(fileName); 64 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 65 | { 66 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 67 | } 68 | 69 | QTextStream in(&file); 70 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 71 | in << str + "\n"; 72 | 73 | file.close(); 74 | } 75 | 76 | void Widget::Record_Data10(double s) 77 | { 78 | //获取当前时间 79 | QDateTime da_time; 80 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 81 | QString tmp = time_str.left(10); 82 | 83 | //建立、打开文件 84 | QString fileName = file_path + "/" + tmp + "-10.txt"; 85 | QFile file(fileName); 86 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 87 | { 88 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 89 | } 90 | 91 | QTextStream in(&file); 92 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 93 | in << str + "\n"; 94 | 95 | file.close(); 96 | } 97 | 98 | void Widget::Record_Data100(double s) 99 | { 100 | //获取当前时间 101 | QDateTime da_time; 102 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 103 | QString tmp = time_str.left(10); 104 | 105 | //建立、打开文件 106 | QString fileName = file_path + "/" + tmp + "-100.txt"; 107 | QFile file(fileName); 108 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 109 | { 110 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 111 | } 112 | 113 | QTextStream in(&file); 114 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 115 | in << str + "\n"; 116 | 117 | file.close(); 118 | } 119 | 120 | void Widget::Record_Data1000(double s) 121 | { 122 | //获取当前时间 123 | QDateTime da_time; 124 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 125 | QString tmp = time_str.left(10); 126 | 127 | //建立、打开文件 128 | QString fileName = file_path + "/" + tmp + "-1000.txt"; 129 | QFile file(fileName); 130 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 131 | { 132 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 133 | } 134 | 135 | QTextStream in(&file); 136 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 137 | in << str + "\n"; 138 | 139 | file.close(); 140 | } 141 | 142 | void Widget::Record_Data10000(double s) 143 | { 144 | //获取当前时间 145 | QDateTime da_time; 146 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 147 | QString tmp = time_str.left(10); 148 | 149 | //建立、打开文件 150 | QString fileName = file_path + "/" + tmp + "-10000.txt"; 151 | QFile file(fileName); 152 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 153 | { 154 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 155 | } 156 | 157 | QTextStream in(&file); 158 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 159 | in << str + "\n"; 160 | 161 | file.close(); 162 | } 163 | 164 | void Widget::Record_Data86400(double s) 165 | { 166 | QDateTime da_time; 167 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 168 | QString tmp = time_str.left(10); 169 | 170 | //建立、打开文件 171 | QString fileName = file_path + "/" + tmp + "-86400.txt"; 172 | QFile file(fileName); 173 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 174 | { 175 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 176 | } 177 | 178 | QTextStream in(&file); 179 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 180 | in << str + "\n"; 181 | 182 | file.close(); 183 | } 184 | 185 | void Widget::Record_Data300(double s) 186 | { 187 | //获取当前时间 188 | QDateTime da_time; 189 | QString time_str = da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 190 | QString tmp = time_str.left(10); 191 | 192 | //建立、打开文件 193 | QString fileName = file_path + "/" + tmp + "-300.txt"; 194 | QFile file(fileName); 195 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) //打开文件 196 | { 197 | QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 198 | } 199 | 200 | QTextStream in(&file); 201 | QString str = QString("%1").arg(s, 0,'r',16); //最大能够达到16位精度(返回数据的精度是16位) 202 | in << str + "\n"; 203 | 204 | file.close(); 205 | } 206 | 207 | void Widget::on_checkBox_1s_stateChanged(int arg1) 208 | { 209 | state_1s = arg1; 210 | } 211 | 212 | void Widget::on_checkBox_10s_stateChanged(int arg1) 213 | { 214 | state_10s = arg1; 215 | } 216 | 217 | void Widget::on_checkBox_100s_stateChanged(int arg1) 218 | { 219 | state_100s = arg1; 220 | } 221 | 222 | void Widget::on_checkBox_1000s_stateChanged(int arg1) 223 | { 224 | state_1000s = arg1; 225 | } 226 | 227 | void Widget::on_checkBox_10000s_stateChanged(int arg1) 228 | { 229 | state_10000s = arg1; 230 | } 231 | 232 | void Widget::on_checkBox_86400s_stateChanged(int arg1) 233 | { 234 | state_86400s = arg1; 235 | } 236 | 237 | void Widget::on_checkBox_300s_stateChanged(int arg1) 238 | { 239 | state_300s = arg1; 240 | } 241 | //void MainWindow::on_pushButton_clicked() 242 | //{ 243 | // QDateTime da_time; 244 | // QString time_str=da_time.currentDateTime().toString("yyyy-MM-dd HH-mm-ss"); 245 | // QString runPath = QCoreApplication::applicationFilePath(); 246 | // ui->label->setText(runPath); 247 | // QDir *TEST = new QDir; 248 | // bool exist = TEST->exists("TEST"); 249 | // if(!exist) 250 | // bool ok = TEST->mkdir("TEST"); 251 | // QString fileName = "TEST/1.txt"; 252 | // QString str="0000000nnnnnnnnnnnnnnnn"; 253 | // QFile file(fileName); 254 | // if(!file.open(QIODevice::WriteOnly | QIODevice::Text|QIODevice::Append)) 255 | // { 256 | // QMessageBox::warning(this,"sdf","can't open",QMessageBox::Yes); 257 | // } 258 | // QTextStream in(&file); 259 | // in<