11-07-2011 12:13 PM
Hi, I have a very simple question that I cannot seem to figure out. I would just like to perform logic operations (AND, OR, etc.) on 2 strings of bits that are 24 bits long each, however I cannot find in the functions palette a function that acts as a binary constant. I only see numeric constant and hex functions. Can somone please let me know where I can find this. For example, I would like to AND '111111111111111111111111' & '000000000000000000000000'.
Solved! Go to Solution.
11-07-2011 12:22 PM
11-07-2011 12:40 PM - edited 11-07-2011 12:41 PM
Thanks for the reply. Ultimately I will be using type cask when I deploy my application. However for now I am looking to write logic operation programs to get familiar with data manipulation, and I am wondering where I can find a function to use to input a binary string, such as the "NOT" operation in this example. They manually input '10000110'
http://zone.ni.com/devzone/cda/tut/p/id/3626
To answer your question, it will be a binary string consisting of FF FF then my 8-bit data.
11-07-2011 01:04 PM
Do you know the difference between numeric and string datatypes in LabVIEW? Blue = integer = numeric. Pink = string. In the example you linked to they are using an integer constant where the display format is set to "Binary". The "b" in the constant indicates the radix, which in this case is "binary". Right-click on a numeric constant and you can change its display format. You can select one of the predefined formats or you can specify one by clicking on the "Advanced Editing Mode" option. The allowable formats are defined in the LabVIEW Help. For example
%b = binary
%8b = binary, using minimum field width of 8, padded with spaces (e.g., " 1101")
%08 = binary, using minimum field width of 8, padded with zeros (e.g., "00001101")
11-07-2011 04:21 PM
Got it, thanks for the help.
11-07-2011 04:25 PM
I think that these bitwise operations should work directly on strings too. Thus I wrote up this idea. 🙂
12-09-2011 10:58 AM
Boolean operators will work on binary or integer values. The logical opertors will give you broken lines until it is complety hooked up.
12-09-2011 10:58 AM
Convert the string to and integer.