LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

array generation with ViChar

I have the following...
 
void ResistanceMeasure(ViChar *CH)
{
          "resistance setup"
          "resistance measure"
          value = measured;
}
 
void SafeTest( )
{
          ResistanceMeasure("101");
          OutputResults(value)
          Delay(1);
          ResistanceMeasure("102");
          OutputResults(value)
          Delay(1);
}
 
 
I have 50 channels, I know how to do an array with integers, doubles and ect. But how can I do the array with ViChar? That is "101" , "102"..."150"?
 
 
ThanksNAdvance!
FredTest
0 Kudos
Message 1 of 2
(3,044 Views)
Hi FredTest,

I'm assume from your question that you want to use a ViChar array to hold strings. ViChar is just like Char, it simply has a VISA wrapper around it. So, just like with Char, you can create an array of ViChars pointers. For instance:

ViChar* channels[50];
channels[0] = "101";
channels[1] = "102";

You can then pass the array as a parameter to your function.

ResistanceMeasure(channels[0]);

In your function ResistanceMeasure, you can then view CH as a character array.

Matt Mueller
NI
0 Kudos
Message 2 of 2
(3,030 Views)