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.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 829 RAPID Programming
- 13 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings