There are a couple of ways to go about this. You may want to look into the Mathmatics»Formula»Advanced Formula Parsing pallet for some useful VIs.
One way to do it would be to parse a string for expresions and perform the oppertation specified. Attached is a first step in doing this. Note that it returns an array of results...the code for anding and oring still needs to be added.
Hope this helps,
Amaury Rolin
NI Applications Engineer