⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aumg369xb.c

📁 介绍了GPIB在开发mg369*仪器的自动控制方面的技巧和注意事项
💻 C
📖 第 1 页 / 共 5 页
字号:
		{
			CHECKERR (viPrintf (vi, "AM8, ADP2 %f DB;", depth));
		}		

		CHECKERR (viPrintf (vi, "AMR %Lf HZ, AMW%d;", rate, waveform));
	}
	else
	{
		CHECKERR (viPrintf (vi, "AM0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure External AM													   */	
/*																			           */
/* Purpose:  This function turns on or turn off the selected external AM function and  */
/*           configures the sensitivity.											   */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureExternalAM (ViSession vi,
					ViBoolean ExternalAMEnabled, ViInt32 scaling, ViReal64 sensitivity)

{
	ViStatus	status = VI_SUCCESS;

	if (ExternalAMEnabled)
	{
		if (scaling == AUMG369XB_AM_SCALING_LINEAR)
		{
			CHECKERR (viPrintf (vi, "AM1, AMS %f PCV;", sensitivity));
		}
		else
		{
			CHECKERR (viPrintf (vi, "AM2, ASD %f DV;", sensitivity));
		}
	}
	else
	{
		CHECKERR (viPrintf (vi, "AM0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal FM													   */	
/*																			           */
/* Purpose:  This function turns on or turns off the selected internal FM mode and     */   
/*           configures the	deviation, the rate and the waveform.                      */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalFM (ViSession vi,
					ViBoolean InternalFMEnabled, ViInt32 FMMode, ViReal64 deviation, 
					ViReal64 rate, ViInt32 waveform)
{
	ViStatus	status = VI_SUCCESS;

	if (InternalFMEnabled)
	{
		CHECKERR (viPrintf (vi, "%s, FDV %Lf HZ, FMR %Lf HZ, FWV%d;", 
					internalFMModeTable[FMMode], deviation, rate, waveform));
	}
	else
	{
		CHECKERR (viPrintf (vi, "FM0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure External FM													   */	
/*																			           */
/* Purpose:  This function turns on or turns off the selected external FM mode and     */
/*           configures the sensitivity.								               */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureExternalFM (ViSession vi, 
					ViBoolean ExternalFMEnabled, ViInt32 FMMode, ViReal64 sensitivity)
{
	ViStatus	status = VI_SUCCESS;

	if (ExternalFMEnabled)
	{
		CHECKERR (viPrintf (vi, "%s, FMS %Lf KV;", externalFMModeTable[FMMode], sensitivity));
	}
	else
	{
		CHECKERR (viPrintf (vi, "FM0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal PM							                           */	
/*																			           */
/* Purpose:  This function turns on or turns off the selected internal PM and          */ 
/*           configures the deviation, the rate and the waveform.                      */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPM (ViSession vi,
					ViBoolean InternalPMEnabled, ViInt32 PMMode, ViReal64 deviation, 
					ViReal64 rate, ViInt32 waveform)
{
	ViStatus	status = VI_SUCCESS;
	
	if (InternalPMEnabled)
	{
		CHECKERR (viPrintf (vi, "%s, PHD %f RD, PHR %Lf HZ, PHV%d;", 
					internalPMModeTable[PMMode], deviation, rate, waveform));
	}
	else
	{
		CHECKERR (viPrintf (vi, "PH0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure External PM													   */	
/*																			           */
/* Purpose:  This function turns on or turns off the selected external PM and          */
/*           configures the sensitivity.                                               */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureExternalPM (ViSession vi,
					ViBoolean ExternalPMEnabled, ViInt32 PMMode, ViReal64 sensitivity)
{
	ViStatus	status = VI_SUCCESS;
	if (ExternalPMEnabled)
	{
		CHECKERR (viPrintf (vi, "%s, PHS %f RV;", externalPMModeTable[PMMode], sensitivity));
	}
	else
	{
		CHECKERR (viPrintf (vi, "PH0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal Pulse Modulation							           */	
/*																			           */
/* Purpose:  This function turns on or turns off the selected internal pulse modulation*/ 
/*           and configures	the period, the trigger type, the trigger edge type, the   */
/*           polarity of the signal that turns the RF on and the clock rate.           */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPulseModulation (ViSession vi,
					ViBoolean InternalPulseModulationEnabled, ViReal64 period, ViInt32 mode, 
					ViInt32 triggerType, ViInt32 triggerEdgeType, 
					ViInt32 RFOnPolarity, ViInt32 clockRate)
{
	ViStatus	status = VI_SUCCESS;

	if (InternalPulseModulationEnabled)
	{
		CHECKERR (viPrintf (vi, "IP, PER %Lf SEC, PMD%d;", period, mode));

		CHECKERR (viPrintf (vi, "PTG%d, EP%d, PC%d;", triggerType, RFOnPolarity, clockRate));

		if (triggerType == AUMG369XB_TRIGGER_TYPE_GATED || 
			triggerType == AUMG369XB_TRIGGER_TYPE_TRIGGERED ||
			triggerType == AUMG369XB_TRIGGER_TYPE_TRIGGERED_WITH_DELAY)
		{
			CHECKERR (viPrintf (vi, "%s", triggerEdgeTypeTable[triggerEdgeType]));	
		}
	}
	else
	{
		CHECKERR (viPrintf (vi, "P0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal Pulse Modulation Frequency					           */	
/*																			           */
/* Purpose:  This function configures the internal pulse frequency.					   */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPulseModulationFrequency (ViSession vi,
					ViReal64 frequency)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "PR %Lf HZ;", frequency));
	
	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal Pulse Width									           */	
/*																			           */
/* Purpose:  This function configures the selected internal pulse width parameter.	   */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPulseWidth (ViSession vi,
					ViInt32 selectedPulseWidth, ViReal64 pulseWidth)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "W%d %Lf SEC;", selectedPulseWidth, pulseWidth));

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure Internal Pulse Delay									           */	
/*																			           */
/* Purpose:  This function configures the selected internal pulse delay parameter.     */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPulseDelay (ViSession vi,
					ViInt32 selectedPulseDelay, ViReal64 pulseDelay)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "D%d %Lf SEC;", selectedPulseDelay, pulseDelay));

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;	
}


/*=====================================================================================*/
/* Function: Configure Internal Pulse Step Delay							           */	
/*																			           */
/* Purpose:  This function enables or disables the step delay and configures the 	   */
/*			 start delay, the stop delay, the step size and the step time.			   */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalPulseStepDelay (ViSession vi,
					ViBoolean enabled, ViReal64 startDelay, ViReal64 stopDelay, 
					ViReal64 stepSize, ViReal64 stepTime)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "SD%d;", enabled ? 1 : 0));

	if (enabled)
	{
		CHECKERR (viPrintf (vi, "SDS %f SEC, SDE %f SEC, SDD %f SEC, SDL %f SEC;", 
					startDelay, stopDelay, stepSize, stepTime));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;	
}


/*=====================================================================================*/
/* Function: Configure Internal Square Wave Pulse Modulation				           */	
/*																			           */
/* Purpose:  This function turns on internal square wave pulse modulation.			   */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureInternalSquareWavePulseModulation (ViSession vi,
					ViInt32 squareWaveFrequency)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "SW%d;", squareWaveFrequency));

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure External Pulse Modulation							           */	
/*																			           */
/* Purpose:  This function turns on or turns off the external pulse modulation and     */
/*           configures	the polarity of the signal (Low or High) that turns the RF on. */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureExternalPulseModulation (ViSession vi,
				  ViBoolean ExternalPulseModulationEnabled, ViInt32 RFOnPolarity)
{
	ViStatus	status = VI_SUCCESS;

	if (ExternalPulseModulationEnabled)
	{
		CHECKERR (viPrintf (vi, "XP, EP%d;", RFOnPolarity));
	}
	else
	{
		CHECKERR (viPrintf (vi, "P0;"));
	}

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*=====================================================================================*/
/* Function: Configure SCAN Modulation Enabled								           */	
/*																			           */
/* Purpose:  This function turns on or turns off the SCAN modulation function.         */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureSCANModulationEnabled (ViSession vi,
					ViBoolean enabled)
{
	ViStatus	status = VI_SUCCESS;

	CHECKERR (viPrintf (vi, "SC%d;", enabled ? 0 : 1));

	CHECKERR (aumg369xb_checkStatus (vi));

Error:
	return status;
}


/*- Measurement Configuration ---------------------------------------------------------*/

/*=====================================================================================*/
/* Function: Configure AM Measurement Enabled								           */	
/*																			           */
/* Purpose:  This function turns on or turns off the AM measurement mode.              */
/*=====================================================================================*/
ViStatus _VI_FUNC aumg369xb_configureAMMeasurementEnabled (ViSession vi,
					ViBoolean enabled)
{
	ViStatus	status = VI_SUCCESS;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -