11-13-2008 05:22 PM
Hi,
I am using Agilent N3300A (Electronic Load) driver (IVI-C) in a LabWindows/CVI 6.0 (Windows XP) environment.
I am using an old code that instrument "channel" is defined as an integer variable. As in the follwoing function call of the instrument IVI-c driver:
agn330xa_ConfigureResistanceMode (agn3300aid, "CHAN1", AGN330XA_VAL_RESISTANCE_MODE_FIX);
"CHAN1" (argument 2) is a string.
How can I use the current "channel" (integer variable) in the above function call to replace the argument "CHAN1" (string) without getting any error?
Thanks for your help.
-LVLV
11-14-2008 12:49 AM
Hi lvlv,
I got confused about your "using an old code" statement. Is this code a compiled library, just a function in another C file or a whole program?
If this old code accepts the channel number as an integer and uses the agn3300 driver, it should already be converting the integer to a string using a simple call like
sprintf (chanStr, "CHAN%i", chanInt);
If you can modify the old code just change its parameter types or add the line above into the code to do the conversion.
Maybe I'm guessing to much, in which case you should explain the situation better for other people to help you better.
Hope this helps,