Hello,
I am trying to communicate with a KR16 / KR C2 controller running the 4.1.5 version using a serial port.
I tried changing the settings in the hw_inf.ini & serial.ini file so that I can use the COM1 port but without any success (COPEN would always return a 0 handle regardless whether COM1=ENABLE or DISABLE) . Eventually I tried using the COM3 port on the MFC card with copen(:ser_3,handle) and I succeeded in opening the connection.
On the other end of the cable I have a WIN2K machine running a diagnosis tool which is listening on the serial port, however whenever I try sending any information using cwrite(handle,sw_t,mw_t,"%s","hello") but I always get the same data regardless of what I try sending (be it a string, a %i or %d etc.) :
7 bytes as follow:
00000010
00000010
00000010
00000010
00000010
00000010
00001111
Furthermore, sw_t.RET1 is not equal to #CMD_OK after cwrite executes.
I thought that since I am getting the same bytes everytime it might be the protocol or something like that (handshake?). But I made sure that in my serial.ini I have PROC = 4 for COM3 and in [XONXOFF] I set both XON_VAL and XOFF_VAL to 0 to use pure communication (and yes, I always restart when I change serial.ini).
BAUD = 9600 / CHAR_LEN = 8 / STOP_BIT = 1 / PARITY = 0
and the WIN2K machine has the same settings in the diagnosis tool. (Note that I am able to communicate using COM1 with hyperterminal between the KRC2 and WIN2K without any problems)
But still nothing, it seems as if the changes I make to the files are pointless. Heck, even if I set COM3 = ENABLE or DISABLE it doesn't make a difference.
Please if you have any idea on why I am unable to send data through cwrite drop me a few lines (be it in german or english)
Thanks in advance.