LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Would like help integrating hardware with the Continuous Measurement Data Logger template program

Solved!
Go to solution

Hello. I am very new to LabVIEW but not to programming. I just need something very simple and I'm sure you guys can help. I have a LakeShore Teslameter that has a usb connection. Would very much like to quickly get the "Continuous Measurement Data Logger" template program that ships with LabVIEW to work with this device. Secondly I was wondering how I can automatically have the program export to an excel spreadsheet when the "Stop" Button handler is called. a54fae8583ab2eddffe3cf49586464a4.pngc2b5834f82daaf525de09873ef0bf2e2.png

As you can see I have the template program block diagram here and have placed a "Write Delimited Spreadsheet" Function block inside the block of code that gets called when stop gets pressed. Question is, how do I link the data that was logged to this thing? Sorry to come off as a cowboy but this is the way I learn the best.

0 Kudos
Message 1 of 8
(2,178 Views)
Solution
Accepted by crash_override

The hardest part is probably going to be getting the right drivers for your instrument and getting LabVIEW to talk to it. Outside of National Instruments (and maybe some other big companies like Agilent, Tektronix, etc.) it is unlikely that most forum contributors will be familiar with your hardware. So the first step will be writing a tiny LabVIEW VI to communicate with your instrument, and eventually putting that into a loop to collect data continuously.

 

I think that template is not what you are looking for. That has 4 loops, and you can probably do what you want with 1 loop, and only add a second if you really need it. I would start with some kind of a state machine.

 

Regarding "export[ing] to an excel spreadsheet": A text spreadsheet is not the same as an Excel spreadsheet. The function you have dropped will simply write text data with the delimeter of your choice. If you really need an Excel file, you should use the report generation functions. I prefer text files for almost all of my applications. You have also dropped that VI into a "conditional disable structure". The case you have shown is what gets run when using the runtime engine (this is once you have built an executable, not when running code in the LabVIEW development environment).

Message 2 of 8
(2,133 Views)
  1. That really helped put me in the right direction thank you. Writing my own code is going to be a lot easier than trying to understand all that right now. I think the drivers are on their website but also in the manual it says windows update will grab them automatically. Thanks again.
0 Kudos
Message 3 of 8
(2,114 Views)

You're welcome. I think LabVIEW programmers use the word "driver" in multiple senses. One way is the underlying driver that Windows needs to talk to the device. Another way is LabVIEW functions that wrap up the low-level calls so we don't have to worry about it. 

 

You can check here to see if someone has written LabVIEW functions for your instrument: http://www.ni.com/downloads/instrument-drivers/

 

Otherwise, hopefully your instrument has a well documented programmer's manual that you can use to get started.

0 Kudos
Message 4 of 8
(2,071 Views)

Oh I understand. I sure hope I don't have to write a whole driver, that might make this insurmountable for me. I have followed this person's video https://www.youtube.com/watch?v=sZ1R6_kDvO0

Where he reads some floating point numbers from his arduino device through a usb port. I was hoping that this will be as simple but now that you say that it might be crazy difficult.

0 Kudos
Message 5 of 8
(2,052 Views)

Update, oh but yes there is drivers already for the LakeShore f71! Yay!

0 Kudos
Message 6 of 8
(2,050 Views)
Solution
Accepted by crash_override

@crash_override wrote:

Hello. I am very new to LabVIEW but not to programming. I just need something very simple and I'm sure you guys can help. I have a LakeShore Teslameter that has a usb connection. Would very much like to quickly get the "Continuous Measurement Data Logger" template program that ships with LabVIEW to work with this device. Secondly I was wondering how I can automatically have the program export to an excel spreadsheet when the "Stop" Button handler is called. 


Well I have headed down that path and in the end it took less time to start from scratch then to figure out how to decouple that NI example. Everything in it is so tightly interlocked it was impossible to change it to use any of my instruments.

 

Continuous measuring, logging, and saving data is one of the simplest tasks LabVIEW can do and this example severely over complicates the process.

 

Unless you are using a high speed DAQ that require a Producer/Consumer architecture, a simple state machine is all you need...

 

Possible states could be:

  1. Initialize instruments
  2. Open data file
  3. Take measurements
  4. Display/Save data
  5. Timer (goto 3 when time elapses)
  6. Error (safe shutdown on error)
  7. Exit (close file and exit)

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 8
(2,011 Views)

This is also very helpful. I have found some code from the LakeShore people and I just have to add a few of those steps to it.

0 Kudos
Message 8 of 8
(1,974 Views)