From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I get a return code of 4 from DS_GetDataValue( ) in CVI?

Using polling DSTP string variable to receive data transferred from localhost DSTP server, the server returns error code 4 not 0.  Using DS_GetLibraryErrorString( ) to query the server on error number 4, the error message returned is "The operation completed successfully."

Since no error is usually returned as 0, I am a little surprised to see errorcode 4 being used to tell me that no error occurred.

0 Kudos
Message 1 of 3
(2,791 Views)

Hi mpencke,

 

The DSTP uses the HRESULT information to determine its error codes, and you can find all of the documentation on those error codes in cvi\toolslib\datasock\dataskt.h and cvi\sdk\include\winerror.h. An actual Success code appears to be 0, while an error code of 4 appears to be the code for too many files being open. It could be other numbers are coming into place, or maybe a question of timing. Maybe we could take a look at the snippet of code in question and where it is located within your project, and what is going on we could look further into the issue.

 

Regards,

James W.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,778 Views)

James,

thanks for the comment.  I could not find error number is not found in datasocket.h or in winerror.h.   So I ran the datasocket server library command to get the error message associated with error 4, and the DSTP server returned the string "The operation completed successfully" as the error strng associated with error code 4.  So it seems to me the server knows what the error code is and it isn't an error code at all.  Why it does this and not return 0 is for others to figure out.

0 Kudos
Message 3 of 3
(2,772 Views)