NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

DataSocket Step type

Hi RedFoot,

I downloaded the secuence file and the CVIBuild.zip and ran the executable. I was unable to recreate the errors you are experiencing. There are a few things we can look at now. First, check your settings in the datasocket manager. Let me know what these settings are. Also, when you open the TSDataSocket.cws what files do you see in the file tree? I think you may be missing a file that is needed. Also, let me know the exact steps that you went through when downloading and configuring the program so that I can try and recreate the behavior here.

Caroline
National Instruments
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 11 of 16
(1,479 Views)
Caroline: thanks for the reply.
My DS Manager settings are : maxconnections=50, maxitems=200, dfltbuffermaxbytes=26214400, dfltbuffermaxpackets=1, defaultreaders=everyhost, defaultwriters = (localhost, and the IP of a test set computer), creators = (localhost, and the IP of a test set computer).
I went back to the original posted download and installed the files per the readme, except for Install_NI_DataSockets.init, which went into \TestStand 3.1\Components\User\TypePalettes instead of where the readme said (which was under Cfg, I think).
When I tried to rebuild the DLL, CVI couldn't find the file dataskt.h, so I redirected it to \CVI71\toolslib\datasock\dataskt.h. The DLL then built OK. Still get the error when I try to 'Config URL' however. I'm not even trying to run the step anymore until I get the Config URL error straightened out.
Here's what the file tree looks like under CVI71: Instrument Files:SessionMgr.fp, tsapicvi.fp, tsutil.fp. Source Files: TSDataSocket.c. Include Files: dataskt.h, TSDataSocket.h. User Interface Files: TSDataSocket.uir.

Thanks again, Kevin Redmond
0 Kudos
Message 12 of 16
(1,469 Views)
OK, I feel stupid. My problem started when I recompiled the downloaded DLL. I recompiled as debuggable code. I didn't realize that this would cause error dialogs to pop up whenever any error occurred, both fatal and non-fatal. The datasocket code is written to utilize or ignore various intentional error conditions. An example is in TSDataSocket::TSDS_ReadWrite() at about line 129 (in the case of datasocket read). The non-fatal error at this point is used to flag the need to connect to the datasocket server, as is alluded to in the comments around line 113. Once I recompiled as release code all the error dialogs went away.

Oops. Kevin
0 Kudos
Message 13 of 16
(1,459 Views)
Hi Kevin,

Well Im glad everything seems to be working now.

Thanks,
Caroline
National Instruments
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 14 of 16
(1,453 Views)
I've got a new problem. I'm trying to modify the datasocket-reading code to read an array of doubles from the DS server and send back to TestStand. I've declared an array of doubles but when I try to use DS_GetDataValue() to read the data from the DS server (which I know to be present) I get the error "The Variant does not contain a Safe Array. -2147220986; User-defined error code.". It appears that DS_GetDataValue() wants me to pass a pointer to a thread-safe array but how do I declare such an array and how do I then get values out of it to send back to TestStand? The code uses Session Manager which may be the originator of the error msg but it's not obvious how to make it happy from reading Session Manager Help . Kevin
0 Kudos
Message 15 of 16
(1,443 Views)
Hi Kevin,

So it sounds like you just need to convert the array you already have to a safe array. There is a function in the ActiveX library of CVI that is called C Array to SafeArray Conversion. This should stop the error from happening. When it comes to passing the values to TestStand, you will need to convert the safearray back to an array using the reverse of this function called SafeArray to C Array Conversion. You can then pass this array back to TestStand.

Thanks,
Caroline
National Instruments
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 16 of 16
(1,428 Views)