LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create and save boolean expressions for later evaluation

Is it possible to create Boolean expressions by inputs via user interface in LabVIEW and save them for later evaluation? I am interested in creating a 'flexible policy engine' which involves creating 'rules' comprising attribute values of certain attributes of objects based on boolean expressions which can later be used for arriving at some decisions based on the 'rules'.
0 Kudos
Message 1 of 6
(3,384 Views)
Hi Belur,

Have you considered building a script based on the boolean expressions that you want to create for the flexible policy and saving the script to file?
Later, you can read the script and depending on the policy, it can re-create the boolean expressions.

A simple way to implement this is by having various pre-defined expressions places into a Case Statement. The script calls the appropriate cases that create the complete expression.

You can store the attributes of the objects and when the vi is running, it can first open the initialization file, read the attributes and set them.

For instance, you can read from and write to Property (and Invoke Nodes) to which you can the attributes.

Unfortunately, I don't have an example of this that I c
an share with you. There may be some if you do a search.

Hope this helps..

JLV
Message 2 of 6
(3,384 Views)
Correction:

Actually, you may want to keep the vi running. So while it runs, you can store the attributes and retrieve them based on certain events. It is really up to how you want to implement the solution.

As for the case statements, it may be a little messy, but I did mention that it would be a simpler solution.. ;o) The reason I mentionned that is that I assumed that there would be pre-defined sets of boolean expressions that can be stored and built (ie: building blocks). So if they are known, they can be placed into Case Statements.
Message 3 of 6
(3,384 Views)
Thanks for your posting. Yes, I was also thinking along writing a script. But I was not sure how to implement this. I need some clarification regarding what you say above. Maybe I can give some example and you can use that to explain your approach.

Thanks again.

Sheela
0 Kudos
Message 4 of 6
(3,384 Views)
sure..

🐵
Message 5 of 6
(3,384 Views)
I have now been able to implement the 'rules' as a script file which I am able to successfully access to make the access decision. Thanks.
0 Kudos
Message 6 of 6
(3,384 Views)