Anytime Help Center

AMX Using Extended ASCII Characters in NetLinx

Rating

Problem:

The dealer must use Russian language in a project, but when using Russian letters in a string, an error happens.

For example:

TempStr = "'Çîíà'

Log ("'Çîíà ¹', ITOA(ZoneNo), ' - Ïîëó÷åíà òðåâîãà'")

The error received during compile is:

WARNING: Ignoring unrecognized char [' = ASCII(39)] in input

ERROR: Parser State: [482]. Syntax error; expected one of the following: { ',', <Internal action $495> } but got: { STRING literal (', ITOA(ZoneNo), ') } Line:301 Col:0

This data must be written to a log-file in Russian. Is there a way to use these characters for this project?

Solution:

The problem is that the NetLinx compiler does not recognize these extended ASCII characters. The only way to make it work is to enter these characters in the decimal format.

For example:

These characters are in the extended ASCII character set.

Ç -has a decimal value of 128

î -has a decimal value of 140

í -has a decimal value of 161

à -has a decimal value of 133

They can be printed on our English language PCs by using the <alt> key and entering the decimal value. These characters can be typed in this fashion:

Çîíà

Using these keystrokes:

<alt>128,<alt>140,<alt>161,<alt>133

(The <alt> key is released after each set of numbers is entered.)

In NetLinx programming, the same characters can be sent by sending the decimal values of the characters.

Possibly, there is a need to display the characters Çîíà on a touch panel via variable text. This can be done in this manner:

SEND_COMMAND TP, "'TEXT1-',128,140,161,133"

If the character is in the middle of a word, the correct syntax would be:

Advíce

SEND_COMMAND TP, "'TEXT1-Adv',161,'ce'"

This same method would work when sending the text to a Log File.

Yes, this is not pleasant, but it is the only way you can accomplish the use of these characters without getting compiler errors.


Downloads

Product

 

Topic

Programming

Related Articles

Last modified at 3/30/2023 12:02 PM by PRO Knowledge Base
Top