
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
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings