LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create moving tiled pattern

This seems like it should be really simple but I just can't get it to work. I'm trying to create a series of images of tile patterns in one vi which will be displayed as a repeating sequence on the front panel of another vi (attached as Slave.vi). All together the whole image needs to be covered. As a start I'm keeping it simple as four pictures of squares which move in a rotating pattern.

The vi below runs and, with the square size = 20, does what it's supposed to. However, it doesn't work with any other square size and doesn't work near the edges.

I warn you, I'm quite new to Labview so it's not pretty to look at and very buggy. I'm sure there are better ways to do the image display and manage front panels etc. but I don't know how, feel free to advise though.

Currently I'm building arrays containing the pattern and converting these to images later on. I've also tried drawing the squares on with IMAQ and had no luck and how I currently handle the arrays is really cumbersome and slow. In the future I would like to expand this to more complex patterns (ideally hexagons and more than 4 frames to increase the space between shapes in each one) so if you could suggest a method that's easily adaptable that would be perfect. Thank you

Download All
0 Kudos
Message 1 of 3
(2,467 Views)

Hi ed,

 

even without IMAQ installed I see a lot of "unusual" code in your VIs…

 

The vi below runs and, with the square size = 20, does what it's supposed to. However, it doesn't work with any other square size

Well: you do some divide operations and get DBL values from them. With those DBL values you set the max iteration count of loop - with a big read coercion dot. you know what they are good for?

 

- Why do you do a SetMatrixElements operation, where a simple replaceArraySubset would work too?

- Why do you do all those operations with wrong datatypes, producing a lot of coercion dots in your code?

- Why do you need to stop your VI using the STOP function? Common saying: "it's like stopping your car with a tree"…

- Why do you call your subVI using VIServer calls? There are simpler methods to transfer data between parallel loops!

- Why do you need loops around event structures set to wait for a single event? Why do you need a wait statement in those loops when the loops will just iterate once?

- many more issues…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,457 Views)

Thanks for the reply. The simple answer to all your questions is that I just don't know any better way to do these things. If you have any suggestion they'd be very welcome. Rest of the programme aside, is the problem the coersion and is that the only problem? I tried the replace array subset but it didn't accept that many inputs and a 2D array. Also, since i want to expand this later on, is the array method the right way to go or should I be overlaying images as single tiles over a blank image?

0 Kudos
Message 3 of 3
(2,417 Views)