Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA formatted I/O usage - ViScanf() format specifier

Hello.

 

I'm trying to read an instrument response with ViScanf()and transfer the response values from the instrument.

The instruments response is:

 

"OP0,TRUE,-9.10,-9.08,-19.51,-8.74,FAIL\n"

 

I tried the following:

 

double dVal1,dVal2,dVal3,dVal4; char szValidity[32]; char szVerdict[32]; viScanf(instr,"OP0,%[^,],%le,%le,%le,%le,%[^\n]", szValidity, dVal1, dVal2,dVal3,dVal4,szVerdict);

 

But this throws an unhandled exception/access violation.

I guess my format specifier is wrong somehow.

Any suggestions?

 

 

Best regards,

Dietmar

0 Kudos
Message 1 of 2
(4,143 Views)

Oh sorry, what a shame, viScanf() expects pointers of course...

 

... , &dVal1, &dVal2,&dVal3,&dVal4,...

0 Kudos
Message 2 of 2
(4,141 Views)