Author Topic: String-Array in Conversion Character Properties ???  (Read 9264 times)

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
String-Array in Conversion Character Properties ???
« on: September 28, 2013, 02:06:49 PM »
It is possible to print one character to display by formatting it with "%c"
So, you can send a value (ASCII code), U8, to display and you will see one character.

But I want to send an whole string to display not only in fixed size fonts, in proportional fonts too (like Arial, and the other windows fonts).
So I don't know the position of the characters on display. I only know the string.

So I want to send a string in form of an array. The elements of the array are U8.

For example: Array ist: Array[6]U8 = (115,116,114,105,110,103) and display will show "string"
Also you can input a cursor instead of normal character and let it blink, so the user will see, where to input the next character!

This would be a very nice feature to print Text, which the user has typed in for documentations and so on.

Is this a good idea?
I use Guide 5.0 at the moment. Perhaps it is realized in newer version?
« Last Edit: January 28, 2015, 02:02:50 PM by Marbek_Elektronik »
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
Re: String-Array in Conversion Character Properties ???
« Reply #1 on: October 20, 2013, 05:02:31 PM »
 I have a lot of text to input in Display and later to print to a printer.
It is not easy!

Anybody here who have experience by inputing characters via display-keys?
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline 240glt

  • PLUS+1 Developer
  • ***
  • Posts: 35
  • Karma: +1/-0
Re: String-Array in Conversion Character Properties ???
« Reply #2 on: October 21, 2013, 11:26:37 AM »
Maybe you can define a maximum string length, and then fill it with spaces (20). If you have a copy of the array, where you replace one position of the string with a underscore _ then you have a cursor. Just switch between the original array and the copy to make the underscore flash. In the first array, at the same position as you have the underscore in the second array, you may load that ascii number into a up/down counter, and conenct the inputs to the up/down buttons. Then you may change the character with the arrowkeys, and you will have a blinking cursor. The position in the array may be changed by the left/right button, and you will be able to edit a fixed length of text.

But the problem is to display the text, it seems that you have to show every character by it's own %c on the screen. To show ten characters, you have to make a string like "%c%c%c%c%c%c%c%c%c%" and then connect ten different characters to it. I have just done that with two characters myself, I have never tried any longer texts.

We can just hope that it will be possible to directly connect an array to a text in the display in the future!

Offline Daniel

  • PLUS+1 Expert
  • ****
  • Posts: 74
  • Karma: +6/-0
Re: String-Array in Conversion Character Properties ???
« Reply #3 on: January 17, 2014, 03:11:36 PM »
Hi guys.

We have put together a little example application that you may find useful in this case. See this topic:
http://www.plus1forum.danfoss.com/index.php?topic=629.0

Best regards
Daniel
PLUS+1® HelpDesk
PLUS+1® Help Desk Team

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 352
  • Karma: +8/-0
    • Marbek Elektronik
Re: String-Array in Conversion Character Properties ???
« Reply #4 on: February 16, 2014, 10:55:17 PM »
Hi Daniel,

I want to send one longer string to the display, not one character.
It ist possible to define a text in display like "%c%c%c%c...." up to 24 times.
But you have to assign every "%c" to one data! So you have 24 datas to assign! it is a lot of work!

So the better way should be to allow to send a string to display:
For example array(24elements of U8) to display
in display you only assign this array to a string

Please think about to simplify to show strings in display. It is not simple.
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung