キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Combination Logic

解決済み
解決策を見る

I want to make compare and combination logic in Labview.

 

Please refer below drawing

1.jpg

In above drawing we provide 250 set point and using 14 reading compare and choose specific reading as per given set point like

38.2+54.3+75.8+81.7 = 250 as per given drawing

So we make Combination & compare logic like above system.

0 件の賞賛
メッセージ1/10
6,538件の閲覧回数

You can start with here state machine example and tutuorial: http://www.ni.com/white-paper/3024/en/

Thanks
uday
0 件の賞賛
メッセージ2/10
6,526件の閲覧回数
解決策
受理者 Mak41188

You haven't shown any of your work, so all I'll offer is a few links that I found interesting:

 

http://forums.ni.com/t5/LabVIEW/Easiest-way-to-sum-all-possible-different-combinations-in-an/td-p/20...

http://forums.ni.com/t5/LabVIEW/How-can-I-create-list-of-permutations/td-p/1256988

http://forums.ni.com/t5/LabVIEW/permutations-of-a-6-numerically/td-p/1173677

 

What have you tried?  What isn't working?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

メッセージ3/10
6,512件の閲覧回数

What are your exact rules?  Can only use 4 measurements or as many or little as needed?  Can you repeat using measurements?

 

At the top of my head, I think recursion will be very useful here.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 件の賞賛
メッセージ4/10
6,508件の閲覧回数

My first link contains a nearly-complete answer.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 件の賞賛
メッセージ5/10
6,493件の閲覧回数

The rule is the combination addition equal to given set point. You can use number of measurements out of 14 readings & 14 reading are unknown every time is changing and we finding out the correct combination that’s it.   

 

0 件の賞賛
メッセージ6/10
6,480件の閲覧回数
  1. Show me your code, wire-worker, and I'll show you mine.
  2. The first link I provided, very slightly modified, will do what I think you need.
  3. How much LabVIEW experience do you have?
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 件の賞賛
メッセージ7/10
6,470件の閲覧回数

Do you have problems with the logic or with the LabVIEW implementation?

 

You have 2^14 possible selections, so the brute force approach would be to simply count up to that, covert each number to a boolean array, multiply with the aray of selections and take the sum, then pick the combination that is closest to 250. Be aware that you might not get an exact equality due to limitations of the DBL format. You actually might want to multiply all values with 10 and operate on integers instead.

0 件の賞賛
メッセージ8/10
6,437件の閲覧回数

OK, you got 4 possible solutions as follows. Takes just an instant to calculate using my suggestion.

 

42.1 + 59.6 + 72.5 + 75.8 = 250.00
57.3 + 59.6 + 65.6 + 67.5 = 250.00
38.2 + 42.1 + 42.9 + 54.3 + 72.5 = 250.00
38.2 + 54.3 + 75.8 + 81.7 = 250.00     <<<<< your solution above

 

Try it!

 

0 件の賞賛
メッセージ9/10
6,429件の閲覧回数

Here's a simple example.

 

 

 

(Many things could be optimized, of course. This one takes about 10ms, which seems long. I have one that is ~6x faster but I am sure it can be furthre improved :D).

 

0 件の賞賛
メッセージ10/10
6,388件の閲覧回数