1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

CHAR[] encoding and special/accentuated characters

  • lionpeloux
  • October 29, 2018 at 9:04 AM
  • Thread is Resolved
  • lionpeloux
    Reactions Received
    1
    Trophies
    3
    Posts
    47
    • October 29, 2018 at 9:04 AM
    • #1

    Hello,

    I'm rewriting a TP on a cell (KSS5.6, KRC2). At the moment messages are managed through a WOP package which has a dedicated message database called MessAppli.db in C:/DATA.
    However, I would prefer to manage the messages independently from the WOP and hard code my messages in a dedicated .dat file, in some kind of CHAR array. Or alternatively to have my own database.

    My first question is :

    Has my system is in french I need do display my messages in french. But .dat files are automatically transcoded to us-ascii when they are copied to /KRC/R1. Thus, I can't display properly my messages with special or accentuated characters from a CHAR[] variables such as :

    Code
    DELC CHAR myMessage[100] = "ééèèoùùàààl'l'l'"

    Apparently KRL can understand hexa coding inside a char array with the syntax :

    Code
    DELC CHAR myMessage[100] = "this a message with an 'H0E' inside"

    So is there a way to know the correspondance between special/accentuated characters and the corresponding hexa code (for instance : "à" => 'HXXX') ?

    My seconde question is :

    As I said previously, The actual way of doing this is through a message database, in my case named C:/DATA/MessAppli.mdb. This database has mainly two tables, the first is ITEM {keystring, keyid} and the second is MESSAGES {keyid, langid, message}. Thus, for a certain keystring i can display a message in a given language.

    When I call Set_KrlMsg (#NOTIFY, msg, msgParams[], msgOptions), if msg.MSG_TXT[] corresponds to a keystring that is actually present in MessAppli.mdb I will display the corresponding message string from the DB. Otherwise, I will simply display the content of MSG_TXT[]. Internally, Set_KrlMsg takes care of the encoding problem I am facing.

    So my question is what is the process to create my own independant DB and how can I tell the system to search in this database when calling Set_KrlMsg ? Is this just a matter of adding a regex key somewhere ? Is it more complicated ?

  • SkyeFire
    Reactions Received
    1,051
    Trophies
    12
    Posts
    9,426
    • October 29, 2018 at 3:56 PM
    • #2

    The database question, I can't address, having no experience in that specific area.

    For the character question, I'm fairly sure you're limited to basic 8bit ASCII. You can set a CHAR to an atypical value (like LineFeed or Carriage Return) by setting that CHAR to the Integer ASCII value of the character:

    Code
    DECL CHAR CarriageReturn
    CarriageReturn = 13

    I don't think you can do this with SWRITE, but one (crude) approach would be to directly write to a specific character position in the string, since a string in KRL is simply an array of CHAR.

  • Online
    panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,082
    • October 29, 2018 at 5:30 PM
    • #3

    dont have access to KRC2 or old enough version of Access to open message database... but...
    i agree, this is probably just ASCII. you can easily generate values using loop counter and see what they are on specific platform.
    inserting characters into string using SWRITE should be no problem using %c

    Images

    • ASCII.png
      • 72.65 kB
      • 1,067 × 600
      • 101

    Files

    ASCII.png_thumb 19.09 kB – 315 Downloads

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • SkyeFire
    Reactions Received
    1,051
    Trophies
    12
    Posts
    9,426
    • October 29, 2018 at 7:17 PM
    • #4

    On the issue of not being able to use DECL CHAR String[100] = "This is a message with 'H0E' inside it", have you tried this in a .DAT file?

    I ask b/c, when I DECL a CHAR array in a .DAT file, and then assign an integer ASCII value to part of the array using executable code, the resulting DECL line in the .DAT file looks almost exactly like that. Except that KRL requires an array be declared on one line, then initialized on the following line(s), so:

    Code
    DECL CHAR String[100]
    String[] = "This is a message with 'H0E' inside it"

    I've never tried writing a .DAT file that way, but in my experience, the contents of such an array should be identical regardless of whether it was written "offline" by a programmer, or filled dynamically by executable code.

  • lionpeloux
    Reactions Received
    1
    Trophies
    3
    Posts
    47
    • November 7, 2018 at 2:06 PM
    • #5

    THAT'S A GREAT IDEA :

    Quote

    generate values using loop counter and see what they are on specific platform.

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download