Real Time Data From GX5292
Tom P.
Fort Wayne, IN

Apr 23, 2010
1 Post

Real time data from GX5292

I know the GX5292 really isn't capable of real time data streaming, but I'm in a situation where I need to find a way to make it stream data in real time as best as I can. I've come up with a method of commanding the GX5292 to do short bursts of data gathering, pause the card and read the data from the card. The trouble now, is how do I read the data file and convert it to a hex value that I can display? The DI output file appears to be in some compressed form that at first glance is not easy to reverse engineer. Is there a library that exists that would allow me to directly read from a GX5292 output file? Has no one else had the need for this?

Solution Available
Dale J.
La Verne, CA

Apr 27, 2010
10 Posts

Re: Real time data from GX5292

Hi Tom,
This is just a repeat of the information I posted to your Magic incident, but it will close the loop on this forum.  There are several functions in the DIO driver that facilitate reading and writing patterns to a file and to the hardware.  The functions are the same, the only difference is whether you pass in a file handle or an instrument handle.  Here is a simple example of how to read vectors from a DIO file, write the vectors to hardware, run the hardware, then read captured data from hardware:

Sample():
{
Short    nBanks, nBoardHandle, nDensity, nStatus, hFileHandle, nBoardType;
Long    alTriState[1], alResp[1], alStim[1], lSize;
String    sFileName;

    \\  First read from DIO file
    Strcpy(sFileName,".\\DioSample.di");
    
    DioFileOpen(sFileName,1,nBoardType,hFileHandle,nStatus);
    DioFileGetNumberOfSteps(hFileHandle,lSize,nStatus);

    \\  Use Malloc to dimension arrays - couldn't remember syntax
    Redim alStim[lSize];
    Redim alResp[lSize];
    Redim alTriState[lSize];
    
    DioReadDirectionMemory(hFileHandle,alTriState,0,lSize,nStatus);
    DioReadOutMemory(hFileHandle,alStim,0,lSize,nStatus);
    
    DioFileClose(hFileHandle,nStatus);
    
    \\ Initialize hardware
    DioSetupInitialization(0,1,7,nDensity,nBanks,nBoardHandle,nStatus);
    
    \\ Write vectors read from DIO file to hardware
    DioWriteDirectionMemory(hFileHandle,alTriState,0,lSize,nStatus);
    DioWriteOutMemory(hFileHandle,alStim,0,lSize,nStatus);
    
    \\ Write Halt command at last vector
    DioWriteCtrlCommand(nBoardHandle,lSize-1,8,0,0,0,0,nStatus);
    
    \\ Arm instrument and Trigger
    DioArm(nBoardHandle,nStatus);
    DioTrig(nBoardHandle,nStatus);
    
    \\ Wait for DIO to finish - could also poll status register
    Delay(200);
    
    \\ Make sure hardware is halted
    DioHalt(nBoardHandle,nStatus);
    
    \\ Read captured data from hardware
    DioReadInMemory(hFileHandle,alResp,0,lSize,nStatus);
}

Regards,
Dale



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]