Sending string to a PLC
Costuz
✭
in RobotStudio
Goodmorning,
I'm working on a sort of application in witch i need to send to a PLC a string via Profinet that contain a serial number. For now the string is something similar to this one: "SN12345|123" but in the future it could change format.
My doubt is: how can i convert the single char of my string into bytes? So i can send it with the command "SetGO"? Cause the command StrToByte don't work.
For example:
I would like to have something like this:
sendString:= "SN12345|123";
I tried also with:
SETGO SendByte0, StrToByte(StrPart(sendString, 1, 1);
SETGO SendByte1, StrToByte(StrPart(sendString, 2, 1);
Ecc..
What is the correct way to do this?
Thank you all.
I'm working on a sort of application in witch i need to send to a PLC a string via Profinet that contain a serial number. For now the string is something similar to this one: "SN12345|123" but in the future it could change format.
My doubt is: how can i convert the single char of my string into bytes? So i can send it with the command "SetGO"? Cause the command StrToByte don't work.
For example:
I would like to have something like this:
sendString:= "SN12345|123";
SETGO SendByte0, StrToByte(sendString{1});
SETGO SendByte1, StrToByte(sendString{2});
SETGO SendByte2, StrToByte(sendString{3});
Ecc...
I tried also with:
SETGO SendByte0, StrToByte(StrPart(sendString, 1, 1);
SETGO SendByte1, StrToByte(StrPart(sendString, 2, 1);
Ecc..
What is the correct way to do this?
Thank you all.
0
Comments
-
Did you really create another user account to ask the same question as not very long time ago?Lee Justice0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings