Hello together,
i'm working with the COMAU NM45 2.0 and a C4G control. Therefore i have one problem which occurs after established a TCP Connection through the X5 plug within the C4G control. The TCP connection is established but after i transmitted one string to my server i get an error alarm : "ALARM" i can read "5632 40033-4:tcp_3(46): Fehler 15473 in WRITE". Since i need more data in a higher speed of the actual angles of the joints the outcome for now is not really sufficient. Can anybody help me with the attached code ?
Code
PROGRAM tcp_3 NOHOLD
CONST
ki_dv_tcp_accept = 29 --UNCOMMENT ?
ki_dv_tcp_connect = 30
ki_dv_tcp_disconnect = 31
li_max_message = 40
VAR
vi_client_netlun : INTEGER
vi_remote_port : INTEGER
va_start : INTEGER
va_end : INTEGER
vs_client_write : STRING[li_max_message]
vs_client_read : STRING[li_max_message]
vs_server_host : STRING[100]
robot_angle_ex_1 : JOINTPOS
send_var : STRING[80] NOSAVE
BEGIN
DELAY 2000
vi_remote_port := 4321
vs_server_host := '172.22.121.40'
va_start := 10
va_end := 9
OPEN FILE vi_client_netlun ('NETT:', 'rw')
DV4_CNTRL(ki_dv_tcp_connect, (vi_client_netlun), (vs_server_host), (vi_remote_port)) --ESTABLISH TCP IP CONNECTION
IF ($DV_STS = 0) THEN
--WRITE LUN_CRT ('Conected To: ', vs_server_host, NL)
--robot_angle_ex_1 := ARM_JNTP(1)
--ENCODE(send_var,robot_angle_ex_1[1])
--vs_client_write := send_var
WHILE va_end < va_start DO
robot_angle_ex_1 := ARM_JNTP(1)
ENCODE(send_var,robot_angle_ex_1[1])
vs_client_write := send_var
WRITE vi_client_netlun ('[Client-Server] ', vs_client_write, NL)
DELAY 500
ENDWHILE
--WRITE vi_client_netlun ('[Client-Server] ', vs_client_write, NL)
--READ vi_client_netlun (vs_client_read)
--WRITE LUN_CRT (vs_client_read, NL)
DV4_CNTRL(ki_dv_tcp_disconnect, (vi_client_netlun)) --DISCONNECT TCP IP CONNECTION
DELAY 100
CLOSE FILE vi_client_netlun
ELSE
--WRITE LUN_CRT ('Disconnected', NL)
--DELAY 100
--CLOSE FILE vi_client_netlun
ENDIF
END tcp_3
Display More
Best Regards