10-12-2009 03:37 AM
Solved! Go to Solution.
10-12-2009 05:29 AM
Hi,
You seem to be trying to get the string "drvsession" from a TestStand step which has a property call LogicalName.
eg Step.LogicalName = "drvsession"
Is this a Custom Step Type you are using?
What version of TestStand are you using?
Regards
Ray Farmer
10-12-2009 07:04 AM
10-12-2009 09:40 AM
Hi,
make sure you are passing a valid SequenceContext into the function to use in
TS_PropertyGetValString(data->seqContextCVI, &errorInfo, "Step.LogicalName", 0, &logicalName);
Also check what the error is returning from TS_PropertyGetValString.
But seeing as you are using TS4.2, why dont you pass the LogicalName direct to the function. then you dont need to use TS_PropertyGetValString
Regards
Ray Farmer
10-12-2009 02:27 PM
Hi,
Here is a snipet of passing the LogicalName direct to the function:
// This example test module aquires the instrument session by name. Provided that
// another reference to the session exists, this module does not recreate or
// reinitialize the session.
void __declspec(dllexport) __stdcall ConfigureDMMForVoltageMeasurements(const char *logicalName,
short *errorOccurred, long *errorCode, char errorMsg[1024])
{
int error = 0;
ErrMsg errMsg = {'\0'};
ERRORINFO errorInfo;
ViSession handle;
CAObjHandle session = 0;
// get a reference to the session
tsErrChk( SM_GetSession(logicalName, &session, &errorInfo));
// get the driver handle (you don't need to release it)
tsErrChk( SM_GetHandle (session, NULL, SMConst_ClassDriver,
&handle, &errorInfo));
// call the instrument as much as you want:
errChk( IviDmm_ConfigureMeasurement(handle, IVIDMM_VAL_DC_VOLTS, IVIDMM_VAL_AUTO_RANGE_ON, 0.001));
You can find this example in \TestStand 4.2\Examples\SessionMgr\CVI\
Hope this helps
Regards
Ray Farmer