C#, VB.Net Examples (Windows UD)
C# and VB .Net examples for the UD library. Refer to the text file in the zip for more information.
File attachment:
Software & Driver
- 3rd Party Applications
- Applications
- Programming Resources
- LJM Library
- UD Library
- Example Code/Wrappers
- DAQFactory Examples (Windows UD)
- DASYLab
- Delphi (Windows UD)
- C#, VB.Net (Windows UD)
- Igor Pro (Windows UD)
- Java (Windows UD)
- LabVIEW (Windows UD)
- LabWindows/CVI (Windows UD)
- MATLAB Examples (Windows UD)
- PureBasic (Windows UD)
- Python (Windows UD, Mac, Linux)
- C, C++, VC6 (Windows UD)
- VEE (Windows UD)
- Visual Basic (VB6, VBA, Windows UD)
- User's Guide
- Archived/Barebones Versions
- Example Code/Wrappers
- U12 Library/Installer
- Exodriver (Mac & Linux)
- Alternate Interfaces
- Misc. Utility Apps
Search
Shopping Cart
Testimonials
-
I'd like to compliment you on your nicely-written native LabVIEW
drivers; we're customising them to our own ends, but they're a nice
neat starting point—unlike a lot of other people's code! [...] By the
way—excellent table of contents in the PDF Manual—why can't everyone
do that?! [...] Very much enjoying working with the LabJacks—and
looking forward to using them for other jobs.—Tom, CPP Wind Engineering

Comments
#1
I've hit a roadblock trying to use C# VS Express 2012 for Windows Desktop. I installed the U3-HV on my Microsoft surface (Windows 8) and it works beautifully with the labjack apps. I have tried many of the C# examples and all behave in the same manner.
As soon as the code hits the LJUD.eput statement, I get:
"An unhandled exception of type 'System.AccessViolationException' occurred in LJUDDotNet.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Any suggestions would be appreciated.
#2
What parameters are being passed to the ePut call?
The first thing you should check is to see if it is a generic issue or one specific to the architecture. In VS 2012 Express you should check the build properties for the project and see what the target is. If it is "any cpu" then it will run as 32-bit or 64-bit depending on the system. You should try forcing it to 32-bit (x86) or 64-bit (a64) and see if you get the issue in only one, or both situations. With that info we can help you debug it further if you email us at support@labjack.com
#3
Thanks, 64/32 was the problem. I actually found it in another post late that night. Might be worth a note in the install materials since there are more of us finally using 64-bit stuff. (of course that would mean that I would have to read it.... ;-) Cheers, R
btw, this site does not play well with IE10. Editing and saving is a problem... Firefox is fine.
#4
Hi there,
when running the VB.net DAC program I get an error 69 -comunication with the LJTDac module, wrong number of acks recieved. wrong number of AKS.
Any ideas.... the control panel works ok.
James
#5
Does the LJTDAC test utility work? I suggest you continue these troubleshooting details on our forum.
#6
Yep the test tool works fine.
when I try and enter any number in the DAC0 or DAC1 field that is what I see.
#7
You mean "DAC A" and "DAC B"? If you see "DAC0" and "DAC1" you are likely looking at the test panel in LJControlPanel, not the LJTDAC test utility.
I encourage you to use the forum for further troubleshooting, rather than comments on this page.
#8
Hi
I have a LJU3-HV which has been installed successfuly on a Windows Vista 64 machine (The test Control Panel utility can read and write to all inputs) but I'm having trouble with the .Net examples as neither the example VB nor the C versions will run in VS2010.
The error generated is: "Unable to load DLL labjackud.dll. The specified module could not be found". I ran a Windows search for "labjackud.dll" and it confirmed that the file doesn't exist on my system.
Any ideas? Please help!
Simon
#9
If the LJControlPanel works then LabJackUD.dll should be on the system. It would either be in C:\windows\system32 or C:\windows\SysWOW64.
Most likely with this error, the issue is building for the wrong version of the .dll. Since LJControlPanel works, that means that the 32-bit version of the .dll is likely in the SysWOW64 folder. 32-bit programs can then run and use this version of the .dll. Since the program is not finding it, it's likely that the program is a 64-bit program and looking for the 64-bit version in the System32 directory.
There are two fixes to this. The first (most common and easiest) is to change the build options for the project, and set the target architecture to x86, which will force a 32-bit application. This is often set to "any architecture" which will compile as 64-bit on 64-bit machines and 32-bit on 32-bit machines. That change should fix the problem.
The other fix is to place a copy of the 64-bit version of the .dll into the system32 directory. You can find information on doing that here.
#10
Hi Paul
Thank you so much for the reponse - "fix 1" sorted out the problem immediately - I can now get down to some serious fun!
Thanks again!
Simon
#11
AIN resolution in U6 C# examples updated December 27, 2010
I2C C# examples updated December 28, 2010
Minor revisions December 29, 2010