LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bmp 2 png with parallelism

Solved!
Go to solution

Hello guys.
I have one bmp to png converter. I need paralleling it.
Cos i need convert 50 pictures in short time as possible.
This my VI, doesnt work with parallel. cos icons are locked and etc.
Have u some idea, how to do this?

0 Kudos
Message 1 of 9
(3,769 Views)

What do you mean Parallelism here? I see you are trying to convert a *.bmp file to a *.png file. What are you doing in the "png.vi"?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 9
(3,760 Views)

Hi lacika,

 

it's no good idea to show VIs without their subVIs! What's inside the missing "png.vi"?

 

And it's no good idea to handle file path as strings. There are functions to provide filenames without extensions or to build paths!

 

On parallelism: You already activated the FOR loop parallel execution. Does it help with your problem? (Do you really want to have 64 parallel running file access routines?)

 

On your needs: what is your (timing) goal? How big/complex are your images?

Best regards,
GerdW


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

Sorry guys.. my bad..
I want only convert pictures in same time. (paralelized loop)

0 Kudos
Message 4 of 9
(3,691 Views)

Hi lacika,

 

and what about my questions?

Best regards,
GerdW


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

I have 53 files to convert... (every 3 mins.)

On best compression, converting spend 1min and 28 seconds.
With parallelizing i want save about 50% of time.
But if I activate parallel execution, it dont save time.
One imagine have about 1.05 MB.

0 Kudos
Message 6 of 9
(3,668 Views)

Hi lacika,

 

(every 3 mins.) On best compression, converting spend 1min and 28 seconds.

So you are still within time limits… 🙂


With parallelizing i want save about 50% of time.

Fair value…


But if I activate parallel execution, it dont save time.

Parallizing the FOR loop will only help, when the subVIs allow reentrant operation. As you don't have (full) control of the PictureFile functions you're on a dead end here as you cannot change PNGWrite to reentrant operation…

 

As long as you are in your time limits I would setup a producer-consumer-scheme for this conversion task. Have a consumer waiting for conversion commands (telling which file to convert) and just feed the queue with filenames…

 

Other approach: there are several tools for converting images from one format to the other. Many of them can be called as command line tool, so you can call them using SystemExec. This way you can call several instances of such a tool in parallel. Most often they are also faster than LabVIEW.

 

One imagine have about 1.05 MB.

If it's the BMP size your image has about 600×600 pixel in RGB. That's not huge…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 9
(3,651 Views)

(every 3 mins.) On best compression, converting spend 1min and 28 seconds.

So you are still within time limits… Smiley Happy

No. Every 3 mins, i have new images, but 88sec. is too much. Cos testend sequence waiting for converting.

One imagine have about 1.05 MB.

If it's the BMP size your image has about 600×600 pixel in RGB. That's not huge…
res. 1280x960, grayscale. (but i have 10 000 pics per day)
But if I activate parallel execution, it dont save time.

Parallizing the FOR....

Cruel words for me. 😞

Is there other way how to do parallelized converter?

 

0 Kudos
Message 8 of 9
(3,643 Views)
Solution
Accepted by topic author lacika

Hi lacika,

 

see my last message: the comment on the other approach!

 

With a producer-consumer-scheme your test sequence doesn't has to wait for end of conversion!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 9
(3,620 Views)