LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Application runs very slow using localization

I use LabWindows/CVI 2013 SP2.

Attach to the post :
http://forums.ni.com/t5/LabWindows-CVI/Application-runs-very-slow-using-localization/m-p/1876041/hig...

I have already use the "LoadLocalizedPanel" function in the pass (since CVI 4.0.1),
without so much problems.

After a long time without need to use multilangage functions (LabVIEW developments),
I need to use it again.
So I take again the old process, and go one.

Since 2 years now, many problem appears.

After the problems with "User Interface Localizer" tool,
now, I have got the same problem as LucaTesi.

Especially, when I use NI PCI or PXI boards (with "EveryNCallback" mixed to a personnal productor / consumer process).
Not when I use FIFO with Ethernet Compact RIO (but only 2 applications).
Not when I use only RS communication (but only few applications).

My ".uir" are not big (< 300 ko), and they are few panels inside (< 5), and with few controls inside each.

My "main" panel use a tab with several options, and with one with 4 "tree" controls inside.
We also use some dynamic interfaces (NewPanel and NewControl functions).

My acquisition is at 1kHz (on 32 channels), and the recorevy data is at 4 Hz.
The outputs are just some manual ones (not periodic, not inside software loops...).

I observe the same problem, all seems to run perfectly (acquisition, displayings, orders, graphs, saving data, monitorings ...).

But not when I open, for example, a simple personalized "About" panel (logo, adress, tel, email, etc...).
N.B. :
The problem is also the same for all the superposed panel (ex: data order panel, data information panel, etc...).

If I use only "LoadPanel" (so french panel), all is OK.

When I use english translations (".lwl" < 10 ko and ".lwd" < 4 ko) with :
- LoadLocalizedPanel
- or LoadLocalizedPanelEx (..., __CVIUserHInst, ...)
- or LoadPanel + LocalizePanel
the same trouble, the recovery time grow up, all seems very very slow :
- for example : a simple "cancel" button (DiscardPanel), is play only 5 s later the keypress

In advance, thank a lot for your help.

==========================================

I give the solution I found to avoid (but not completly) my problem and keep my multilanguage software.

I keep the "*.lwl" files of "User Interface Localizer" tool.

And I open them with "INI" file function,
and treat them just before display them (like someone propose in another post ... Thank),
througt some "SetCtrlVal", "Set...Attribute" (Panel, Menu, Ctrl, Table...), "ReplaceListItem", etc....

I do only what I need and treat only the data that I understand (so too few things).

But if someone have a better idea, please inform to me by a reply of this post.

And more the source code of this function, why not ?

==========================================

Like I try to explain in my previously, I read the "*.lwl" like a "INI" file.

Check into all the panels, the menus, the controls elements (throught ATTR_..._CONSTANT).

For each of them, I check if a section exist on the "INI" file.

I try to detect some special keyword ("Title", "Label", "Default", etc...) in the item name,
and that in function of the value of the "Type" item.

If them are not exist (I keep the initial attribute).
Else, I apply the data item to the attribute of the element ("SetPanelAttribute", "SetCtrlVal", "SetCtrlAttribute", etc...).

N.B. :
====
I have not treat the 1srt section "[LWCVI Language Resource File ]".
And I have not understood the "Flags" item name (checksum ??? TBD).

Example :
=======
...

[P_Commande] : PanelName
Flags = "@f" : TBD ???
Title = "Instruction" : SetPanelAttribute (panel, ATTR_TITLE, data item)

[P_Commande_NomSection] : PanelName_ControlName
Type = 3 : generic string control style
Flags = "Efee" : TBD ???
Label = "Section name" : SetCtrlAttribute (panel, Panel_Control, ATTR_LABEL_TEXT, data item)

...

I hope that this will answer your request.

==========================================

Does the problem appears also in a smaller project ?
I do not kwow (it is not yet some huge : just a manual mode).

Now, it is very difficult to export, even, a few part of the code project (industrial application).
And wich one?
And any case, all the sofware parts are impacted (there is some translation everywhere).

For the size of the number of elements (analog, digital, .... data), it seems to have an impact.
Why ? Panels, menus, controls refreshing ? Software memories ?
But, where is the acceptable limits ?

Without this translation module (only LoadPanel),
I have several customers which use this application without troubles, but in French,
or throught my own module, all was allright, now we still have some trouble.

It seems that the final solution, would to have native french UIRs and english UIRs.
And forget to use UIRs translation module.


Certified LabWindows/CVI DEVELOPER (2004)
LabVIEW since 5.01 | LabWindows/CVI since 4.01
0 Kudos
Message 1 of 4
(4,655 Views)

Hi,

You can try to not load+localize/discard your panels every time. Just load+localize panel once (on program start, first use,language switch,..) and then show/hide it as you need. And discard it at program end.

As alternative, you can try duplicate "preloaded" panel instead of load+localize and then discard it as in the current code.

(i do not recomend lots of new/load/discard GUI cykle as general solution, but it depend on your situation/sw architecture/...)

 

Other way can be to prepare separated UIR file for every language.

This can be done by:

 - export UIR file to TUI file

 - apply language modification to TUI file (it is ".ini" like format)

 - TUI file back to UIR (or use TUI files directly in LoadPanel(..)).

The UIR<->TUI conversion can be automatized by CVI Activex interface.

Be warned that there was several problems with UIR<->TUI in the past (i.e.images). It was fixed, But i recommend you to test it before you start with it.

0 Kudos
Message 2 of 4
(4,638 Views)

Hello,

Sorry, I was a little busy.

 

Thanks for your idea, I will try to use the TUI files (FR, then EN after modify them with translation).

I know them, but I not thought about them for this job.

 

I suppose that will not resolve my problem.

But it is not so huge to do, the controls are very simple,

so it could be try...

 

The "User interface localiser" do not propose to save the UIR or TUI with translation, Smiley Sad

 

I came back with results before the end of next week.


Certified LabWindows/CVI DEVELOPER (2004)
LabVIEW since 5.01 | LabWindows/CVI since 4.01
0 Kudos
Message 3 of 4
(4,591 Views)

Hello,

I have not yet test the TUI files, I will do it.

But during this time, we managed to improve to one of our functionality, into our software.

And until now, the problem seems to have disappeared.

We wanted to improve to "atoi" and "atof" functions, with added more treatment around : "±Inf", "xxx", wrong conversion, etc... => to have ±LONG_MAX or ±HUGE_VAL.

These functions used a small loop to check every characters.

Called too many time, it caused big software slowings down.

We re-work the error treatment around the "0" output, to avoid any loop, and the treatment software was divided by 10.

If that can help someone.


Certified LabWindows/CVI DEVELOPER (2004)
LabVIEW since 5.01 | LabWindows/CVI since 4.01
0 Kudos
Message 4 of 4
(4,554 Views)