From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DataSocket in 64 bit application.. (needed for OPC client)

Hi,

 

I asked this some time ago but no reply.. So I try again.

 

The target is to make an OPC server client connection by using the DataSocket as described in NI documentation.

 

But now there is the following error when running our SW in 64 bit mode:

 

Additional information: Could not load file or assembly 'NationalInstruments.Net, Version=15.0.45.49153, Culture=neutral, PublicKeyToken=4febd62461bf11a4' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

Is it possible that NationalInstruments.Net assembly has only a 32 bit version?  At least in my PC it is only in 32 bit GAC. We prefer a 64 bit application..

 

 

BR,
Ilkka

0 Kudos
Message 1 of 4
(4,258 Views)

Hi Ilkka,

 

From the following link, it seems that you cannot use the datasocket for a 64bit OS:

 

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/64bitsupport/

 

So the only way is to stay into a 32bit mode.

 

Hope that is helping! 

Certified LabVIEW Architect (CLA)
0 Kudos
Message 2 of 4
(4,242 Views)

Hi Jean,

 

Thanks for the clarification.

 

Yes.. the only way is to stay in 32 bit mode.. Or maybe the 32 bit code can be isolated into own process. It is already in own in-process assembly (dll) but now I need to make own exe and then some communication mechanism.. 😉 Or..

 

br,

Ilkka

0 Kudos
Message 3 of 4
(4,238 Views)

Hi,

 

This is now the solution.. works fine. 64 bit application and 32 bit Windows service which encapsulates the 32 bit NationalInstruments.Net library.

 

wcf.png

 

The communication link is based on WCF (Windows Communication Foundation).

 

br,

Ilkka

0 Kudos
Message 4 of 4
(4,224 Views)