AnsweredAssumed Answered

using C-network analyzer_command problem.

Question asked by JosephChoi on Aug 15, 2010
Latest reply on Aug 18, 2010 by JosephChoi
Hi all..

i facing lot a command problem in network analyzer E5071B...
i was visual basic  user and now i convert to C# language.

below is previously visual basic coding and successfully working.
  int Channel_Number = 1;
  int Trace_Number =1;

  Call OutputSiclLan(ENA_Address, "SENS" & Trim(Str(Channel_Number)) + ":SWE:TYPE?")
  Call OutputSiclLan(ENA_Address, ":SENS" + Trim(Str(Channel_Number)) + ":SEGM:SWE:POIN?")\
  Call OutputSiclLan(ENA_Address, ":CALC" + Trim(Str(Channel_Number)) + ":PAR" + Trim(Str(Trace_Number)) + ":SEL")

Channel_Number and Trace_Number are integer but it's converted to string and work.

but C# case i facing problem. first i convert to string but error occured. so i convert to single type.
           int Channel_Number = 1;
           int Trace_Number =1;
         myNa01.WriteString("SENS"+Convert.ToSingle(Channel)+":SWE:TYPE?", true);
         myNa01.WriteString("SENS"+Convert.ToSingle(Channel)+":SEGM:SWE:POIN?", true);
         /////// ' Select the active trace
         myNa01.WriteString(":CALC " + Convert.ToSingle(Channel) + ":PAR" + Convert.ToSingle(TraceNum) + ":SEL", true);
         myNa01.WriteString(":CALC " + Convert.ToSingle(Channel) + ":FORM SCOM", true);

i can not aware this is working or not. sometimes i can hear error sound from equipment sometimes not,
and previously in visual basic i usually convert to string but C# is different. i need help about above C# coding.

and one more question .!!
my previous VB program. using agilent IO library and then easy to call number of point.
number of point mean is go to sweep set up and i can change the edit segment table.
after setting edit segment table and then i can call number of point in my software.
below is visual basic example.

Dim Number_Of_Point_ENA As String

Call EnterSiclLan(ENA_Address, Number_Of_Point_ENA)

below is  EnterSiclLan  function detail from agilent.

Public Sub EnterSiclLan(addr As Integer, Query As String)
' Status    :   Active
' Task      :   Read in ASCII Data from ENA
  '''Read ASCII data
  Dim status As Integer
  Dim actualcnt As Long
  Dim res As String * 256
  Dim Dummy As Integer
  On Error GoTo ErrHandler

  status = SICL4_1.Ivscanf_Equipment(addr, "%t", res)
  Query = Trim(res)
  Exit Sub

  Show_Error Error$, "Sub OutputSiclLan() clsENA", Show_On_Screen
  Dummy = SICL4_1.Siclcleanup_Equipment

End Sub

in C# language i want implement this work.
i need advice about this issue.


Joseph Choi