# Send string via Profinet to a PLC

**URL:** <https://tech-community.robotics.abb.com/t/send-string-via-profinet-to-a-plc/11036>\
**Category:** RAPID Programming\
**Tags:** byte, conversion, robotstudio, rapid, string\
**Created:** [February 22, 2023, 6:18pm UTC](https://tech-community.robotics.abb.com/t/send-string-via-profinet-to-a-plc/11036 "2023-02-22T18:18:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimoneCosti](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@SimoneCosti](https://tech-community.robotics.abb.com/u/SimoneCosti)\
**Post date:** [February 22, 2023, 6:18pm UTC](https://tech-community.robotics.abb.com/t/send-string-via-profinet-to-a-plc/11036/1 "2023-02-22T18:18:16Z")

</div>

Goodmorning,

Actually i’m working on a project with a CRB15000, i’m programming it with Robotstudio. The Robot is mounting a camera that is going to read some serial numbers.

From the camera i receive a string similar to “SN1234|123” but it could be different.

I need to cast this string into an array of byte, so i can send it to my PLC via Profinet with SetGO.

For example:

PERS string sendString;

sendString:= “SN1234|123”;

SetGO SendByte0, StrToByte(sendString{1});

SetGO SendByte1, StrToByte(sendString{2});

Ecc…

But it didn’t work

I also tried with SetGO SendByte0, StrToByte(StrPart(sendString, 1, 1)) but it didn’t work.

What is the correct way to do it?

Thanks everyone.

---

<div class="post-metadata">

**Author:** ![matti](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@matti](https://tech-community.robotics.abb.com/u/matti)\
**Post date:** [February 23, 2023, 7:03am UTC](https://tech-community.robotics.abb.com/t/send-string-via-profinet-to-a-plc/11036/2 "2023-02-23T07:03:36Z")

</div>

Hallo,  
you have to use \char switch when converting ASCII. See documentation.

---

<div class="post-metadata">

**Author:** ![SimoneCosti](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@SimoneCosti](https://tech-community.robotics.abb.com/u/SimoneCosti)\
**Post date:** [February 23, 2023, 7:22am UTC](https://tech-community.robotics.abb.com/t/send-string-via-profinet-to-a-plc/11036/3 "2023-02-23T07:22:56Z")

</div>

Yes, you’re right  
I used the format SetGO SendByte0, StrToByte(StrPart(sendString, 1, 1)\Char)  
Thank you so much
