關於人機介面下拉選單的攥寫

 

請看以下紅圈圈起來的設計畫面

![](upload://eETHqG5B0fQVfqpH7QnIyvQUC9q.jpeg)


![](upload://pHVAcewV8EAVo2pQUuAPQekrEuF.jpeg)

選單標題分為1.測定項目名稱 2.符號 3.荷重下限 4.荷重上限....etc

選取方式如下:

1.點下第一格的測定項目名稱  -> 2.出現下拉式選單(附圖2),可以選擇各種想測的測定項目

--> 3.選擇其中一項時,會自動帶出該項的?符號?、?荷重上下限等的數值。

最後測定完成後,會產出曲線報表,報表上的Data 會呈現之前勾選的測定項目

http://www.labviewpro.net/upfiles/Q3.pdf

請各位NI的高手們,提供相同或類似的功能與做法,感激不盡

可以參考以下範例

From Excel to LabVIEW with style

<span =“apple-style-span” style="color: rgb(51, 51, 51); font-size: 12px; border-collapse: collapse; font-family: arial, helvetica, sans-serif; "><div =“jive-content-er clearfix” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 15px; margin-right: 15px; margin-bottom: 15px; margin-left: 15px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; min-height: 0px; border-bottom-style: dotted; border-bottom-color: rgb(187, 187, 187); : relative; background-: initial initial; background-repeat: initial initial; "><div =“jive-content-title” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 0px; margin-right: 100px; margin-bottom: 5px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-: initial initial; background-repeat: initial initial; ">

From Excel to LabVIEW with style

<div =“jive-content-er-version” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; : ; right: 0px; top: 0px; text-trans: uppercase; background-: initial initial; background-repeat: initial initial; ">版本 6  ??查看文??史??<div =“jive-content-er-details” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 0.8889em; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 102); background-: initial initial; background-repeat: initial initial; ">?建于: 2010/10/9 下午 12:33 作者 GriffinRU - 最后修改:  2011/6/8 上午 10:17 作者 GriffinRU<div =“jive-content-” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 15px; margin-right: 15px; margin-bottom: 15px; margin-left: 15px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; overflow-x: auto; overflow-y: ; : relative; background-: initial initial; background-repeat: initial initial; "><div =“jive-rendered-content” style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; overflow-x: visible; overflow-y: visible; : relative; background-: initial initial; background-repeat: initial initial; ">

From Excel to LabVIEW with style.

Simple, one layer example, of passing Excel’s cell properties to LabVIEW table control.

Download example.xls and Table DropDown.vi into the same directory, run VI.

Edit Excel spreadsheet and re-run VI again.

Current example loads data from Excel’s cells A1:C5, obtains cell’s background color from A1 and validation data from 5th row only. In LabVIEW spreadsheet name passed as Table caption (on the bottom), data from A1:C1 passed to LabVIEW table as headers and A1’s background color as headers background color, validation data passed to combobox strings.

 

Following this example more advanced interface, expanded to all rows and colums with tracking changes on-the-fly, can be created. More features, like Font type, style, alignment and such can be passed as well.

 

10.16.2010 Update…

Table DropDown ver.2.vi

Quick and dirty implementation of how to:

  • obtain last record from Excel (i.e. reading not fixed 5 rows but as many as spreadsheet holds)
  • read cells comments and pass them as tip strips
  • get all validation data from spreadsheet and apply it in LabVIEW to appropriate table cells only (current example limited to column B)

dropdown.png

<div =“jive-attachments” style="font-family: arial, helvetica, sans-serif; background-image: url(http://www.ni.com/images/clearspace/global/ni-overview--bg.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; : white; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; padding-left: 5px; border-top-style: none; clear: both; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-: 50% 100%; background-repeat: repeat no-repeat; "><strong style="font-family: arial, helvetica, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; : transparent; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 12px; list-style-: none; list-style-: initial; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(85, 85, 85); background-: initial initial; background-repeat: initial initial; ">附件:

LV8.5版會找不到以下兩個vi

 "C:\C\Program Files\National Instruments\LabVIEW 2009\examples\comm\ExcelExamples.llb\Open Excel and Make Visible.vi"

 "C:\C\Program Files\National Instruments\LabVIEW 2009\examples\comm\ExcelExamples.llb\Open Specific WorkBook.vi"

這...竟然還是官網提供的.....只能升級後再看了

IAmRice40717.5566666667

[QUOTE=IAmRice]

LV8.5版會找不到以下兩個vi

[/QUOTE]

更正一下,當在搜尋vi時要手動指定該vi在LabVIEW 8.5的路徑

ancle40718.4027083333

找到了 感謝指點

你好!!!我還是找不到Open Specific WorkBOOK.vi 這個檔

我的是2011版

George41740735.8957175926

在以下教學中

http://www.labviewpro.net/all-in-one/labview_video3.html

LabVIEW Scripting(上集)的2:30開始介紹的也是同樣功能看起來比較簡單

[tube]http://www.youtube.com/watch?v=8N3TyIXVM3Q&feature=player_embedded[/tube]

Hi, Ben大

Table DropDown LV8.5.vi (61.2 K) LabVIEW 8.5

無法下載ㄟ

Hi George417大大,



[QUOTE=George417]

你好!!!我還是找不到Open Specific WorkBOOK.vi 這個檔



我的是2011版

[/QUOTE]



其實你要找的應該是"excelexamples.llb",你要找的"Oepn Specific WorkBOOK.vi"是在它裡面哦!