Hi All, I have been playing around with MOTOGSI. I want to use it to communicate with a python TCP server. Using the examples provided by Yaskawa, I can connect to an external python TCP server and send messages to it (which are received). However when I try to send any type of message back to the DX200, the safety system triggers and the controller shuts down with an error "Controller <--> Pendant Connection Failure". Has anyone had any experience with what might be going on?
I have also tested the GSI_UDPBIND and GSI_CHECKPATTERNBIN2_BLOCKING functions with the same results. Messages can get out, but anything incoming kills the controller.
My Inform Job:
Code
/JOB
//NAME GSI_TEST_TCP
//POS
///NPOS 0,0,0,0,0,0
//INST
///DATE 2012/08/02 12:18
///ATTR SC,RW
///LVARS 10,10,0,0,0,0,0,0
NOP
SET LB000 0
SET LI000 10
CALL JOB:GSI_TCPCONNECT ARGFLB000 ARGFLI000 ARGF"192.168.1.1" ARGF"15000"
SET LB001 B[LI000]
SET LI000 10
SET LI001 11
SET LI002 5
CALL JOB:GSI_MAKEBARRAY ARGFLI000 ARGFLI001 ARGFLI002 ARGF"HALLO"
CALL JOB:GSI_SENDDATA ARGFLB000 ARGFLI000 ARGFLB001 ARGFLI001 ARGFLI002
SET LI001 50
SET LI002 1
TIMER T=5.00
CALL JOB:GSI_READDATA ARGFLB000 ARGFLI000 ARGFLB001 ARGFLI001 ARGFLI002
CALL JOB:GSI_CLOSEHANDLE ARGFLB000 ARGFLI000 ARGFLB001
END
Display More
My python server
Code
#! /usr/bin/python
# a simple tcp server
import socket,os
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('192.168.1.1', 15000))
sock.listen(5)
while True:
connection,address = sock.accept()
buf = connection.recv(1024)
print buf
connection.send(buf)
connection.close()
Display More