LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode in LabVIEW?

Solved!
Go to solution

Hi,

 

I found this reference document and library detailing how to use Unicode characters in LabVIEW.

http://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Unicode-Programming-Tools/ta-p/3493021

 

Although it is a very detailed and well written, I'm having trouble using the examples in LabVIEW 2016. Specifically, I'm trying to insert a capital Omega symbol (Ω) into a table and write to a text file. I downloaded the library and have tried using the "Convert ASCII to Unicode" example. I am entering the symbol in the control using ALT+234 where it displays correctly but am unable to show the symbol in the unicode indicator. Similarly, when I try the "Display Unicode Strings in Table and List Box" example, I get garbled results. What am I doing wrong? I'm hoping somebody has more experience using this library??

 

Unicode example.png

 

Unicode example-table.png

 

 

Thanks!

 

 

 

0 Kudos
Message 1 of 27
(11,259 Views)

It will be easier to help you if you post (VI not image) what you have done.

0 Kudos
Message 2 of 27
(11,241 Views)

I'm actually using the examples which can be downloaded at the link provided (Unicode Examples 103-lv86.zip).

0 Kudos
Message 3 of 27
(11,225 Views)

Your string "ASCII (hex)" is a mix of ASCII and UTF16LE.

Omega.png

You apply a conversion "ASCII to Unicode" on a mix of ASCII and UTF16LE.  The character Omega (xA903) is now xA900 (copyright) and x0300 (EXT - end of text).

Message 4 of 27
(11,220 Views)

Thank you for the response Jean-Marc. I thought that might be the case also and tried just the Omega character by itself with the same results. Enabling "Force Unicode Text" on the control doesn't seem to help either.

 

2017-05-25_15-10-06.png

0 Kudos
Message 5 of 27
(11,213 Views)
Solution
Accepted by topic author Ricky77

As mentioned, the Ω symbol is not part of the Extended ASCII character set in the default Windows code page. When you see it, it is represented in Unicode.

 

In your application I recommend to convert any ASCII to Unicode first, and then concatenate your Unicode string in your diagram before displaying it or saving to file.

 

UnicodeOhm.png

 

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
Message 6 of 27
(11,172 Views)

Hello,

I have a question about the example shown in the image of solution.

I am developing an application which has to be traslated in russian (with cyrillic characters).

My application reads the strings to traslate from an excel file and replace the caption as well as the boolean text on the front panel controls on which is also enabled the interpretAsUnicode property.

This is properly working, at least running from source code, my question is:

I also need to translate TabCaption, TipStrip and Description, but I cannot find the InterpretAsUnicode property for these part of the controls.

Is someone able to help me?

Thanks

Message 7 of 27
(11,034 Views)

re. TabCaption: from the comments in the original Unicode article:

 

If you meant the caption of the whole tab control, you can use Tool_Unicode Update Caption.vi to make this change.

 

If you are asking about the name of each individual tab in the tab control, then you can not change it programmatically. This is because the name of the tab is part of the programming logic and can not be changed at run-time. For example, if you wire the tab control terminal to a case structure in your diagram, the case names take on the names of the individual tabs, and these can't be changed at run-time. The tabs do not have a caption separate from their logical names, like the control does as a whole.

 

To solve this problem you can overlay a classic string indicator with transparent background over each tab and update its value for your localized names. You'll need to make the color of the strings in the tab the same as the background so that the user doesn't see them. You also need to add code to detect mouse clicks on the overlay strings to change the active page of the tab control when the user clicks on the tab while the VI is running.

 

The TipStrip and Description properties also do not support Unicode unfortunately.

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 8 of 27
(11,003 Views)

You are wrong, the caption of each page in the tabControl can be programmatically changed, you only have to set each caption page to does not match the label page (as you can see in the image). I am actually doing it, my only issue is on UNICODE characters which apparetly is not supported for the caption pages

 

0 Kudos
Message 9 of 27
(10,955 Views)

You are correct, and I addressed this in the comments of the original Unicode Programming Tools document. 

 

In short, you can programmatically change the caption of the Tab pages, but you can not programmatically switch the caption between Unicode and ASCII interpretation. You must switch each caption to Unicode interpretation manually at edit time, by pasting a Unicode string into each caption. Then, you can programmatically change the caption using a Unicode string. If you want to display English or other Latin characters, you need to use the Unicode version of that string.

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 10 of 27
(10,935 Views)