Hello all. Forgive me for the somewhat basic question, but I'm trying to control an old magnet control gaussmeter (Varian FR41) and the old C code looks like this:
{
long temp;
int z1,z2,z3,z4,b1,b2,b3;
float b;
double gauss,hv=9555.,magconst=.069,Mass=171.;
if (ieeeinit()==-1)
{
printf("Cannot initialize IEEE system.\n");
exit(1);
}
gauss=sqrt(Mass*hv/magconst);
temp=10*gauss;
b=temp/10.;
z1=b/1000;
z2=b/100;
z3=b/10;
z4=b;
printf("\n\r %f %f %d %d %d %d",gauss,b,z1,z2,z3,z4);
b1=z2+z1*6;
b2=z4+6*z3-160*z2;
b3=(b-z4)*160+14;
printf("\n\r %d %d %d %d",7,b1,b2,b3);
ieeewt("output 08;");
ieeeprtf("%c%c%c%c\n",7,b1,b2,b3);
}
I'm having trouble with the conversion to LabView in two areas. First, the in the line
b=temp/10.;
I do not know how to reproduce the "." element selection in LabView.
Lastly, I can't seem to get the
ieeeprtf("%c%c%c%c\n",7,b1,b2,b3);
to communicate with the instrument using the GPIB Send Message.vi. Is there another solution to sending characters to the instrument through the GPIB hub?
Thanks,
Jesse