Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help converting C code to serial commands

I have never programmed in C, so I am having trouble understanding how to decode this.

//send 1st character code @
code = 0x40;
send(code);
++code;

This I pretty much understand, but what is the "++code" string? Some sort of termination character?

// get nuclide name
for (j=0; j<6; j++)
{
          send(code)
          nucname[j] = receive();
          ++code;
}
nucname[6] = '\0';

Okay here is where I get lost. I see that you step through conditions j=0 to j=5. But what is the j++ and how would I do this with serial commands in LabVIEW? Is that 6 VISA reads after 6 VISA writes? Or can I just read the buffer once after I send the 0x40 character (@) again?

Thanks
Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 1 of 2
(3,073 Views)
++code is the same as 1+code
or in this case hex 41

and so j++ = after using J add 1
But in LabVIEW you would not need j but only a 6 connected to the N of a for loop.


greetings from the Netherlands
0 Kudos
Message 2 of 2
(3,059 Views)