RobotStudio event

rawbytes

Options

Hi.

I'm currently working on some Rapid code that sends and receives commands using sockets. Currently I'm using strings for the actual data and because of this I'm limited to 80 characters. The strings that I send and receive are usually in the form of robtargets, pose's and such and I'm currently using StrToVal and ValToStr to do the conversion from/to the actual data types.

My problem is that the system I'm currently working on will require me to use a record that will contain a lot of components and because of this the generated string will be bigger than 80 characters. I have therefore looked at the type rawbytes to avoid the size limitation. The problem with this is that I wont be able to use StrToVal and ValToStr anymore.

I guess I could start writing a parser for the data that I will use but I was kind of hoping that there would be a better way to do it so I wont have to write a new parser every time I'm told to add a new record to the system. (RawBytesToVal and ValToRawBytes functions would have been so nice...)

Is there, or would it be possible to write, functions to convert between value types and rawbytes?



dfolker2012-03-02 18:22:54

Comments

  • John Wiberg
    Options


    >>Is there functions to convert between value types and rawbytes?
    Not to my knowledge.
     
    But, depending on who is sending and who is receiving, wouldn't it be simpler to divide up the record in multiple 80char strings and then recombine them at the receiver for a StrToVal conversion?
    I haven't tried it myself but have seen such a solution at an ABB partner.
  • Hi John.

    Sorry for not answering until now, but last week was a busy week to say the least. I actually ended up writing a small parser in RAPID to parse my rawbyte messages. The reason why I didn't split up my data into several messages is that the application the robot is communicating with is not exclusivly for ABB robots. So rather than handling the problem on the PC side and possibly creating more problems with other hardware I decided that the parser was the best way to go.

    A RawbyteToVal() would have been nice though Smile


  • John Wiberg
    Options

    [QUOTE=dfolker]A RawbyteToVal() would have been nice though Smile


    [/QUOTE]
    Agreed.
    If you want I could put it in as a feature suggestion, but if so you'd have to PM me with your company's details. Customer requests always goes before internal requests.
  • Tompanhuhu
    Options
    Is there anything like RawbyteToVal() now 10 years later?
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:
  • Tompanhuhu
    Options
    A ValToRawbytes() would be nice as well 👍
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile: