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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C# dll of static functions in LabVIEW 2011

Hello.

 

My objective is to communicate with a PICkit Serial Analyzer withinin LabVIEW 2011, or confirm if this is not impossible.

 

I would like to import functions for use in LabVIEW from a C# dll with static functions. These functions do not use controls. This is the PICkit Serial Analyzer's "PICkitS.dll", located at 

 

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en028600

with documentation at 

http://ww1.microchip.com/downloads/en/DeviceDoc/PICkitS%20Function%20Prototypes%20v2-4.pdf

 

When I try to import this dll using <Tools->Import-> Import Shared Library>,  I do not have a header file because this is written in C#.

When I try to import this as a .NET assembly using <Tools->Import->.NET controls to palette>, I am told that "This assembly contains no public controls", which makes sense because the dll does not contain anything defined as a .NET control, and I cannot hit OK.

 

The source for this dll is not available to me.

 

A similar issue is located at 

http://forums.ni.com/t5/LabWindows-CVI/Call-functions-in-a-NET-DLL/td-p/1032686

which is for LabWindows/CVI. I do not know what LabWindows is and I don't know if the solution in there can be replicated in LabVIEW.

 

In short, I cannot figure out how to use the API made available by Microchip for the PICkit Serial Analyzer in LabVIEW.

 

What are my options, or what might I be doing wrong? What is the best and fastest way of getting these static functions available in LabVIEW 2011, if there is one?

 

 

0 Kudos
Message 1 of 7
(4,553 Views)
0 Kudos
Message 2 of 7
(4,534 Views)

Hi,

 

i have problems with the microchips pickits.dll, too. I would like to implement the dll-File in Labview.

When I run my Labview VI, it can`t communicate with the device. My device is the LIN Serial Analyzer from microchip.

This is my composition in Labview which doesnt work.

LIN_SERIAL_ANALYZER.jpg

This composition is created on a WIN7/64bit OS and on a WIN XP/32bit system. Both doesnt work.

Do anyone work with the LIN Serial Analyzer or similar devices from microchip?

 

regards

0 Kudos
Message 3 of 7
(3,813 Views)

Hi,

 

This sounds like it may be a problem with your connection between the LIN Serial Analyzer and your computer and not so much an issue with LabVIEW and calling DLLs. Have you troubleshooted the physical connection to see if you can communicate with the device through other means?

0 Kudos
Message 4 of 7
(3,774 Views)

Hi,

 

thank you for your answer. I don`t think it`s a physical connection problem, because the Analyzer runs with the microchip demo application Network Analyzer(64bit). I have downloaded the LIN Serial Analyzer Update v2.05 (64-bit) from the microchip homepage and with this application it works.

I use the pickitS.dll in Labview and it doesn`t work with the device. The pickitS.dll works inside LabView correct. When I run the Function Prototype "Get_PickitS_DLL_Version", it returns the correct DLL Version.

Is my composition in LabView right? I have only the 32bit version of the pickitS.dll file. Is it possible, that I need the 64bit version of the pickitS.dll for the Win7 64bit OS?

 

regards

0 Kudos
Message 5 of 7
(3,739 Views)

Hi joisef,

Feel free to make a new forum thread for your problem. Due to the way our forums work, you will receive help more quickly if you create a new post for your problem as the post will be more visible. 

Charlie J.
National Instruments
0 Kudos
Message 6 of 7
(3,703 Views)

Hello,

 

i have solved the problem. For Initialisation of the LIN Serial Analyzer, you have to take the "Basic" Constructor and the method "Initialize_MyDevice" with the parameters USBIndex = 0 and ProductID = 0xA04. With this basic setting you can initialize the device. Following you have to set the baudrate to 19200 for LIN Bus.

Feel free to ask me if you have problems with your device.

 

 

 

 

0 Kudos
Message 7 of 7
(3,636 Views)