Problem
Bellen
✭
in RobotStudio
I have a problem about RS232 communication with PLC, in rapid program, when running command WriteStrBin channel,”WR M450 1\od”, at PLC side, the M450 is 1, it’s OK.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
My question is, in the rapid program,
PERS num RM100:= 0;
PERS num RM101:= 1;
PERS num RM102:= 0;
PERS num RM103:= 1;
PERS num RM104:= 0;
I want use command WriteStrBin channel,”WRS M450 5 Data1,Data2,Data3,Data4,Data5\0d”,
to transfer RM100 to M450, (0)
RM101 to M451, (1)
RM102 to M452, (0)
RM103 to M453, (1)
RM104 to M454, (0)
How to write the code in the rapid?
Thanks
0
Best Answer
-
I am not sure I understand your questions, but you can combine strings together before you send the data out...Example:
VAR string sStringToWrite:="";
sStringToWrite:="WRS M450 5 " + ValToStr(RM100) + "," + ValToStr(RM101) + "," + ValToStr(RM102) + "," + ValToStr(RM103) + "," + ValToStr(RM104);
WriteStrBin channel,sStringToWrite +"\0d";
I hope this helps
�5
Answers
-
Yes, you are right, many many thank you for your help.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 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