LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Boolean Array to number

Hi,
I would like to create a 2D boolean array of 16 rows and 8 columns. Then convert the data from boolean to number type  unsigned byte. This would be used to display and control 16 control register in I2C data format. Would it be possible to use the same grid to display data that will to sent to the slave device as well as data sent from the slave device?
Thanks
0 Kudos
Message 1 of 7
(5,474 Views)
Just use boolean array to number" and "number to boolean array" in a FOR loop as follows. See how far you get. 🙂
 
 
 

Message Edited by altenbach on 10-23-2007 03:14 PM

0 Kudos
Message 2 of 7
(5,470 Views)

Thanks, for your help. I've been out until now.

I've made the following mods. to the basic I2C read/read VI's. Can you help me understand why my indexing is wrong? I looked at the the I2C write on a scope and it follows the boolean array values, but as you can see the Hex array is off by one. If I change the starting address value the Hex element zero will show that same value.

Regards,

Chuck

 

0 Kudos
Message 3 of 7
(5,418 Views)
Your indexing is off simply because you are building the array with EEPROM Starting Address (0) as the first element. I don't have the NI-845x vi's, so I can't run your program, but that's why the Hex Array has 17 items instead of 16.

B-)
0 Kudos
Message 4 of 7
(5,414 Views)
Hello,
I am trying to convert a 2D boolean array into a boolean (T or F). How can I do that?
Thanks
0 Kudos
Message 5 of 7
(5,183 Views)
What is the relationship between the single Boolean output and the values in the 2D array. Perhaps the And Array Elements/Or Array Elements functions (in Boolean palette) are what you're looking for?




Message Edited by smercurio_fc on 07-11-2008 10:16 AM
0 Kudos
Message 6 of 7
(5,178 Views)
I am using a mix between IMAQ Vision and NI-DAQ.
The values of the 2D array from IMAQ vision are used to control a polarity switch using DAQ. I used the >= function to set my condition for the 2D array values. If the condition is met, I want the polarity switch to be turned on. I used the AND funciton and it works. Thanks a bunch.
0 Kudos
Message 7 of 7
(5,168 Views)