Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Bertec force plates with .NET

Solved!
Go to solution

Hello community,

I am trying to connect a Bertec force plate to labview using the .NET interface. 

 

This involves loading  "BertecDeviceNET.dll" into labview. This DLL comes from the Bertec website,  and downloading the most recent "Bertec Device SDK" from May 2014.

 

I know this is possible, as it has been done before. See these posts:

https://forums.ni.com/t5/LabVIEW/Is-there-a-simple-way-in-LabVIEW-to-collect-data-from-two/td-p/1736...

https://forums.ni.com/t5/Digital-I-O/Bertec-force-plates/td-p/2532076

 

I've tried following the solutions listed, and feel optimistic about things. Except I can't seem to be able to load the .NET DLL into labview. It keeps telling me "An error occurred trying to load the assembly" and then I can't proceed.

 

I am using the 32-bit version of the DLL, and the 32-bit version of Labview 2017. The DLL is in the same local folder as the labview VI. I've tried loading it into Labview 2015, and 2016, both 32 and 64 bit versions (the Bertec SDK has 64 bit versions as well). But no luck. 

 

I'm not sure what to do next. It might be that Bertec's DLL is just bad, but I'd be surprised Bertec didn't catch that yet, as the SDK was released in 2014.

 

Is anyone else able to load the DLL? If so, what am I doing wrong?

 

 

0 Kudos
Message 1 of 9
(3,524 Views)

Also, when I say "load the DLL into labview", I am referring to simply creating a "Constructor Node" from the .NET palette on my block diagram.  I then browse to BertecDeviceNET.dll and select BertecDevice, then I get the error that it can't load the assembly.

 

I am hoping that someone else in the NI community can try to load the DLL in a constructor node (You don't need a force plate to load the DLL). Then at least I will get some feedback as to what to do next.

0 Kudos
Message 2 of 9
(3,480 Views)

Hi saacuna,

 

I tried loading it both on LabVIEW 2017 and in LabVIEW 2014 (both 32-bit), with the same result as you experienced. I'm not sure what might be happening. I noticed in the readme that there is a contact that you could reach out, and see if this is a known error.

Message 3 of 9
(3,461 Views)
Solution
Accepted by topic author saacuna

Thanks for confirming the issue with the DLL! Glad to know I wasn't the only one.

 

Like you recommended, I contacted the person specified in the readme file and he was very helpful. They were also able to replicate the issue on their computers. They are now updating their SDK and it should be available next quarter. He did send me a beta version, and I was able to successfully load the DLL into LabVIEW 2017 64-bit (but not 32 bit). 

 

So for now I am good to go. Thanks for the help.

 

0 Kudos
Message 4 of 9
(3,433 Views)

Hi Saacuna,

 

I received the beta version from Todd, but I'm still not able to load the .NET assembly. I have tried both the 32 and 64 bit versions and have saved my VI in the folder containing the .NET assembly. Saacuna could you explain how you were able to load the assembly successfully?

 

Regards,

Daniel

0 Kudos
Message 5 of 9
(3,370 Views)

Hi Daniel,

I was only able to load the DLL assembly using the 2016 64-bit version of LabView. In the beta version from Bertec, I copied the file "BertecDeviceNET.dll" located in the "x64" folder into the folder with my VI. In LabView, I simply placed a Constructor Node (using the .NET palette) on the block diagram and then found the .DLL in the pop-up window. It doesnt give me an error here, so thats what I mean by successfully "loading the DLL" into LabView.

 

As for actually building the VI to collect force plate data, I haven't gotten to finishing that yet, I've been working on other projects. But it seems feasible. I got held up because the new version of the library has different functions and they havent written the documentation for that yet. So I am waiting until then before I get back to this project. However, it seems possible and I might be able to figure it out if I played around with it enough.

 

One thing I would also try is seeing if you can collect force plate data from the command line using the example code. If you try the command line "BertecExampleNET.exe -f test.txt -t 10 -c" . You should be able to collect 10 seconds of data in the file text.txt. If that is not working, then there is something else wrong going on. Also, if you hit up Todd at Bertec they are very helpful in trying to figure all this stuff out.

 

0 Kudos
Message 6 of 9
(3,363 Views)

Hi Saacuna,

 

Thank you for the response. I've tried the 32-bit and 64-bit using the code Todd sent me without any luck. How do I run the sample code command line?

0 Kudos
Message 7 of 9
(3,359 Views)

After you connect the Balance Plate with the USB cable, navigate to the bertec folder in the command prompt (by running "cmd.exe"). To navigate to folders, use the term "cd", as shown here. Once you are in the the folder with the file "BertecExampleNET.exe", just type in this line:

BertecExampleNET.exe -f test.txt -t 10 -c

If it doesn't work, or if you type incorrect parameters, then it will just display the help menu.

Good luck. If you are still having trouble, I would contact Todd directly.

Message 8 of 9
(3,348 Views)

Hi Saacuna,

 

I followed this tip posted on the NI website and the assembly is loading now. Thank you for your help.

 

Tip: In Windows 7 or later, you also can right-click the assembly and click Unblock on the General tab to grant an assembly full trust.

0 Kudos
Message 9 of 9
(3,311 Views)