LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting a unicode

Solved!
Go to solution

blockdiagram.pngfrontscreen.png

Hi I've been try to update a label takes text to one that displays text and a special character. The character being the dc symbol ⎓. I have LabVIEW set to Unicode = true.

The full string i have in the text box is RX CLASS 2 5v ⎓ 1A, but when I print i get RX CLASS 2 5v '# 1A, I've tried the format of the text box but nothing changes. I derived the symbol by using word and typing 2393 ALT x then put the symbol in notepad.

Could someone give me any pointers on this

 

0 Kudos
Message 1 of 9
(1,928 Views)

You need the NI Unicode VIs:

LabVIEW Unicode Programming Tools - Discussion Forums - National Instruments

 

 

 

 

George Zou
0 Kudos
Message 2 of 9
(1,864 Views)

Just be aware that using Unicode in your code is unsupported, and for good reason.  I've seen the Unicode setting destroy VIs not meant to have Unicode in an irreversible way.  All you have to do is open a VI with Unicode in it and then open one that doesn't need it and you could be fetching an old version from your SCC shortly.

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.
0 Kudos
Message 3 of 9
(1,861 Views)
Solution
Accepted by topic author ianchisholm

In addition to the UseUnicode="True" setting in labview.ini, the text attribute "Interpret As Unicode" must be set to true.  Note that this is like other attributes in that it can be applied chr by chr.  When you use the property iau.png, it only applies to the selected text, not the entire string.  See attachments

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 9
(1,849 Views)

Thanks zou billko for the great info and thanks to  paul_cardinale for the vi's this looks like what I'm after , i need to check the fonts on the printer can handle the graphics.

 

thanks again

0 Kudos
Message 5 of 9
(1,819 Views)

Hi Paul, Sorry to reopen a solved page (not sure if it should be a new post?) with regards to the software example you supplied that looked to be bang on , an issue I believe I'm having now is the printer (intermec pc43t) I believe only accepts 8 bit utf encoding and the out put of the vi is 16bit. Printer is ok up to LATIN SMALL LETTER Y WITH DIAERESIS (U+00FF) but falls over at LATIN CAPITAL LETTER A WITH MACRON (U+0100) and above. for testing i was using the copyright symbol U+00A9 and the dc symbol U+2393. Is this code able to convert to 8 bit utf. I tried converting to 8 bit but have struggled with it. i was looking to try the utf 8 coding below

UTF-8 Encoding: 0xE2 0x8E 0x93
UTF-16 Encoding: 0x2393

any help would be appreciated

0 Kudos
Message 6 of 9
(1,772 Views)

Attached find my (still very incomplete) Unicode library.

The functions you will most likely find useful are:

  • ASCII to UTF-16.vi
  • Code Points to UTF-8.vi

Note however that strings constructed with the functions I previously posted will most likely result in text that is not purely UTF-16, but rather a combination of ASCII and UTF-16.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 9
(1,762 Views)

Hi Paul thanks for the collection there's a lot to learn there, I've tried to amend the 16 bit to 8 bit using the 

  • Code Points to UTF-8.vi but no joy I don't think I'm understanding the format of using the 16 bit unicode 2393...
  • and the 8 bit
    UTF-8 Encoding: 0xE2 0x8E 0x93
    does the 8 bit have to use the three hex values?. ive attached a screen shot of what i was tring to do

regards

 

ian8bit.png

0 Kudos
Message 8 of 9
(1,753 Views)

@ianchisholm wrote:

Hi Paul thanks for the collection there's a lot to learn there, I've tried to amend the 16 bit to 8 bit using the 

  • Code Points to UTF-8.vi but no joy I don't think I'm understanding the format of using the 16 bit unicode 2393...
  • and the 8 bit
    UTF-8 Encoding: 0xE2 0x8E 0x93
    does the 8 bit have to use the three hex values?. ive attached a screen shot of what i was tring to do

regards

 

ian8bit.png


The VIs do what there names imply:

  • "Append Code Point(s) to Text.vi" accepts an array of Unicode code points and appends them as UTF-16 LE to an existing text object.  If that text object already had ASCII characters in it, then it will end up being a mix of ASCII and UTF-16 LE.
  • "Code Points to UTF-8.vi" accepts an array of Unicode code points and outputs a UTF-8 string.

UTF-8 can have 1, 2, 3, or 4 bytes per character, depending on the specific code point.

 

Note: Post VIs, not pictures.  No one will try to debug a picture.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 9
(1,739 Views)