08-16-2011 04:06 PM
Hi, I am using a 3152 Waveform Generator. Does anyone have any experience programming these, either with the LabWindows drivers or just SCPI? I've been trying both. I'd really like to pick your brain!
My foremost issue is with generating/loading arbitrary waveforms.
With my non-driver attempts, I'm stuck at the "TRACe #42000<binary_block>" step in loading the data.
Sorry for the highly specific question, I hope someone knows though! I'm completely stuck.
I figured using the drivers would be short and sweet, but I've had even less luck with them.
Thanks in advance!
08-17-2011 06:15 PM
Hi TurboMetrologist,
Are you referring to this card? We can offer assistance if you have a question regarding the CVI development environment. If the question is related to the Waveform Generator API, your best bet would be to contact the manufacturer at this point.
I'm sorry we couldn't offer much more help in this case.
Josh L.
08-18-2011 08:02 AM
Yes, that's the guy. Let me ask, what binary conversion CVI tools would aide me with this? The binary block I have to send needs to be very specific. 12 bit resolution with an initial 4 bits of header for 16 bits total, repeating.
This is what I've got for a starter.
char *printToBinary (int n, char *string){//FIX: return a negative number for error checking.
int len;
if (n < 0) return "-1"; // Number must be non-negative
// Recursively call the function for 1 to n-1 bits
if (n > 1) string = printToBinary (n / 2, string);
// Dynamic allocation of memory
if (!string) {
string = malloc (2);
memset (string, 0, 2);
}
else {
len = strlen (string);
string = realloc (string, len + 2);
string[len] = 0;
}
// Print the last bit
sprintf (string + strlen (string), "%d", n % 2);
return string;
}