AnsweredAssumed Answered

urgent-read binary in MXA ( visual basic )

Question asked by JosephChoi on Apr 6, 2010
Latest reply on Apr 23, 2010 by JosephChoi
Hi all

[color=#0000BF]i got serious problem in MXA.
i'm visual basic user and problem is ... if i convert binary then
how to read trace data in visual basic.

i will explain my situation..

previously we use string array and program is run and slow.
also can ACLR data but slow reading .
below coding is our previouse coding..

Dim ACP_Data() As String
Dim mWACP_Data(601) As Double

ACP_Data() = Split(N9020A_Object.TRACE_RETURN, ",")
    ///// i use split because string--- data is split depend on ,
///////  then go to TRACE_RETURN function below

Public Function TRACE_RETURN() As String

Dim tempresults As Integer
Dim dummy As String

    dummy = SICL4_1.Ivprintf_Equipment(N9020A_ID, ":TRAC? TRACE1 " & Chr(10))

        dummy = SICL4_1.Ivscanf_Equipment(N9020A_ID, "%c", tempresults)
        TRACE_RETURN = TRACE_RETURN & Chr(tempresults)
    Loop While tempresults <> 10

End Function

////// // as you know default is ASC so send   TRAC? TRACE1  command and do loop
///////// is gathering data in TRACE_RETURN array,,, this array also string..

but we want use binary type not ASC ...
so in MXA setting i added below...

Public Sub READ_Binary()

    Call Send_To_Equipment(N9020A_ID, ":FORM:DATA REAL,32" & Chr(10))
End Sub

so we can get binary data type but occured data reading problem.
after changed binary type then i send command    ":TRAC? TRACE1
but still facing data reading problem...

i check other language ....
in C# case simple just declare some of array by float type and
(float[])mySa01.ReadIEEEBlock(IEEEBinaryType.BinaryType_R4, true, true);
using readieeeblock for reading and finish,..

and VEE case just using

READ BinBlock X Real 32 array

But we are using visual basic 6.0 ,,,,,,,,,,,,,, and i want know how to read binary type
and put in to array...


Joseph Choi