06-13-2019 09:56 AM
I am trying to do a 2 channel measurement by setting the other channel as the second channel. It works when the other channel is channel 0. I believe this is the default for the other channel.
When I tried changing the other channel to a different channel it does not work, it is always using channel 0.
niScope_SetAttributeViString (handle, otherChannel, NISCOPE_ATTR_MEAS_OTHER_CHANNEL, 0)
Is there another function call i have to call to commit the change?
06-14-2019 01:42 AM - edited 06-14-2019 01:43 AM
Please provide your vi(s) or code that setup the task.
06-17-2019 07:32 AM
struct niScope_wfmInfo *arrayWfmInfoPtr = NULL;
ViReal64 *arrayWaveformPtr = NULL;
ViInt32 numWaveForm = 0;
handleErr(niScope_ActualNumWfms(handle, firstChannel, &numWaveForm));
handleErr(niScope_SetAttributeViString (handle, otherChannel, NISCOPE_ATTR_MEAS_OTHER_CHANNEL, 0));
if (arrayWfmInfoPtr)
free (arrayWfmInfoPtr);
arrayWfmInfoPtr = malloc(sizeof(struct niScope_wfmInfo) * numWaveForm);
if (arrayWaveformPtr)
free (arrayWaveformPtr);
arrayWaveformPtr = malloc (sizeof(ViReal64) * arrayActualRecordLength * numWaveForm);
if (arrayWaveformPtr == NULL || arrayWfmInfoPtr == NULL)
{
goto Error;
}
handleErr(niScope_InitiateAcquisition (handle));
handleErr(niScope_FetchArrayMeasurement (handle, firstChannel, timeout, SUBTRACT, arrayActualRecordLength,arrayWaveformPtr, arrayWfmInfoPtr));