KAREL read a string from Teach Pendant

  • Hi there,


    I'm currently working on a project for a company which produces many different types of pallets. I'm currently in school but working on a project for a company for 20 weeks, so I'm definitely no expert:).


    For this project I was thinking of making an ARRAY OF PALLETS (PALLETS I've already defined). Each pallet has a name (for example QWERT1234) and 7 other parameters (integers)


    I know I need to use the READ statement for the 7 parameters, but how do I read a string (for the name) from the teaching pendant? I'm not having any results reading the KAREL manual, so I'm hoping this forum can help me with my problem.


    Kind regards,

    Bram Aarssen

  • AD
  • I've never used it before but look at section 11 "Dictionaries and Forms" in the Karel manual.


    I have seen examples there that display a form to the user and allow them to edit fields.


    Also, there is some information in Example B.12 DISPLAYING A LIST FROM A DICTIONARY FILE.

  • Once I did something like this.

    I had one KAREL program which calculated positions for palatalizing.

    User set registers depending on product type: size of pallet, size of products, how many products were stacked and and if they overlapped in height and distance to next product.


    Each time you called KAREL program, it output next position.

  • I know what to do with the integer parameters. I just don't know how to read a string parameter.

    For example:

    Name = 'ABC123'

    Length = 1200 mm

    Width = 1200 mm

    Height = 160 mm

    ..............


    The length, width, height is easy: READ(<param>). But how do I read a string input ('ABC123', 'CBA321') which the operator enters from the teach pendent.


    Need to add that I've spoken with some people within my company and we're not going to do it this way, but I'm still curious;)

  • What does this mean? What string? Do you mean a string register? Or something the operator is typing on the pendant?

    Basicly I made a structure pallet which contains:

    Name:string

    Length:integer

    Width:integer

    Height:integer

    ... 3 other integers


    Within the program I wanted to give the customer the option to add a different type.

    Which would ask for a Name, Length, Width, Height... and save it within an array of my structure (pallet)


    So to select which pallet they wanted they would type in the name and it would search within the array for that name. If there would be a match the parameters would be set to the values within the array of that index.


    So if we've currently got:

    Length: 1000mm

    Width: 1000mm

    Height 140mm


    If we enter 'ABC123' which is the name at array[2]

    Length = array[2].Length

    Length = array[2].Width

    Length = array[2].Height

    ...


    That's what I wanted to design. But to enter a new type of pallet I needed to let the operator enter a name on the teaching pendent and save it to array[i].Name.


    Hope this clarifies my thinking process.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now