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: 

Method of translation two language

Solved!
Go to solution

Hello!

Method of translation question, i use two language in my Vi. 

Sometimes the time of language change takes less than a second, but most often it's about ten seconds. In this case, the clock stops. Is Gremlin living in my computer?
Any ideas?
Thank you!!!

Download All
0 Kudos
Message 1 of 25
(4,065 Views)

 

solution.PNG

This solution is as helpful to you as your pictures are to me.  Please post your VI if you want someone to help you.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 25
(4,045 Views)

Maybe you are changing property nodes of booleans every iteration? 
If you write only when ru/eng changed it will be better

0 Kudos
Message 3 of 25
(4,014 Views)

I did a test program and you can see the delay. My program is much larger than this, and the delay is even greater. This results in loss of communication over the I / O device rs 232.
Sometimes this delay is less than a second, but I can not connect it with something specific.
This is a gremlin trick ...

0 Kudos
Message 4 of 25
(4,008 Views)

to: zxcpavel 

 

I already thought about it ....

 

I have a delay in the test vi  about 1.5 seconds. (the time  which all the label change to caption)

0 Kudos
Message 5 of 25
(4,005 Views)

Property nodes are slow and you have a lot of them. You can call 'Defer Front Panel Update' with value TRUE before you call all of your property nodes and set 'Defer Front Panel Update' to FALSE after your property nodes have finished.

See https://forums.ni.com/t5/Example-Programs/How-to-Disable-Enable-Front-Panel-Updates/ta-p/3530344 or http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/pnl_defer_pnl_updts/

This will result in one update of your entire front panel instead of many updates for every front panel element.

0 Kudos
Message 6 of 25
(3,991 Views)

@black1 wrote:

to: zxcpavel 

 

I already thought about it ....

 

I have a delay in the test vi  about 1.5 seconds. (the time  which all the label change to caption)


You have?

 

Your code shows you are executing all the property nodes every iteration.  Like zxcpavel says, you should only execute them when it changes.  When I run your code, it seems pretty fast and takes pauses about a second when I change the LED "button".  That tells me that LabVIEW is smart enough to know to not take time to update the screen appearance when things haven't changed.

 

What you can do is use Defer Front Panel Updates, setting to True before, and False after you set all of those property nodes.

0 Kudos
Message 7 of 25
(3,985 Views)

LabVIEW has all the tools to change language of front panel visible strings. As a first step, you need to export all front panel strings to a file, create other files that contain the same string in another language, then import the desired language strings.

 

I don't know how fast that all is, but maybe it is more optimized than what you are doing.

 

In any case, changing language is not something that needs be done many times during a run, so only allow it while the code is idle. You could even create a popup when the program starts to allow the user to pick a language, do it right then, and no longer allow it later.

 

(Some more comments on your method. You are switching between visible label and caption, so the caption never changes. Why are you rewriting the caption text constantly? You should also operate on an array of references and iterate over it. You only need one property node instead on dozens. This all should be done in an independent parallel loop, not inside your io loop.):

 

 

Message 8 of 25
(3,972 Views)

Many thanks to everyone, I will think and experiment how to proceed.

You are absolutely right that changing the language is not a critical task and can be done at the first start of the system or at idle.

Thank you!!!

 

(Some more comments on your method. You are switching between visible label and caption, so the caption never changes. Why are you rewriting the caption text constantly?):  

I do not know why I did it, I understood my mistake. )))) Thank you! I just need to change the visibility.

0 Kudos
Message 9 of 25
(3,964 Views)

The better method is to just change the caption text making it either the English word or Russian word and don't mess with the visibility of the label or caption.  Just hide the label and show the caption.  Then you only need to change the caption text programmatically.  What happens if you add a 3rd language?  You'll have to do that anyway and playing with the visibility of caption and label during the program would just complicate it.

Message 10 of 25
(3,960 Views)