Just ran over this with a piece of my long-serving infrastructure code.
I have a small library for building and sending raw strings (not XML-formatted data) over EKI, that's been in service for, oh, a good ten years now. Runs flawlessly.
That is, until we ran it on some new robots running KSS 8.5 and EKI 3.0.
The reason I'm writing this up is that the problem doesn't throw any errors, and the manual appears to be incorrect about the behavior of EKI_SEND.
So, under EKI 2.x, the EKI_SEND function only accepted two arguments: the string to transmit, and the name of the XML "channel" file that defined the connection.
But EKI 3.0 adds a 3rd parameter, an Integer (which is described as "optional"). According to the 3.0 manual, this number explicitly describes the length of the string to send, and is only relevant for sending strings of variable length. Furthermore, there's a footnote that, if the string to be sent contains ASCII NULL characters, EKI_SEND only transmits the string up to the first NULL character.
Well, since I always set the entire string to NULLs before using SWRITE to transcribe the text I want to send, this should work. Especially since I always used a fixed-size string. So, by two different parts of the manual, my old code should have run without issue.
But it didn't. Once we added a number (the DECL'd length of the string being passed to EKI_SEND) as the 3rd argument passed to EKI_SEND, everything started working. I'm not entirely certain what was going on, but the PLC receiving the data seemed to just be getting 0-length strings.
The code, for those interested (the added bit bolded in red):
DECL CHAR _chSendString[300] DECL STATE_T _State DECL INT _nOffset DECL EKI_STATUS _EKIResult DECL TYPEKICHANNEL _EKIChannel
DECL INT _nIndex FOR _nIndex = 1 TO STRDECLLEN (_chSendString[])
_chSendString[_nIndex] = 0
ENDFOR
_nOffset = 0
; Start transmission line with Message Number SWRITE (_chSendString[], _State, _nOffset, "%d,", nMessageCodeMemory)
; Add Message, Module, and Buttons 1-7 SWRITE (_chSendString[], _State, _nOffset, "%s,%s,1,%s,2,%s,3,%s,4,%s,5,%s,6,%s,7,%s", FI_chText[], FI_chModule[],FI_chDialogSK1[],FI_chDialogSK2[],FI_chDialogSK3[],FI_chDialogSK4[],FI_chDialogSK5[],FI_chDialogSK6[],FI_chDialogSK7[])
; Append EOL character to transmission line SWRITE (_chSendString[], _State, _nOffset, "'H0A'")
; Append End-of-transmission character SWRITE (_chSendString[], _State, _nOffset, "'H17'")
_EKIResult = EKI_SEND (_EKIChannel.XML[], _chSendString[], STRDECLLEN(_chSendString[]))
Display More