LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Caption.Text in a Chinese or Vietnamese

Solved!
Go to solution

1) In labview diagram, if Unit=US, then Txt="Faulty Trigger Detection Threshold", if Unit=VN, then Txt ="Ngưỡng phát hiện lỗi đầu đo"
2) Assigned Txt to the "Caption.Text" Node Property
3) Font is set to Arial Unicode MS
4) Control Panel > Region > Language > Windows display language = Tiếng Việt (I have 2 languages packs installed: English and Tiếng Việt) When I run my Labview, if Unit = US, the Caption reads "Faulty Trigger Detection Threshold", however, if Unit = VN, the Caption reads weird incognizable characters.

Running Windows 11 and Labview 32 bit 21.0.1
I looked at this link: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIFDCA4&l=en-US but that is for previous Windows version, Windows 11 language setting has much less options.

please help

0 Kudos
Message 1 of 7
(165 Views)

ngthai_0-1732640288055.png

I do have these 2 lines in Labview.ini:
UseUnicode=TRUE
SuperSecretPrivateSpecialStuff=TRUE

ngthai_1-1732640412351.png

My main interest is changing the Caption (not the string value, but I update string value here as well just to show you all my problem):
If TXT1 is set to Vietnamese, then the String Value shows correctly, but not the caption. However, when set to English, the string value is supposed to reads "Faulty Trigger ..." but it is displaying weird characters.

For TXT2, if I set Vietnamese, both the Value and the Caption read wrong. Supposed to be "Ngưỡng phát hiện lỗi đầu đo"




0 Kudos
Message 2 of 7
(116 Views)
Solution
Accepted by topic author ngthai

The property "Force Unicode Text" only affects keyboard entry,

Displayed text is affected by the text property "Interpret as Unicode".  This property is like font attributes in that it can be different for different characters in the string.  When writing to that property it only affects the selected text.

Executing the following one time will set the caption to always interpret data as UTF-16 LE.

paul_a_cardinale_0-1732647787576.png

Message 3 of 7
(96 Views)

Thank you Paul,

Solution works.

Now I have 2 new problems: 
1) Caption 1 is actually in SETUP tab. Text 2 actually in FEATURE tab. When I change box 3 in Advance tab, the caption 1 and text 2 will be temporarily overlapping ugly like this. I had to click on any other tab, then come back to ADVANCE tab, then the overlapping would disappear.
2) Text 2 is not displaying the right Vietnamese (I do use InterpAsUnicode). I had to create a blank option on Box 3 to select (to blank out all the captions, and use same setting for InterpAsUnicode) then go back to Box 3 to Select Vietnam, in order for text 2 to display in the right Vietnamese language. Why?

ngthai_0-1732878642009.png
on problem 1: if I don't switch to different tab, and keep changing to different options on box 3, then all the captions and texts will eventually overlapping like this:

ngthai_1-1732882216827.png

 

 

0 Kudos
Message 4 of 7
(42 Views)

@ngthai wrote:

Thank you Paul,

Solution works.

Now I have 2 new problems: 
1) Caption 1 is actually in SETUP tab. Text 2 actually in FEATURE tab. When I change box 3 in Advance tab, the caption 1 and text 2 will be temporarily overlapping ugly like this. I had to click on any other tab, then come back to ADVANCE tab, then the overlapping would disappear.
2) Text 2 is not displaying the right Vietnamese (I do use InterpAsUnicode). I had to create a blank option on Box 3 to select (to blank out all the captions, and use same setting for InterpAsUnicode) then go back to Box 3 to Select Vietnam, in order for text 2 to display in the right Vietnamese language. Why?

ngthai_0-1732878642009.png
on problem 1: if I don't switch to different tab, and keep changing to different options on box 3, then all the captions and texts will eventually overlapping like this:

ngthai_1-1732882216827.png

 

 


I suspect that all your problems are due to InterpAsUnicode not begin applied to all the characters.

Doing this, one time, before sending any text to the caption, should have worked:paul_a_cardinale_0-1732886368768.png

But another technique is to do this:

paul_a_cardinale_1-1732886564369.png

 

Message 5 of 7
(33 Views)

Thank you. Problem #2 solved (using your suggestion to use Selection.End=9999).
However, problem #1 still exists (the captions keep appearing temporarily on the wrong tab) if I start the VI on "Page 2" tab. It appears if I start the VI on "Page 1" tab, then it's OK. Attached here is a simple VI.

ngthai_0-1732961416782.png

 

0 Kudos
Message 6 of 7
(16 Views)

So I conclude that this is Labview problem. Because if I remove InterpAsUnicode element out of the property node, then there is no overlapping text (showing up on wrong tab pages) problem (but of course, it will not show the correct unicode texts in certain languages).
Is there a way to solve this Labview "refresh" problem?

0 Kudos
Message 7 of 7
(12 Views)