How to program COM connection
zli
✭
Dear ALL,
We have a thermo sensor to be connected with robot controller through COM connection. The process is to send a command from robot to sensor, e.g "00ms
", then a value wiill be returned. However, the questions are:
", then a value wiill be returned. However, the questions are:
1. we can't define string as "00ms
".
".
2. What functions can be used for com communication. We used the code below:
Open "com1:", channelBin;
Writeanybin channel, rec; rec := ReadStrBin (channel, 10);
rec := ReadStrBin (channel, 10);
Close channel;
but it didn't work to get any response from sensor.
Can you please help us with this?
Thanks
Zack
0
Comments
-
HiHere is what I usally doOpen "Com1:", equipmentBin;
ClearIOBuff equipment;
WriteStrBin equipment,command;
stReadValue:=ReadStrBin(equipment,Characters,Time:=WaitT);haven't added the declarations of the variables but I guess you will understand anywayAlso do your sensor need CR/LF ? in that case I also would add "DA" to the send stringPer Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi Per Svensson,Thanks for reply.My sensor needs CR. I put command as "00msD", and use your code. Still no response.I connected sensor with PC. Program with c# to test sensor. Everything works fine to get data from sensor. I am confused about rapid code. How can I check what is wrong.Regards,Zack0
-
What you can do is to connect your PC to the robot controller to see if you get anything from the controller when you execute the robot program.
Could be- Communications settings (but I guess you have check thoose a couple of times allready)- Cable wiring (RTS,CTS ....)Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi Per Svensson,
We got our sensor working. Cable wiring was not properly set up before. Thanks for your help.Regards,Zack0
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)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings