Posted Wed, 09 Aug 2023 10:13:41 GMT by Bui, Quang Huy
Hi everyone,
I'm using library Ivi.Visa to commnucate with 4200A and below is my script to write and read command:
but Sometime, There were time out error happend Exception of type 'Ivi.Visa.IOTimeoutException' was thrown. and time out at Read command.
Sometimes this error occurs and I try to but delay ( sleep) about 10ms but It can't fix. 
Here is function write and read:

                            string command = string.Format("{0}{1}", cmd, "\0");
                            mbSession.RawIO.Write(command);
                            Thread.Sleep(10);
                            result = mbSession.RawIO.ReadString(lenString, out _readstatus);
                            MsgKeithely = string.Format("Query command {0} success. ReadStatus {1} >>> Result: {2}", cmd, _readstatus, ReplaceCommonEscapeSequences(result));
                            MainProcess.AddLogMessage(LOG_RUN.OK, MsgKeithely);

Here is while loop function:

 while (Math.Abs(Environment.TickCount - _timecount) <= _timedelay)
                            {
                                // Time Measurement
                                TimeSpan ts = TimeSpan.FromMilliseconds(Environment.TickCount - _timecount);
                                _dataTime.Add(ts.TotalSeconds);
                                string result;
                                // Voltage
                                cmdsend = "TV1";
                                result = QueryString(cmdsend);
                                _datavoltage1.Add(result);
                                // Current
                                cmdsend = "TI1";
                                result = QueryString(cmdsend);
                                _datacurrent1.Add(result);
                                //Thread.Sleep((int)(_StressConfig._INTERVAL * 1000));
                                Thread.Sleep(300);
                            }

Posted Thu, 25 Jul 2024 20:58:11 GMT by C, Andrea
When using LAN based connection to KXCI, it is normal for every config command you send to respond back with ACK\0.
Pg 2-11 in the KXCI Remote Control Programming manual shows ethernet based write and read examples.

For example, sending ME\0 command, the 4200A will respond back with ACK\0

In your code, if using LAN to KXCI, plan to do a write + read for every operation to pull the ACK\0 off the bus.

You must be signed in to post in this forum.