Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Need more info for viClear error code VI_ERROR_INV_SETUP

I am getting a VI_ERROR_INV_SETUP error code in response to a VISA viClear function on a COM port.  Other than that, everything seems to run OK.  This is a new instrument installation so I suspect it is a configuration issue.  However, the description for VI_ERROR_INV_SETUP error code, "Unable to start operation because setup is invalid (due to attributes being set to an inconsisntent state)." does not give me a clue which attribute is at fault.  Anybody have an inight into this?  Thanks.
 
 
0 Kudos
Message 1 of 4
(3,867 Views)

I think you need to set the VI_ATTR_IO_PROT attribute to VI_PROT_4882_STRS. The viClear wants to send a *cls to a SCPI based instrument and you need to set this attribute for it to work.

 

 

0 Kudos
Message 2 of 4
(3,859 Views)

Serial's viClear() behaviour has changed from VISA spec 3.0 a bit.  It now performs Send Break and does not require VI_ATTR_4882_STRS being set.  You should upgrade to the latest NI-VISA version.

0 Kudos
Message 3 of 4
(3,845 Views)

I did set the VI_ATTR_IO_PROT per cymrieg's suggestion and it did fix the problem.  I am running VISA 2.6.1 and will try the VISA update per Makoto's suggestion as an alternative.  Thanks for your prompt and helpful reply.

 

 

0 Kudos
Message 4 of 4
(3,833 Views)