There are many different ways to move data from NI LabVIEW software into Microsoft Excel. Each method has advantages and drawbacks, so we’ll explore some of the available options to help you find the right one for your application.

Comparison Table

Export
TDMS File
CSV File
Report Gen.
DIY ActiveX
NI DIAdem
Interactive

Programmatic

1

Custom formatting

Works without Excel being installed

Automatically saves metadata

Requires additional software

2

3

4

File based transfer

Automation interface transfer

1 data can be sent to Excel programmatically but requires manual action to save the file
2 requires the TDM Excel Add-In for Microsoft Excel – free to download and installs with recent versions of LabVIEW
3 requires the NI LabVIEW Report Generation Toolkit for Microsoft Office
4 requires DIAdem

Export to Excel Right-Click Menu

The easiest way to get visible data from LabVIEW into Excel is by right-clicking on the front panel indicator that is displaying the data you wish to export and selecting Export»Export Data To Excel.

[+] 크게 보기

You can use the Export Data To Excel method with any graph, chart, table, array, or digital data control. Graphs and charts export only the visible data, meaning you can use the graph tools to zoom in on a region of interest and export only the data you care about. Tables export only the currently selected data, whereas arrays export all of the data in the array.

You can also use an Invoke Node to programmatically call the Export Data to Excel and Export Plot Data To Excel methods. The following code snippet graphs a generated sine wave and then exports the plot data to Excel twice in order to show the two different methods. The difference between the two methods is that the Export Plot Data To Excel method exports only the specified plot, whereas the Export Data to Excel method exports data from all plots. This simple example has only one plot, so both methods yield identical results.


If you use this technique, note that Excel must be installed on the same machine as LabVIEW and there is no programmatic access to save the Excel file. Consequently, this approach is best suited to applications where you are interactively investigating data and looking for a quick way to send the data to Excel for analysis or distribution.

Note: The Export To Excel feature was introduced in LabVIEW 2010 and is not available in earlier versions.

Save to TDMS File

NI defined the Technical Data Management Streaming (TDMS) file format in response to the need for a fast, efficient way of saving well-documented measurement data. Although TDMS is not natively supported by Excel, there is a free Excel add-in that you can use to import your data into Excel.

The easiest way to create a TDMS file is to use the Write To Measurement File Express VI located in the File I/O palette.

As with all Express VIs, you will see a configuration dialog when you drop the VI on your block diagram. This particular Express VI can save to more than just TDMS, so be sure to select Binary (TDMS) in the File Format section. You have several options for how to save the file and what to do when the selected file already exists.


[+] 크게 보기

You can save to a series of files using a time- or file-size-based schedule by clicking on the Settings… button.


[+] 크게 보기

This results in a very simple block diagram:

LabVIEW also provides an API for writing to TDMS files without using the Express VI for those who prefer more manual control.

Once you have some data stored in a TDMS file, you need to make sure you have the TDM Excel Add-In for Microsoft Excel. You may have installed the add-in when you installed LabVIEW, if not, you can always download it for free. With the add-in installed, you can simply right-click on a TDMS file and select Open With»Excel Importer, then Excel opens and displays your data.

The first worksheet in Excel always contains the file properties and other metadata.


[+] 크게 보기

Each group of channels is loaded as a separate worksheet and each channel of data is shown in its own column.


[+] 크게 보기

Once the data is in Excel, there is no dependency or link back to the original TDMS file (although the original file can be recreated using the ExcelTDM DataPlugin in either LabVIEW or DIAdem), so you are free to share your workbook with any Excel user.

Save to CSV File

The comma-separated values (CSV) file format is widely supported, so you can open the file in Excel, but also import it into other spreadsheet, database, or analysis tools. CSV files are human-readable text files with columns separated by commas and rows separated by newlines. This normally requires us to do a little data manipulation in LabVIEW to get the measurement data into an appropriate format because we cannot use complex data types such as waveforms, nor can we store numbers in the more efficient binary formats used internally by LabVIEW and TDMS files.

You can use the Write To Spreadsheet File VI, found in the File I/O palette, to create CSV files to open in Excel.

For a simple 1D array of numbers, you don’t actually need to do any additional processing. By default, the Write To Spreadsheet File VI uses a tab (/t) as its delimiter so you just need to specify a comma (,) as its delimiter instead.

A more complex example involves writing the data returned by an Express VI, such as the DAQ Assistant or Simulate Signal, to a CSV file with time in one column and the measured value in the next. The code snippet below shows how you might convert the dynamic data into an array of waveforms; then and then for each waveform in the array convert all of the measured values to strings; then formulate a time string for each sample; and finally build a 2D array of these strings to pass to the Write To Spreadsheet File VI.


[+] 크게 보기

You can open the CSV file with Excel and you will see your data correctly split out into columns and rows.


[+] 크게 보기

If you use the code snippet above, Excel will understand your timestamp, but probably won’t format it in a useful way – it’s unusual to deal with seconds and fractions of seconds in the business world that Excel was created for. To fix this, you have to format the cells containing time data with a custom format as shown below.


[+] 크게 보기

One of the drawbacks is that you cannot save this formatting information in the CSV file so it must be manually repeated every time you bring a new file into Excel. Although once in Excel, you can save the data as an Excel file to preserve the formatting for subsequent use.

Report Generation Toolkit for Microsoft Office

The NI LabVIEW Report Generation Toolkit for Microsoft Office gives you a lot of flexibility when it comes to sending data to Excel. One of the big advantages is that you can create a template workbook in Excel and save it as an .xltx or .xlt file and then use LabVIEW to populate your template with data when your VI runs. This code snippet shows how you can use the MS Office Report Express VI to populate such a template.


[+] 크게 보기

When you create the template, you can customize the formatting just like any other Excel workbook. You then name the cells where you will put data (for tables or arrays you just need to name the top-left cell).


[+] 크게 보기

Once created, you point the Express VI to the template and tell LabVIEW how you would like the data to appear in the report (either as a table or graph) and whether you want to open, save, or print the Excel file.


[+] 크게 보기

Running the code snippet above produces the output shown below. This is a very simple example of what you can do with this approach – as the name suggests, the Report Generation Toolkit is often used to automate complete reports instead of just sending simple data to Excel.


[+] 크게 보기

In addition to the Express VI, the Report Generation Toolkit gives you a full API you can use to automate Excel. The example code below creates output similar to the example above but does not require a template workbook. Also, instead of using an image of a LabVIEW graph, it uses the Excel charting tool to draw a graph.


[+] 크게 보기

Running the above example yields the following output:


[+] 크게 보기

DIY ActiveX/.NET

The Report Generation Toolkit is built on top of the Excel ActiveX interface. You can use this API either through direct ActiveX calls or the Microsoft.Office.Interop.Excel .NET assembly to automatically create Excel files. The code snippet below produces essentially the same result as the Report Generation Toolkit example but instead uses a .NET interop assembly to communicate with Excel. As you can see, the code ends up a little more complex but anyone with a background in ActiveX/.NET programming should feel right at home.


[+] 크게 보기

Here is the output of the above code snippet:


[+] 크게 보기

DIAdem as an Alternative

If you have more advanced data needs, whether it be larger datasets, an abundance of files, or particular reporting requirements, you should also consider DIAdem. DIAdem is a tool for quickly locating, analyzing, and reporting measurement data and is often better suited to the many demands engineers have of their data tools.

To learn more about gaining productivity by using DIAdem rather than Excel, read more.

:: 자료 출처 : http://zone.ni.com/devzone/cda/pub/p/id/1339?metc=mt4krj

'LabView > E.T.C' 카테고리의 다른 글

UI 관련 자료  (0) 2011.06.22
5월 챌린지 1등 수상작~~  (0) 2011.06.22
Accelerometer overview  (0) 2011.06.09
특정문자 원하는 문자로 바꾸기  (0) 2011.05.27
CLAD 자료  (0) 2011.04.27
Posted by 도전대박

UI 관련 자료

LabView/E.T.C 2011. 6. 22. 10:41

'LabView > E.T.C' 카테고리의 다른 글

Moving Data form LabVIEW Into Excel  (1) 2011.07.19
5월 챌린지 1등 수상작~~  (0) 2011.06.22
Accelerometer overview  (0) 2011.06.09
특정문자 원하는 문자로 바꾸기  (0) 2011.05.27
CLAD 자료  (0) 2011.04.27
Posted by 도전대박

'LabView > E.T.C' 카테고리의 다른 글

Moving Data form LabVIEW Into Excel  (1) 2011.07.19
UI 관련 자료  (0) 2011.06.22
Accelerometer overview  (0) 2011.06.09
특정문자 원하는 문자로 바꾸기  (0) 2011.05.27
CLAD 자료  (0) 2011.04.27
Posted by 도전대박

'LabView > E.T.C' 카테고리의 다른 글

UI 관련 자료  (0) 2011.06.22
5월 챌린지 1등 수상작~~  (0) 2011.06.22
특정문자 원하는 문자로 바꾸기  (0) 2011.05.27
CLAD 자료  (0) 2011.04.27
Sample Rate  (0) 2011.04.15
Posted by 도전대박

'LabView > E.T.C' 카테고리의 다른 글

5월 챌린지 1등 수상작~~  (0) 2011.06.22
Accelerometer overview  (0) 2011.06.09
CLAD 자료  (0) 2011.04.27
Sample Rate  (0) 2011.04.15
탭 컨트롤에 이미지 넣는 방법  (0) 2011.04.15
Posted by 도전대박

CLAD 자료

LabView/E.T.C 2011. 4. 27. 13:25

1. Context Help 에 내용이 보이도록 저장방법.

To generate most of the documentation for VIs and controls, select File»VI Properties and select Documentation from the Category pull-down menu.
VI 프로퍼티의 문서 윈도우를 사용한다.
필수 연결은 꿁은 텍스트, 권장연결은 일반 텍스트, 옵션은 흐린 텍스트로 표시.

2. Step Into , Step Over

Step Into : 첫번째 동작 수행하고 다음 동작에서 일시정지. 단계별 실행
Step Over : 노드를 수행하고 다음 노드에서 일시 정지.
Step Out : 현재 노드의 실행을 마치고 일시 정지

3. 프로브, 실행하이라이트, 브레이크포인트
  디버깅 할때 사용하는 디버깅 기술이다.
  두개의 차이점은 아래와 같다.
  실행하이라이트 : 한 단계씩 실행이 되며 와이어에 이동하는 데이터를 표시해준다.
  프로브 : 실기간으로 와이어의 값을 보려고 할때 유리하다.
  브레이크포인트 : 설정한 곳까지 실행이 되고 대기한다.

4. 루프
루프에는 for, while 등등 이 있다.
반복터미널의 값이 카운트 터미널의 값보다 1이 작을 때 정지한다.(for 루프)

5. 클러스터
여러 타입의 데이터 원소들을 하나로 그룹화
복잡한 와이어의 연결을 피한다. subvi의 필요한 커넥터 팬 터미널 수를 줄일수 있다.

6. 차트
스트립 차트 : 왼쪽에서 오른쪽으로 차트를 옮기며 실행 데이터를 연속적을 보여줌
스코프 차트 : 왼쪽에서 오른쪽으로 부분적으로 스크롤 하면서 하나의 데이터 단위로 보여줌
스윕 차트 : 수직선으로 구분하여 오른쪽에는 이전 데이터 왼쪽에는 새데이터를 보여줌
기존의 저장된 데이터를 덮어써서 전체 웨이브폼을 디스플레이하는 그래프와는 달리 차트는 주기적으로 업데이트되면 이전에 저장된 데이터의 히스토리를 유지한다.

7. 상태머신의 단점
동시에 두상태의 변경이 발생하면, 첫번째 상태만 변경만 수행하고 두번재 상태 변경은 무시합니다.

자료 출처 : NI 교육자료 Basic 1, 2
7.

'LabView > E.T.C' 카테고리의 다른 글

Accelerometer overview  (0) 2011.06.09
특정문자 원하는 문자로 바꾸기  (0) 2011.05.27
Sample Rate  (0) 2011.04.15
탭 컨트롤에 이미지 넣는 방법  (0) 2011.04.15
랩뷰 관련 한번쯤 주의 깊게 볼만한 자료  (0) 2011.04.15
Posted by 도전대박

Sample Rate

LabView/E.T.C 2011. 4. 15. 16:15

The SAMPLING THEOREM states that for a baseband signal to be faithfully reproduced in sampled form, the sample rate must be greater than twice the highest frequency present in the signal.

fs > 2 BW

where

fs = sample rate
BW = bandwidth of the signal

The minimum sample rate is known as the NYQUIST RATE. This relationship guarantees that slightly more than two samples per cycle are acquired on a sine wave having a frequency right at the bandwidth limit. This equation defines the minimum theoretical sample rate. In practice, a higher sample rate is required to represent the signal accurately.

The sample rate and bandwidth specifications on a digital scope tend to be confused. Does a 100-MHz digital scope have a sample rate of 100 MHz or a bandwidth of 100 MHz? To help alleviate this problem, digital scope manufacturers have settled on specifying the sample rate in samples per second and the bandwidth in hertz. More typically, the sample rate is in megasamples per second (MSa/sec) and the bandwidth is in megahertz (MHz).

Example 4-2.
What is the minimum sample rate required by the sampling theorem to represent completely a signal having a 100-MHz bandwidth?
The sampling theorem requires
fs > 2 BW
fs > 2 X 100 MHz = 200 MSa/sec

The sample rate fs must be greater than 200 MSa/sec.

This still leaves the user with the question of how do sample rate and bandwidth relate in a practical digital scope? Or how much sample rate is required for a particular bandwidth? As we shall see, the answer depends on the sampling technique used in the oscilloscope.

출처 : http://zone.ni.com/devzone/cda/ph/p/id/220
Posted by 도전대박
1. EDIT >> Import picture to Clipboard 클릭후 이미지 선택

2. 탭에 이미지 적용

3. 탭에 표시 방법 설정




자료 출처 : http://decibel.ni.com/content/docs/DOC-12075

'LabView > E.T.C' 카테고리의 다른 글

CLAD 자료  (0) 2011.04.27
Sample Rate  (0) 2011.04.15
랩뷰 관련 한번쯤 주의 깊게 볼만한 자료  (0) 2011.04.15
Moving Data From LabVIEW into Excel  (0) 2011.04.06
병렬 Loop에서 프로그램 관련  (0) 2011.04.01
Posted by 도전대박

랩뷰 프로그램 코딩시 참고하면 도움이 많이 되는 자료들이다.

http://decibel.ni.com/content/docs/DOC-4659




컨트롤 디자인관련 자료
https://decibel.ni.com/content/docs/DOC-4028

https://decibel.ni.com/content/groups/ui

'LabView > E.T.C' 카테고리의 다른 글

Sample Rate  (0) 2011.04.15
탭 컨트롤에 이미지 넣는 방법  (0) 2011.04.15
Moving Data From LabVIEW into Excel  (0) 2011.04.06
병렬 Loop에서 프로그램 관련  (0) 2011.04.01
Sample rate(샘플레이트)와 Bit rate (비트레이트)  (1) 2011.03.30
Posted by 도전대박

랩뷰의 그래프 인디게이터에 표시된 데이터를 엑셀시트로 변환이 가능 하네요.

아래 링크 참고하세요
http://zone.ni.com/devzone/cda/pub/p/id/1339%C2%A0?metc=mtn9pu
출처
zone.ni.com
Posted by 도전대박