From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

how to save data for a certain period of time automatically

Hello everybody!

I am a new user of LabVIEW and I am trying to make a program using LabView 2015 that automates the calibration of thermocouples using the Fluke 914X device and a National Instruments acquisition board. I have already been able to make serial communication between the fluke device, and also to set temperatures, and read the bath and reference temperatures of the device. However, my program should work as follows: the user sets an initial temperature, which the bath should reach. Once the reference temperature of the bath is equal to the setpoint temperature set by the user (0.1 accuracy), the program should start saving the thermocouple data acquired by the National board. Since the program should work automatically, I would like this data to be saved in an excel sheet for 2 minutes, and then, after saving that data, the program should raise the setpoint temperature by 5 ° C until the temperature end is 120 ° C, then the program stops. As a beginner in LabVIEW I am having difficulties in the order of the blocks, and also how to be able to stop saving the data automatically and move to the block that will increase the setpoint temperature. Could you give me any hints on how to implement this? The program I have so far is attached.

0 Kudos
Message 1 of 4
(2,981 Views)

You will help yourself a lot in developing LabVIEW code if you:

  • look for repetition and replace it with a For or While loop (example -- building the header string)
  • look for appropriate functions to "do the work for you" (check out "Write Delimited Spreadsheet File")
  • "bury the details" inside (many) sub-VIs (e.g. create Open Serial, Write Serial, Close Serial VIs)
  • strive to keep all of your Block Diagrams to one screenful (the previous step of writing many sub-VIs helps a lot in doing this).

The virtue of the last point, having all Block Diagrams fit on a page, means your code is "visible" at a glance, with details hidden.  One thing you should do if you do follow the third suggestion is to create, at the very least, a simple Icon consisting of a box and 2-3 lines of text that describes what your VI does.  You do this with the Icon editor, which you activate by right-clicking the Icon while coding your sub-VI and choosing "Edit Icon".  One thing you may have to do the first time you open the Editor is to "turn on" the Layers tab -- if you only see tabs called "Templates", "Icon Text", and "Glyphs", click "Layers" on the Menu Bar and choose "Show Layers Page".  Now click the Layers Tab, click the VI Icon, and click the X to delete it.  Now over on the Tools on the right, choose the Filled Rectangle and make one that fills the entire space (I suggest Black for the border, White for the interior).  Now choose the Icon Text tab, type 2 to 4 short text lines ("Open", "Serial", for example), and when you get what you like, click "OK" (under the Icon image).  Note that on the Text page, I like to use Small Fonts, Center alignment, and 10 point type, with Center Text Vertically checked and Capitalize Text not checked (these settings will "stick", so you only need to "do it once").  This is what you should get:Icon Example.png.  When you place this sub-VI on your main Block Diagram, it will take very little space (32 x 32 pixels), and the Icon describes just what it is that takes place inside this sub-VI.

 

Once you get things slightly smaller and able to comprehend, you should be able to figure out how to save data for a certain period of time.  You can either (a) figure out the rate you are saving and divide that into the time you want to save to compute the number of saves you have to make (i.e. the "N" for a For loop) or (b) use a Timing VI (such as Elapsed Time) to compute when to exit a While loop doing the saving.

 

Bob Schor

 

0 Kudos
Message 2 of 4
(2,953 Views)

Hello 

0 Kudos
Message 3 of 4
(2,922 Views)

Well, a look at your revised, "smaller" Block Diagram so I can better understand what you mean and what you want to do would certainly help me to help you ...

 

Bob Schor

0 Kudos
Message 4 of 4
(2,907 Views)