Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 3 out of 5     Rate this Document

Why Do I Get an Error in CVI When Calling viMoveIn or viMoveOut VISA Functions?

Primary Software: Driver Software>>NI-VISA
Primary Software Version: 4.1
Primary Software Fixed Version: 4.3
Secondary Software: LabWindows/CVI Development Systems>>Full Development System

Problem:
Why do I get a user protection error in LabWindows/CVI when calling the viMoveIn or viMoveOut NI-VISA functions?

Solution:
This is a known issue in NI-VISA versions 4.1 and 4.2, that can be seen when using CVI in Debug mode.  CVI is incorrectly expecting a larger buffer than is actually necessary. 

As long as a sufficiently large buffer is passed for the number of items specified, then it is safe to disable the false user protection warnings by doing one of the following:
1) Call SetBreakOnProtectionErrors(0); before each call to one of the affected functions and SetBreakOnProtectionErrors(1); after each call.
2) Add the following pragmas to any source file that calls one of the affected functions or to a header file included in any source file that calls one of the affected functions:
#pragma DisableFunctionRuntimeChecking viMoveIn16
#pragma DisableFunctionRuntimeChecking viMoveIn32
#pragma DisableFunctionRuntimeChecking viMoveOut16
#pragma DisableFunctionRuntimeChecking viMoveOut32
#pragma DisableFunctionRuntimeChecking viMoveIn64
#pragma DisableFunctionRuntimeChecking viMoveOut64
#pragma DisableFunctionRuntimeChecking viMoveIn8Ex
#pragma DisableFunctionRuntimeChecking viMoveOut8Ex
#pragma DisableFunctionRuntimeChecking viMoveIn16Ex
#pragma DisableFunctionRuntimeChecking viMoveOut16Ex
#pragma DisableFunctionRuntimeChecking viMoveIn32Ex
#pragma DisableFunctionRuntimeChecking viMoveOut32Ex
#pragma DisableFunctionRuntimeChecking viMoveIn64Ex
#pragma DisableFunctionRuntimeChecking viMoveOut64Ex


The issue will be fixed in NI-VISA versions 4.3 and later, and did not exist in versions 4.0 and earlier.
The Bug ID is 4E3DCFAB.

Related Links:

 



Attachments:





Report Date: 10/11/2007
Last Updated: 02/11/2008
Document ID: 4EAET3QA

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit