05-25-2017 03:15 PM
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??
Thanks!
Solved! Go to Solution.
05-25-2017 03:37 PM
It will be easier to help you if you post (VI not image) what you have done.
05-25-2017 04:33 PM
I'm actually using the examples which can be downloaded at the link provided (Unicode Examples 103-lv86.zip).
05-25-2017 04:51 PM
Your string "ASCII (hex)" is a mix of ASCII and UTF16LE.
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).
05-25-2017 05:14 PM
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.
05-26-2017 08:58 AM
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.
07-05-2017 05:39 AM
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
07-05-2017 12:49 PM - edited 07-05-2017 12:49 PM
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.
07-11-2017 03:09 AM
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
07-11-2017 10:29 AM
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.