09-16-2014 01:52 AM
Hello all,
Please help me if anyone have idea about this.
I have “N” number of signals. I want to apply different Logical operations for this.
For Example:
(((SigA >= 30 && SigB <=55) || (SigC = 42)) && (SigD > 45))
Here Conditions will change every time. User can input different conditions (like Excel calculations). I need to check signals as per these type of conditions. Is there is any tool kits available in LabVIEW / we need to develop?
Currently I’m thinking about string manipulations to extract the each condition . Once first condition is finished then check this results with next conditions (so on..)
09-16-2014 02:00 AM - edited 09-16-2014 02:01 AM
09-16-2014 02:38 AM
Dear GerdW,
Thanks for your reply.
I think it could be more helpful if NI/OpenG can provide some Toolkit.
Like, it can read Signals from Table with User Conditions from FP.
09-16-2014 02:46 AM
Hi Munna,
I think everybody has different conditions/formulas he needs to apply to its data. The data may have different formats too.
So I don't think NI will provide a toolkit for your special analysis task…
But you are free to either participate with OpenG and provide your routines for free or to develop such a toolkit and sell it with NI.com. It's up to you…
I for myself have programmed such things on my own and use it in our testbenches to provide configurable calculation channels that can work in "realtime" with measurement data. Boolean operations are included, simple math and some physics (fluid conditions…) too.
As I said: you have to program it!
If you hesitate to do that work: take a look at Diadem. This tool is made for data analysis…
11-06-2014 03:11 AM
Hi GerdW,
After long time again I stated doing this task. Could you please help me in this.
As per my snippet, at 1st making array based on given String. From that string I need to check where open & closed brackets are coming to do logical operations.
For Example: (2 OR ((1 AND 2) OR 3))
Index |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
String |
( |
2 |
O |
R |
( |
( |
1 |
A |
N |
D |
2 |
) |
O |
R |
3 |
) |
) |
Please give me any idea/sample VI for the same.
Here, 1,2 & 3 are Indices of Boolean 2D Array.
11-07-2014 04:42 AM
Hello all,
Please help me if anyone have Idea.
11-07-2014 04:47 AM
Hi Munna,
the main work is to find corresponding brackets. You could do this task this way:
- Search the first closing bracket. Then search the last open bracket before the closing one. Between both you will have your inner most term.
- After solving and replacing that term with its result you do the first point again - until there are no more brackets to find…
11-07-2014 07:50 AM
Hi GerdW,
Thanks for your reply.
I'm also thinking same way. But I'm unable to make VI.
Could you please give any sample snippet?
11-07-2014 08:12 AM
"Could you please do my work for me" is generally not the best way to seek help on these forums.
Which part of what he suggested is stumping you? We can look at ways to implement that piece so you can get back to making progress.
11-07-2014 11:39 AM
@Munna232 wrote:
Hi GerdW,
Thanks for your reply.
I'm also thinking same way. But I'm unable to make VI.
Could you please give any sample snippet?
Well it is not as easy as it sounds. just for an example: you could study "Parse Formula String.vi" and "Eval Parsed Formula String.vi" These do about what you want but, for math you could adapt the techniques for boolean operations. Both are on the pallets in Mathmatics>>Scripts and formulas.
So, I guess NI did provide an example or tool