GtDio6xMultiSiteWriteVectorMemoryToSystemMemory

Applies To

GX5296

Purpose

Writes one or more vectors to one or more channels in the specified sites to the system memory.

Syntax

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, lNumberOfVectors, pacVectorArray, lVectorStart, lNumberOfVectors, pacVectorArray, lFillOpCodeVectorStart, lFillOpCodeVectorSize, cFillOpCode, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:
Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.
lSiteCount
LONG
Size of palSitelList array of list of sites numbers.
palSitelList
PLONG
Array of list of sites numbers.
lVectorStart
LONG
Specifies the first vector offset in the system memory to start writing from.
lNumberOfVectors
LONG
Specifies the number of vectors to write to the system memory, it must match the pacVectorArray size.
pacVectorArray
PCHAR
Array of Vectors data, the array passed must contain at least as many elements as specified by lVectorSize*lChannelCount, where lChannelCount is the number of channels in the site. See comments below for additional information.
lFillOpCodeVectorStart
LONG
Used to specify from which vector address a default OpCode will be filled. This is an optional parameter to be used only if the user wants to fill the last vectors in the system memory with predefine OpCode as specified by the cFillOpCode. It will be disregarded if lFillOpCodeVectorStart=-1.
lFillOpCodeVectorSize
LONG
Used to specify how many vectors will be set to OpCode. This is an optional parameter to be used only if the user wants to fill the last vectors in the system memory with predefine OpCode as specified by the cFillOpCode. It will be disregarded if lFillOpCodeVectorSize =-1.
cFillOpCode
CHAR
Used to specify which OpCode to fill the range of vectors specified by lFillOpCodeVectorStart and lFillOpCodeVectorSize paramters. It will be disregarded if lFillOpCodeVectorStart =-1 and lFillOpCodeVectorSize paramters =-1
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

The function writes one or more vectors to one or more channels in the specified sites to the system memory. The function gets a list of sites and vectors data, and writes the same data in the same logical order of  each site associated channels, in that way the user can easily load the same data across multiple sites.

NOTE: When passing an array of sites containing more than one site, all the sites must have the same number of channels.

The pacVector array contains character elements that represent opcodes that are to be written to the system memory. To index into this array, use the following formula: lChannelCount*lVector+lChannel, where lChannelCount is the number of channels in the site. Use the GtDio6xMultiSiteGetSiteCount() API to retrieve the channel count for the site. For example, to access the opcode for vector 6, channel 4, in an array representing 4 channels the following code would be used:

pacVector [4*6+4]=’H’;

In case the pacVector array size is smaller than the allocated system memory vectors array, the function can fill the vector space between the user’s last vector and the last allocated system memory with predefined OpCode specified by the user.

There are fourteen pattern codes. The following table lists how each pattern code affects the driver/comparator:

Pin Action
Data OpCode
Driver
Comparator Expect
Invert Code
Disable channel
'Z’
Off
X
None
Disable Channel ‘Z’
Collect CRC
‘C’
Off
X
Enable CRC
Collect CRC ‘C’
Drive Low
‘0’
On
DVH
None
Drive Low ‘0’
Drive High
‘1’
On
DVL
None
Drive High ‘1’
Repeat Previous Code
‘R’
Repeats the last non-repeat/invert code.
Invert Previous Code
‘I’
Inverts the last non-repeat/invert code. Refer to Invert Code column of this table.
Expect Valid Low
‘L’
Off
X
< CVL
Expect Valid High ‘H’
Expect Valid High
‘H’
Off
X
> CVH
Expect Valid Low ‘L’
Expect Valid
‘V’
Off
X
< CVL or > CVH
Expect Invalid ‘B’
Expect Invalid
‘B’
Off
X
> CVL and < CVH
Expect Valid ‘V’
Drive Low, Expect Low
‘l’
On
DVL
< CVL
Drive High, Expect High ‘h’
Drive High, Expect High
‘h’
On
DVH
> CVH
Drive Low, Expect Low ‘l’
Drive Low, Expect High
‘/’
On
DVL
> CVH
Drive High, Expect Low ‘\’
Drive High, Expect Low
‘\’
On
DVH
< CVL
Drive Low, Expect High ‘/’

 

Note: The GtDio6xMultiSiteXXX() APIs provides the functionality required for efficient multi-site testing. By enabling parallel testing of multiple Devices Under Test (DUTs) simultaneously.

Example

The following example writes 15 elements of vector data starting at address 0 for channels 0, 1, 2 to the system memory, then write the system memory to the DIO board:

Note: see GtDio6xMultiSiteGetRealTimeCompareFailures() API for a complete example.

 

LONG    alChannelList[3];

CHAR    acVector[15*3];

LONG    alSitelList[1];

SHORT nStatus;

 

// Clear any previous site lists

GtDio6xMultiSiteDeleteAllSites(nHandle, &nStatus);

CheckStatus(nStatus);

 

// Fill Site #0 Channels Array: CH0-CH2

for (l = 0; l < 3; l++)

    alSiteChannels[l] = l;

// Set Site0 Channels list

GtDio6xMultiSiteSetChannelList(nHandle, 0, 4, alSiteChannels, &nStatus);

CheckStatus(nStatus);

 

for (l = 0; l < 15; l++)

{

    acVector [l * 3 + 0] = GTDIO6X_OPCODE_DRIVE_LOW_EXPECT_LOW;

    acVector [l * 3 + 1] = GTDIO6X_OPCODE_DRIVE_HIGH_EXPECT_HIGH;

    acVector [l * 3 + 2] = GTDIO6X_OPCODE_DRIVE_LOW_EXPECT_LOW;

}

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, lSiteCount, alSitelList, 0, 15*3, acVector, -1,-1, 0, &nStatus);

// Write the System Memory to the DIO board

GtDio6xMultiSiteWriteSystemMemoryToBoard(nHandle, 0, 0, lVectorLength, &nStatus);

 

See Also

GtDio6xMultiSiteDeleteAllSites, GtDio6xMultiSiteGetChannelList, GtDio6xMultiSiteGetRealTimeCompareFailures, GtDio6xMultiSiteGetSiteChannelCount , GtDio6xMultiSiteGetSiteList, GtDio6xMultiSiteGetSiteCount, GtDio6xMultiSiteSetChannelList, GtDio6xMultiSiteSetSiteArray, GtDio6xMultiSiteWriteSystemMemoryToBoard, GtDio6xGetErrorString