Share socket between two tasks
Good afternoon,
I am trying to send some messages through a tcp/ip socket. The problem is that I have a semistatic task and I want to send messages in this task too.
I have tried to declare the variable "socketdev" as a PERS in both programs, but I cant put a value when I declare them at the program, so the program shows an error.
Somebody knows how can I do it?
Thank you so much
I am trying to send some messages through a tcp/ip socket. The problem is that I have a semistatic task and I want to send messages in this task too.
I have tried to declare the variable "socketdev" as a PERS in both programs, but I cant put a value when I declare them at the program, so the program shows an error.
Somebody knows how can I do it?
Thank you so much
0
Comments
-
I am not 100% sure I understand your question, but let me suggest that you create a 3 task that handles all the communication for the socket. Then use variables to trigger the 3 task to send and receive the sockets. You could then just have your other two task set the variable values and then set a variable that would trigger the send. Then have the 3 rd task set a variable when it has received the information.
�0 -
SocketDev is a non value data type. As such, it must be VAR and not PERS. Use a different socket connection for the other task.Lee Justice0
Categories
- All Categories
- 5.5K RobotStudio
- 397 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 319 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 804 RAPID Programming
- 4 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings