Example of VB 2017 Windows App Code Snippet? | LabJack
 

Example of VB 2017 Windows App Code Snippet?

2 posts / 0 new
Last post
martywittrock
martywittrock's picture
Example of VB 2017 Windows App Code Snippet?

Howdy,

The U3-HV examples that can be downloaded from the LabJack site have great examples of VB that works in .NET, but they aren't Windows Application examples, they appear to be Server VB apps and it doesn't allow me to do any charting or graphing of the LabJack analog in a Chart window on the VB Form GUI. I want to be able to graph real time analog of temperature as an analog input of one of the LabJack analog I/Os but I want to write all the code in a Windows Application app and not Console or Server. There also appears to be a difference in how the LabJack is instantiated in a Windows App than in Server (from the example I used 'Simple U3'). I cannot use the same code because the Import statement and the other code to instantiate the LabJack is different in a Server App. I can get all my code to work from the 'Simple U3' example - compiles and runs fine as downloaded but once I try to copy that working code into a VB 2017 Windows App development the VB 2017 Windows App does not recognize the LabJack Import or the instantiation that happens immediately following.

I guess what I'm looking for is a real good example (not psuedocode) of VB 2017 (.NET) Windows Application of anything simple that instantiates the LabJack U3-HV and does some pulls and pushes of the digital and analog data from it - that would really help me get my application off the ground because charting/graphic is central to that.

Thanks in advance for your help with this,

Marty

martywittrock
martywittrock's picture
As it turns out, I have

As it turns out, I have answered my own question but plan to at least post about what I found. I found that there is a 'References' part of the Windows Application source files and I needed to add a reference to the LabJack DLL 'LJUDDotNet.dll' that is located in 'C:\Program Files (x86)\LabJack\Drivers'. Once I installed that reference I was able to import ALL my good code out of the non-Windows App (I think it was a Server App) and it all compiled perfectly and ran with my LabJack U3-HV' I then pulled in the Chart Utility from the Toolbox and now implementing that code along with the Analog Input data pulls from my LabJack to make to appropriately chart the data on the form. More on that later...

Marty