Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

SendList and MakeAddr

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
0 Kudos
Message 1 of 2
(3,087 Views)

What I'd do is try talking to just one power supply and seeing if that works. And keep adding more addresses to the array. It may be that you find you can't even set just one power supply.

 

 

0 Kudos
Message 2 of 2
(3,076 Views)