Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket executable without RT Engine

Solved!
Go to solution

Hello,

 

I have created a simple application that reads datasockets from datasocket server using Measurement Studio for C++. It works fine on the machine where NI Measurement Studio is installed. However, when I move the executable to another machine without NI Measurement Studio, the application crashes.

I have fixed this problem by installing Labview RT engine. However, the size of RT engine is quite large (160 Mb) and, therefore, it is quite inconvenient to install RT engine on every machine where there is a need to read datasockets.

 

So, the question is:

Is it possible to create executable that can read datasockets on any machine without RT engine?

I have a feeling, that, maybe, this can be done by creating dll that encapsulates all neccessary libraries needed to work with datasockets. However, when I create dll, I still can't run the executable. The size of dll file is only 72 Kb  - it seems that dll doens't encapsulate NI libraries.

 

The code of my dll header:

 

#if defined DLL_EXPORT

#define DECLDIR __declspec(dllexport)

#else

#define DECLDIR __declspec(dllimport)

#endif


#include <afxwin.h>         // MFC core and standard components

#include "NiDataSocketComponent.h"

#include <vector>
enum code{OK = 0, CONNECTIONERROR};

using namespace NI;
class DECLDIR DSRead 

{

public:

DSRead();

code Connect(char* url);

code Disconnect();

void DataUpdatedEventHandler (CNiDataSocketData &data);

void StatusUpdatedEventHandler(long status, long error, const CString &message);

std::vector<std::vector<double>> getData();

private:

CNiDataSocket m_DataSocket;

std::vector<std::vector<double>> data;

CNiDataSocket::ConnectionStatus connectionStatus;

};

 

 

0 Kudos
Message 1 of 3
(5,799 Views)
Solution
Accepted by topic author mkalinkin

Hi mkalinkin,

 

I hope are you doing well today!  I have attached two KnowledgeBase articles that have some more information on how to create and distribute executables using Measurement Studio efficiently as well as distributing DataSocket controls.  If you note, the KnowledgeBase article titled How Do I Distribute Measurement Studio Applications/OCX Files?, you must run the DataSocket installer on the target machine for DataSocket controls to work properly.  As you have mentioned, and as is noted in the second KnowledgeBase article, the DataSocket installer is installed with the LabVIEW Runtime Engine.  Therefore, in order to use DataSockets, you must have the LabVIEW Runtime Engine installed on your deployment machine.  I apologize for any inconvenience, but I hope this helps!  Have a great day!

 

KnowledgeBase 1VCARL8M: How Do I Distribute Measurement Studio Applications/OCX Files?

 

KnowledgeBase 399MDV0U: Installing the Latest Version of DataSocket and DataSocket Server?  

 

Taylor G.
Product Support Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 3
(5,786 Views)

Hi Taylor,

 

Thank you very much for the clarifications!

Now I see that installing Labview RT Engine is the only way to make datasocket executable running on deployment machine.

Have a nice day!

 

Mikhail.

0 Kudos
Message 3 of 3
(5,778 Views)