I have an AXL2152 and am trying to read in a 3rd party IO-Link sensor to the IOL8.
I am able to successfully read in synchronous data (haven’t been able to make asynchronous work). I am then trying to publish this data over UDP.
I have it almost working, this is how far I’ve gotten:
IF socket_active = TRUE THEN
UDP_SEND_22(REQ := FALSE, HANDLE := serv_sock, DEST_IP := ip_address, DEST_PORT := 9999, DATA_CNT := data_size, DATA := iol_1_1_IN, ERROR => sender_error, STATUS => sender_status, BUSY => sender_busy, DONE => sender_done);
IF sender_busy = FALSE THEN
UDP_SEND_22(REQ := TRUE, HANDLE := serv_sock, DEST_IP := ip_address, DEST_PORT := 9999, DATA_CNT := data_size, DATA := iol_1_1_IN, ERROR => sender_error, STATUS => sender_status, BUSY => sender_busy);
END_IF
END_IF
Where iol_1_1_IN is the input global variable of the sensor. I have a small python script on the computer I am trying to read from that receives some times just garbage, and at best the first byte of the iol_1_1_IN WORD.
I have even tried writing this iol_1_1_IN to a buffer of a byte array, but this has had the same result. I can’t tell if this is an issue with how I am reading the data (I do not expect this), or how I am sending the data (I am more suspicious of this). I’d be beholden for a good structured text example using UDP.
Thanks in advance for the help.