LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

34970 function error

Hello,
 
I am trying to generate function which will close , measure resistance and close channel on a 34901 20CH MUX.
 
I can do this the long way by...
 
hp34970a_switch (MUX, "101", HP34970A_SW_POS_CLOSE, HP34970A_SW_MODE_NORMAL);
hp34970a_resistanceSetup (MUX, "101", HP34970A_RS_RTYPE_2WIRE, HP34970A_RS_RANGE_AUTO, HP34970A_RS_RES_5_5DIG);
hp34970a_switch (MUX, "101", HP34970A_SW_POS_OPEN, HP34970A_SW_MODE_NORMAL);
 
then do for channels 2-40, but, I have over 40 channels, hence, I am trying to make a single function that will do this and Iam calling it...
 
void measure( CH )
{
  hp34970a_switch (MUX, CH , HP34970A_SW_POS_CLOSE, HP34970A_SW_MODE_NORMAL);
  hp34970a_resistanceSetup (MUX, CH , HP34970A_RS_RTYPE_2WIRE, HP34970A_RS_RANGE_AUTO, HP34970A_RS_RES_5_5DIG);
  hp34970a_switch (MUX, CH ,HP34970A_SW_POS_OPEN, HP34970A_SW_MODE_NORMAL);
}
 
my problem is that the CH variable is not passing. Why? Error states that it expected a pointer. The variable CH is declared as:
static ViChar CH[4];
 
What am I doing wrong? ANy help would be appreciated
0 Kudos
Message 1 of 5
(3,747 Views)

Change your function declaration to

void measure( ViChar CH[] )

The way it is declared now CH will default to being an integer.

 

Message Edited by mvr on 08-15-2006 01:18 PM

0 Kudos
Message 2 of 5
(3,746 Views)

I've done that and I understand what you meant...but now that I'm trying to call that function from another function I am getting an error when passing the ViChar.

 

See attached image and I would appreciate any help!

 

ThanksNadvance

FredTest

0 Kudos
Message 3 of 5
(3,725 Views)

This usually happens when the compiler is not aware of a typedef and assumes it to be an identifier. When Safe Test.c is compiled, do any of the included files contain the definition of ViChar? The DAQ.c file compilation step, which presumably did not complain, may well find the relevant definitions via the hp34970a.h include file.

JR

0 Kudos
Message 4 of 5
(3,717 Views)
I just realized that!
 
When I was calling the DAQ function, the 34970.h file had a definition for that visatype.h which defines ViChar.
All I had to do was include that visatype.h in my Globals.h file and it will acknowledge the ViChar.
 
 
i understand that this error was a fundamental one and I appreciate all of your help!
 
Well, there is never a smooth road to learning, you will always get potholes!
 
FredTest!
0 Kudos
Message 5 of 5
(3,711 Views)