Hi,
I'm having a problem using the SendList function with secondary addresses.
I have an Agilent mainframe (primary address = 10) and 8 power supplies with secondary addresses of 96 to 103.
When I send a command, only the last power supply sets the voltage. Does anybody know what's going on?
STDMETHODIMP CModularSupply::SetAllVoltages(double dVoltage, long *ReturnVal)
{
int j;
Addr4882_t instruments[9]; //Array of device addresses
int sad = 96;
_bstr_t command = "";
_bstr_t setvalue = "0";
for (j = 0; j < 8; j++)
{
instruments[j] = MakeAddr(10,sad);
sad++;
}
instruments[8] = NOADDR;
setvalue = (double)dVoltage;
command = "VOLT " + setvalue + "\n";
SendList(0,&instruments[0], (char*)command , (long)command.length(), NULLend);
if (ibsta & ERR){ *ReturnVal = FALSE;return S_OK;}
*ReturnVal = TRUE;
return S_OK;
}
Thanks
Curt