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