/// <summary> /// Given a logic AWG number create an AWG object and <para> /// 1. Get a connection</para><para> /// 2. Get Id string and decode it</para><para> /// 3. Find the number of channels</para><para> /// 4. Reset to a default state</para><para> /// 5. Clear out any possible errors from previous sessions</para> /// </summary> /// <param name="lid"></param> void SetupNewAwgWithReset(string lid) { //int id = (lid > 0) ? (lid - 1) : 0; // User thinks in logical ID, this deals in implementation details //Open a VISA session to the named instrument IAWG awg = GetAWG(lid); // Go query yourself and decode and save it. _awgSystemGroup.AwgIdentifyYourself(awg); // Find the number of channels for this awg _awgControlGroup.FindTheNumberOfChannelsAvailable(awg); // Put into a known state _awgSystemGroup.AwgRST(awg); // While not necessary for an implied *RST, do a *OPC? and test for health _awgSyncGroup.AwgOperationCompleteQuery(awg); // And just to be sure, clear out any errors in this AWG's error queue. _awgStatusGroup.AwgClearErrorQueue(awg); }
[BeforeFeature] //MUST be static public static void BeforeFeature() { //Added by Kavitha on 07/06/2015 to fix the SXP single channel failure for AC instrument //Nothing here yet AwgSystemGroup awgSystemGroup = new AwgSystemGroup(); AwgStatusGroup awgStatusGroup = new AwgStatusGroup(); AwgControlGroup awgControlGroup = new AwgControlGroup(); //create a local instance of AWG to collect the test setup (model, options,channels) information and save that into accessors IAWG awg = GetAWG("1"); // Get the AWG ID string, model number and S/N awgSystemGroup.AwgIdentifyYourself(awg); // Find the number of channels for this awg awgControlGroup.FindTheNumberOfChannelsAvailable(awg); // Get the list of options for this AWG awgStatusGroup.GetOptions(awg); }
[BeforeTestRun] //MUST be static public static void BeforeTestRun() { AwgSystemGroup awgSystemGroup = new AwgSystemGroup(); AwgStatusGroup awgStatusGroup = new AwgStatusGroup(); AwgControlGroup awgControlGroup = new AwgControlGroup(); //create a local instance of AWG to collect the test setup (model, options,channels) information and save that into accessors IAWG awg = GetAWG("1"); // Get the AWG ID string, model number and S/N awgSystemGroup.AwgIdentifyYourself(awg); // Find the number of channels for this awg awgControlGroup.FindTheNumberOfChannelsAvailable(awg); // Get the list of options for this AWG awgStatusGroup.GetOptions(awg); //AwgSetupSteps the UI context accessors to the top level AwgContextFunctions.SetContextToTopLevel(); }
public void GetAnAwgId(string awgNumber) { IAWG awg = AwgSetupSteps.GetAWG(awgNumber); _awgSystemGroup.AwgIdentifyYourself(awg); // Go query yourself and decode and save it. }