/// <summary> /// Program an instruction of the pulse program. /// </summary> /// <param name="freq">Selects which frequency register to use.</param> /// <param name="cos_phase">Selects which phase register to use for the cos (real) channel.</param> /// <param name="sin_phase">Selects which phase register to use for the sin (imaginary) channel.</param> /// <param name="tx_phase">Selects which phase register to use for the TX channel.</param> /// <param name="bTX_enable">When this is true, the TX channel will be output on the Analog Out connector. When this is false, Analog Out channel will be turned off.</param> /// <param name="bPhase_reset">When this is true, the phase of all DDS channels will be reset to their time=0 phase. They will stay in this state until the value of this bit returns to 0.</param> /// <param name="bTrigger_scan">When this is true, a scan will be triggered. To start a second scan, this bit must be set to false and then back to true.</param> /// <param name="flags">Controls the state of the user available digital out pins.</param> /// <param name="inst">Which instruction to use.</param> /// <param name="inst_data">Some instructions require additional data. This allows that data to be specified.</param> /// <param name="duration">Time until the next instruction is executed in nanoseconds.</param> public void InstructionRadio( int freq, PhaseRegister cos_phase, PhaseRegister sin_phase, int tx_phase, bool bTX_enable, bool bPhase_reset, bool bTrigger_scan, int flags, OpCode inst, int inst_data, double duration) { lock (this) { if (NativeMethods.pb_inst_radio( freq, (int)cos_phase, (int)sin_phase, tx_phase, bTX_enable ? 1 : 0, bPhase_reset ? 1 : 0, bTrigger_scan ? 1 : 0, flags, (int)inst, inst_data, duration) < 0) { throw new SpinAPIException(Error); } } }
/// <summary> /// Write an instruction that makes use of the pulse shape feature of some RadioProcessor boards. /// </summary> /// <param name="freq">Selects which frequency register to use.</param> /// <param name="cos_phase">Selects which phase register to use for the cos (real) channel.</param> /// <param name="sin_phase">Selects which phase register to use for the sin (imaginary) channel.</param> /// <param name="tx_phase">Selects which phase register to use for the TX channel.</param> /// <param name="bTX_enable">When this is true, the TX channel will be output on the Analog Out connector. When this is false, Analog Out channel will be turned off.</param> /// <param name="bPhase_reset">When this is true, the phase of all DDS channels will be reset to their time=0 phase. They will stay in this state until the value of this bit returns to 0.</param> /// <param name="bTrigger_scan">When this is true, a scan will be triggered. To start a second scan, this bit must be set to false and then back to true.</param> /// <param name="bUse_shape">Select whether or not to use shaped pulses.</param> /// <param name="amp">Select which amplitude register to use.</param> /// <param name="bReal_add_sub"></param> /// <param name="bImag_add_sub"></param> /// <param name="bChannel_swap"></param> /// <param name="flags">Controls the state of the user available digital out pins.</param> /// <param name="inst">Which instruction to use.</param> /// <param name="inst_data">Some instructions require additional data. This allows that data to be specified.</param> /// <param name="duration">Time until the next instruction is executed in nanoseconds.</param> public void InstructionRadioShapeCyclops( int freq, PhaseRegister cos_phase, PhaseRegister sin_phase, int tx_phase, bool bTX_enable, bool bPhase_reset, bool bTrigger_scan, bool bUse_shape, int amp, bool bReal_add_sub, bool bImag_add_sub, bool bChannel_swap, int flags, OpCode inst, int inst_data, double duration) { lock (this) { if (NativeMethods.pb_inst_radio_shape_cyclops( freq, (int)cos_phase, (int)sin_phase, tx_phase, bTX_enable ? 1 : 0, bPhase_reset ? 1 : 0, bTrigger_scan ? 1 : 0, bUse_shape ? 1 : 0, amp, bReal_add_sub ? 1 : 0, bImag_add_sub ? 1 : 0, bChannel_swap ? 1 : 0, flags, (int)inst, inst_data, duration) < 0) { throw new SpinAPIException(Error); } } }