Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5667

1073807247 VI_ERROR_USER_BUF after 3 days - Buffer not valid

$
0
0

Hi, 

In our application we use VISA to read and write data to and from digital multimeters (Keysight Agilent - 34461A).

Our application is written in Java and uses JNI to communicate with the VISA library. Below the code of the read function.

The strange this is that this works fine for almost 3 days, reading and writing every 5 minutes the same type of data, and then the following error comes:

-1073807247: VI_ERROR_USER_BUF: A specified user buffer is not valid or cannot be accessed for the required size.

 

Any ideas / hints?

 

JNIEXPORT jstring JNICALL Java_com_es_suite_devices_visa_VISA_read
	(JNIEnv *env, jobject obj, jint handle) {
		viSetAttribute(vi[handle],VI_ATTR_TMO_VALUE,5000); 
		char* buf = (char*)malloc(81000*16*sizeof(char));
		ViUInt32 byteCnt;
		printf("about to read using VI");
		status = viRead (vi[handle], buf, 80000*16, &byteCnt);
		printf("status:", status);
		jstring result = (*env)->NewStringUTF(env,buf);
		free(buf);
		return result;
	}

 

 


Viewing all articles
Browse latest Browse all 5667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>