LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply different Logical operations to N.of Signals

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))

  1. ((((SigD >= 89.25 && SigF <=55.568) ||(SigG = 156.89)) && (SigA >= 45)) || ((SigF – Sig A) >25))

 

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..)

Munna
0 Kudos
Message 1 of 14
(3,163 Views)

Hi Munna,

 

as you said: you need to develop…

 

You may try the "formula parsing" functions in the math palette to check if they fit for your application!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(3,161 Views)

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.sample image.JPG

Munna
0 Kudos
Message 3 of 14
(3,141 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 14
(3,136 Views)

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.

 

Judgment.png

 

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

)

)

 

Idea.png 

Please give me any idea/sample VI for the same.

Here, 1,2 & 3 are Indices of Boolean 2D Array.

 

Munna
0 Kudos
Message 5 of 14
(2,951 Views)

Hello all,

 

Please help me if anyone have Idea.

Munna
0 Kudos
Message 6 of 14
(2,914 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(2,908 Views)

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?

 

Munna
0 Kudos
Message 8 of 14
(2,892 Views)

"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.

0 Kudos
Message 9 of 14
(2,883 Views)

@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


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 14
(2,866 Views)