Posted Wed, 14 Jun 2023 10:54:22 GMT by Bui, Quang Huy
Dear all<br> I'm develop external software to communicate with Keithley 4200A SCS through Ethernet and using <strong>NationalInstruments</strong>.<strong>Visa </strong>library<br> After send command for measurement, I send &quot;SP&quot; command to checking measurement completed or not but error time out as image attached<br> Could you help me check this issue?<br> <br> Below is my config Visa and command sending:<br> <strong>Config Visa</strong> <blockquote> <p>mbSession = (MessageBasedSession)rmSession.Open(_resourcestring[0]);<br> mbSession.TimeoutMilliseconds = 2000;<br> mbSession.TerminationCharacterEnabled = true;<br> mbSession.SendEndEnabled = false;<br> mbSession.TerminationCharacter = 0xA;</p> </blockquote> <p><strong>Command send&#160;</strong></p> <blockquote> <p>BC.<br> DE.<br> CH1,'V1','I1',1,1.<br> CH2,'V2','I2',3,3.<br> SS.<br> VR1,0,5,1,0.1.<br> VR1,0,5,1,0.1.<br> DT 0.<br> HT 0.<br> IT2.<br> RS 5.<br> RS 5.<br> RP PMU1-1,2.<br> RP PMU1-2,2.<br> SM.<br> DM1.<br> XN 'V1',1,-1,1.<br> YA 'I1',1,-10E-12,-10E-3.<br> ME1.<br> SP</p> </blockquote> <p><strong>Command send and read</strong></p> <blockquote> <p>string command = string.Format(&quot;{0}{1}&quot;, cmd, &quot;\0&quot;);<br> mbSession.FormattedIO.WriteLine(command);<br> result = mbSession.FormattedIO.ReadLine();</p> </blockquote> <p></p>
Posted Fri, 16 Jun 2023 07:07:12 GMT by Bui, Quang Huy
Update<br> I changed config as below <blockquote> <p>mbSession = (MessageBasedSession)rmSession.Open(_resourcestring[0]);<br> mbSession.TimeoutMilliseconds = 2000;<br> mbSession.TerminationCharacterEnabled = true;<br> mbSession.SendEndEnabled = true; // before false)<br> mbSession.TerminationCharacter = 0x0; // (before 0xA)</p> </blockquote> <p>SP command already quired as normal but data not expectation and other command as well<br> Actually, I check KXCI is display correct data but at my code, It was return ACK<br> see picture as attached file<br> &#160;</p>
Posted Wed, 05 Jul 2023 12:22:01 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.

I think you are just having a lot of backlogged ACK\0 in the output queue that need to be read and this is why you do not get expected response to the SP or the DO commands.
 
Posted Mon, 10 Jul 2023 07:18:15 GMT by Bui, Quang Huy
Hi Andrea,
Right, I was missed reading for every command sending.
After input reading code in my app, now It worked well.
Thanks for your support!
 

You must be signed in to post in this forum.