Send string via Profinet to a PLC
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.
Post edited by SimoneCosti on
Tagged:
0
Comments
-
Hallo,you have to use \char switch when converting ASCII. See documentation.2
-
Yes, you're right
I used the format SetGO SendByte0, StrToByte(StrPart(sendString, 1, 1)\Char)
Thank you so much0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings