Sending a count variable to Raspberry Pi using sockets

I want to send to be able to send a count variable from a ur10 to a raspberry pi using sockets. Im not really sure how to do this but if you folks could provide some guidence

Perhaps this will get you started: Ethernet socket communication via URScript - 15678

See the Script manual for sending other data types…