AnsweredAssumed Answered

Problems writing cal data to ENA

Question asked by analyzer100 on Sep 1, 2012
Latest reply on Sep 3, 2012 by analyzer100
Hi,

I'm having problems writing calibration data to an ENA analyzer in real format. 

I'm using SICL with VB6. The following ASCII code works fine:

    Dim Pt1r$, Pt1i$, Pt2r$, Pt2i$, Cmd$
    
    Pt1r = "+1.00000000000E+000,"
    Pt1i = "+0.00000000000E+000,"
    Pt2r = "+1.00000000000E+000,"
    Pt2i = "+0.00000000000E+000"
    
    Call ivprintf(AnaId, "FORM:DATA ASC;", 0&)
    
    Cmd = ":SENS:CORR:COEF ED,1,1," & Pt1r & Pt1i & Pt2r & Pt2i & Chr$(10)
    
    Call ivprintf(AnaId, Cmd, 0&)


But I need to improve the performance. I've tried many variations using the REAL format, and nothing seems to work. For example:

    Dim Pt1r#, Pt1i#, Pt2r#, Pt2i#, Bytes%, Cmd$
    
    Pt1r = 1#
    Pt1i = 0#
    Pt2r = 1#
    Pt2i = 0#
    
    Call ivprintf(AnaId, "FORM:DATA REAL;" & Chr$(10), 0&)
    
    Bytes = 2 * 2 * 8
    
    Cmd = ":SENS:CORR:COEF ED,1,1#6" & Format$(Bytes, "000000")
    
    Call ivprintf(AnaId, Cmd, 0&)
    
    Call iswap(Pt1r, 8, 8)
    Call iwrite(AnaId, Pt1r, 8, 0, 0&)
    
    Call iswap(Pt1i, 8, 8)
    Call iwrite(AnaId, Pt1i, 8, 0, 0&)
    
    Call iswap(Pt2r, 8, 8)
    Call iwrite(AnaId, Pt2r, 8, 0, 0&)
    
    Call iswap(Pt2i, 8, 8)
    Call iwrite(AnaId, Pt2i, 8, 1, 0&)


Any help fixing this would be extremely well received.

Thanks.  

Outcomes