RobotStudio event

Reading from a text file in RAPID

Options
Hello gentlemen,

we are quite new to RobotStudio and are trying to read information from text files into RAPID code. We've tried to follow instructions given in RAPID manuals but nothing seems to work. When we use commands such as GetText it seems like the editor loses all contact to both the virtual controller and the debugger. The debugger no longer finds any errors even though we deliberately type something wrong and when we run simulation after synchronizing to station it just runs older module not containing any "text commands". If we use commands such as open and readNum we get a message saying that we need the RobotWare option "files and serial channel handling". How can we get this option or maybe rather, what is the best way of reading text from files and what is needed?

Regards,
Bergur and Kalle

Comments

  • RussD
    Options
    In Robot Studio system builder, simply check the option File and Serial CHannel handling in the option list and it will be added to the system. On a real controller, you must have  this option in your keystring in order to add it to your system, but if I'm not mistaken the option is built-in to the core of RobotWare from 5.11 on. You might need to contact your local support organization to get an updated keystring if you have an pre-5.11 keystring. There is no other way that I am aware than the File and Channel instructions to open manipulate files.
    Russell Drown
  • Thanks a lot for that Russel. We've now managed to open the text file but are having problems reading from it. We get an error saying that the string is too long even though we only have one three digits number in the text file. We think it might have something to do with delimiters. Do you maybe know were we can find code snippets and examples of how the text files should look like?

    Regards,
    Bergur and Kalle  
  • RussD
    Options

    webwiz/22/file_and_serial.zip

    What function are you having problems with? There shouldn't be anything very special about the format, using notepad or something similar to write them should be fine. There shouldn't be any special delimiters required other than LF/CR that I am aware of.

     

    I have attached the manual for the file and serial option from 5.10. This should also be available on the documentation CD that comes with the robot.
    RussD2009-01-28 18:15:23
    Russell Drown
  • Thanks for the help Russel but we have switched to RAB since it is more flexible for our application.

    Regards,
    Bergur and Kalle