LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Marquee Progress Bar in LabVIEW

Do it work in exe?

 

George Zou

http://www.geocities.com/gzou999

George Zou
0 Kudos
Message 21 of 42
(4,168 Views)

I hadn't tried executables yet, and my two quick test applications built in LbVIEW 8.6 on both XP and VISTA show that it doesn't work.

Although there are no errors, which is a positive step I suppose, there is also no progress bar - just an empty rectangle, as shown below:

 

 

 

Maybe there's still a way to get this to work? Anyone got any new ideas?

Message Edited by Thoric on 01-30-2009 10:46 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 22 of 42
(4,141 Views)

Zou,

 

Solved the issue with applications not rendering the progress bars - it relates (as was mentioned earlier in this thread) to the VisualStyles of the operating system.

 

It appears that in development mode, LabVIEW front panels that call any .NET controls have the Windows VisualStyles enabled. But once built into an executable, the VisualStyles are not enabled.

By simply enabling the VisualStyles property of the built application before rendering the .NET control one can ensure the ProgressBarRenderer class can draw the control correctly:

 

 

Snapshot of a LabVIEW built application using the Marquee Progress Bar

 

The modified vi is attached (LV 8.6).

 

Enjoy! Smiley Happy

(Note: The snapshot is of my Vista-built LV application, the attached vi below is from my XP machine, but the vi block diagrams are identical)
Message Edited by Thoric on 01-30-2009 11:42 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
Message 23 of 42
(4,131 Views)

Hi,

 

I open a project and include the VI above, compile it to EXE, and the animation work.

But if I add your VI to my project (another project), it doesn't work. (As shown below).

 

 

Any advices from any1 or expert here ? 

 

 

Message Edited by engwei on 02-23-2009 04:28 AM
0 Kudos
Message 24 of 42
(4,014 Views)

Hi Engwei,

 

Could you include a little more information including the version of LabVIEW you are using, the operating system and the version of .NET installed on your system. Of course, it wouldbe best if you could upload your entire project so we can try creating our own applications from it and test it ourselves.

 

I re-downloaded the vi above, created a new project, built an application and it worked for me too. I then tried adding to an existing project that I'm currently working on, and it still worked. Maybe with some more information from you we can figure out why this doesn't work for your own project...

Message Edited by Thoric on 02-23-2009 10:39 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 25 of 42
(4,010 Views)

Hi Thoric,

 

Tool: Labview 8.6

OS: Window XP

.NET installed: .NET Framework 2.0 SP2,  .NET Framework 3.0 SP2, and .NET Framework 3.5

are listed on my "Add or Remove Program" list.

 

 The problem is, if it is cause of different version of tool, OS, or .NET, I m sure I cant run it too on separated project. Please advise, thanks. 

0 Kudos
Message 26 of 42
(4,007 Views)

You are right Engwei, given that you can successfully use the vi in a new project one can assume all the necessary tools are present.

However, I was wondering if maybe you were using an older version of LabVIEW than 8.6 that may have had issues with .NET tools.

 

I myself am also using Win XP Pro (SP3) with LV8.6 and the same range of .NET tools. As I have no problems with the marquee progress bar I cannot diagnose what may be wrong for you. But perhaps if I could try your project on my system? Can you upload it? If it's too large, maybe you could upload a trimmed down copy that only includes the minimum code to run?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 27 of 42
(4,002 Views)

Hi Thoric,

 

Thanks for your reply. 

 

I think there is a .. I called it 'bug' since it took me long enough time to figure it out  🙂

 

Here I attached 2 VIs, both of them will show the marquee animation, but both of them could not be together under the same project, else, your compiled EXE project will not show the marquee animation.  I hope some1 could explain about this.. This is something wrong about .NET component in labVIEW, not only the progress bar, but other component as well. 

 

Please notice the different of progress bar "Panel". One is by 'shortcut' then another 1 is defined from 'raw'. 

 

Please give some advise. Thanks. 

 

 

 

 

 

 

Message Edited by engwei on 02-26-2009 03:49 AM
Message Edited by engwei on 02-26-2009 03:55 AM
Download All
0 Kudos
Message 28 of 42
(3,941 Views)

engwei,

 

There are some interesting behaviours arising here.

 

What you do not have in your own Marquee.vi is the progress bar docked inside a windows form panel. If you read this thread, you will see that the only way to get a Marquee style progress bar to work is to do precisely this.

 

What you have done is simply place the marquee progress bar into a .NET container. Now normally we see a cyclic crash when trying this, but you do not. After further investigation I see that you've set the execution system to User Interface thread. This seems to prevent the crash, but the marquee progress bar still does not show correctly. To truly show the marquee progress bar correctly, you need to dock the progress bar into a windows form panel, and also Enable Visual Styles

 

I have done this for you, see attached

 

 

Message Edited by Thoric on 02-26-2009 10:15 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
Message 29 of 42
(3,934 Views)

Hi Thoric,

 

Thanks for your reply.

Ya, for the .NET container marquee, I have faced the crash before. I have post a topic about marquee crash, and some1 has solve it by change the thread to UI.

 

Please take a look the link below.

 http://forums.ni.com/ni/board/message?board.id=170&message.id=371621#M371621

 

Thanks for your solution.

0 Kudos
Message 30 of 42
(3,898 Views)