From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about 3D Boolean Arrays

Hi ...

I have a question about 3D Arrays, specially 3D Boolean Arrays.
Is it possible that "page" part of a 3D Boolean Array ( the first dimension ) has different size ? (diffrenet row and column)

It seems that the answer is no ! ,  so what do should i do ? see the pictures ...

This is for a Jet Printer (Dot Matrix) project.

 

 

19625i5A9C99DCAA660879

 

 

19627i22918F068125AA5F

0 Kudos
Message 1 of 13
(4,042 Views)

You are correct that the answer is no.  Any multidimensional array must have the same number of columns in each row and the same number of rows and columns in each page with similar extensions to higher dimensions.

 

You may want to make a 1D array of clusters where each cluster contains a 2D array of booleans.  The arrays in each cluster can be of different sizes as long as they are all of the same type.  What you are now trying to do with page indexes in the 3D array now becomes the index of the cluster array.

 

You could also use  a queue of 2D arrays of booleans.  Each element of the queue must be a 2D array but can be a different size from other elements.

 

Lynn

Message 2 of 13
(4,034 Views)

Thank you so much. My problem has been solved.
I have another question. In a part of my project I have an 2D Boolean Array as you can see in follow. How can I insert 2D Boolean Array data to a wish indeces of my main 2D Boolean Array ? (NOT from the first of Array. for example from coordinates of 4,8 )
Look at the picture . Please help. 
Tnx again

 

 19733i2B9740E28EB71CEA

0 Kudos
Message 3 of 13
(4,005 Views)

First initialize an array with all false elements to the size of the final array.  Then use Replace Array Subset to put the input array where you want it.

 

Lynn

Message 4 of 13
(3,990 Views)

Hi all ...

I need simple "Graphic Editor" program. This is a part of my project. Main element is an 2D Boolean Array which is a control. User must capable to draw simple shapes such as a rectangle. Does anybody have an idea ?

for example to draw a rectangle first click on primary corner on 2D array then click on last corner and program draw a rectangle on 2D array. And another shapes such as simple line and circle (if possible)

I've a program which in while loop after registering for 2D Booolean Array Mouse Down Event and giving Coordinates and Control Refnum to it, so it gives clicked coordinates on 2D array.

 

 

Rectangle.png

Download All
0 Kudos
Message 5 of 13
(3,907 Views)

Have a look at the following links:

 

http://forums.ni.com/t5/LabVIEW/How-2D-Value-Array-to-Bitmap-Image-in-LabView/m-p/195393#M112461

http://forums.ni.com/t5/LabVIEW/how-to-draw-rotating-line-like-Radar-display-in-labview-using/m-p/54...

http://forums.ni.com/t5/LabVIEW/Labview-7-0-how-to-draw-quickly-300-000-points/m-p/115959#M69987

 

Have a look at the etch a sketch example, too:  http://decibel.ni.com/content/docs/DOC-13593

 

Now, these are all more complicated drawing than what you are looking for.

I do recall that there was an example of a simple draw pad (maybe in one of the basics course).  I didn't find it yet on the forum.

 

Message 6 of 13
(3,882 Views)

Thank you very much
But these are not my desired program. None of it !
I need a program which operate on 2D boolean array directly as simple as possible (user friend!). using above method which I told before.

F1 ----->> Help  !!!!

0 Kudos
Message 8 of 13
(3,859 Views)

Mostafi,

   Unfortunately there are no turn key solutions available in a dev zone or community example but the other members posting to this forum have sent you in a good direction.

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 9 of 13
(3,832 Views)

Thanks
Ok
I have wrote a simple program to draw line and rectangles but not automatically. Have a look. Click on a LED and drag mouse. It follows mouse movement and toggle LED status.

Does anybody can improve it ?

Download All
0 Kudos
Message 10 of 13
(3,811 Views)