AnsweredAssumed Answered

Delphi XE7 and 33220A Over LAN

Question asked by jesawyers on Mar 18, 2015
Hello All,

New to the forums and this is my first post.

I'm writing a Delphi XE7 Starter Edition application to control a 33220A over TCPIP.  I found the Delphi example from 17 May 2006 and I'm using this to guide me.  I'm running 64-bit Win7 but the Delphi application is a Win32 application.

I have setup the IP settings on the 33220A and can ping the device from my laptop. Version 17.0 of the IO Libraries have been installed on my laptop.

So the application is a simple TForm with a single "Connect" button.  When the button is pressed, I try to open a connection to the 33220A...See my code below.

A exception error is not generated, however, when I look at the Win7 Event Viewer for AgilentIOLibraries I get the following errors...

ilan<> Error 130, core connect failed: RPC: Remote system error - Error 0 
ilan<> Error 130, lan_core_createSync() failed
ilan<> Error 130, unable to setup connections to server
ilan<> Error 130, core connect failed: RPC: Remote system error - Error 0 
ilan<> Error 130, lan_core_createSync() failed
ilan<> Error 130, unable to setup connections to server
AgtLan: agtlanOpen: Both Sicllan and Vxi11 protocol connections failed for [172.17.0.245]:inst0


So not sure what to do here.  Could there be a COM issue with Win7 64-bit with a 32-bit application??

Thanks for any help...John

***************************************************************************************
*ADDITIONAL INFORMATION*

Using the Keysight Connection Expert, it does not see the 33220A when plugged into the network.
Did a manual Configuration for TCPIP0::172.17.0.245::inst0::INSTR and the link shows invalid.
When I did a USB connection, Connection Expert sees the device.
*So this is telling me, along with the errors reported above, that the 33220A does not support this kind of connection.  Right?*



Here is my code...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
unit Agilent_WaveformGeneratorUnit;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, ActiveX, VisaComLib_TLB;

type
  TMnForm = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MnForm                : TMnForm;
  ResourceManager : IResourceManager3;
  IO                        : IMessage;
  Session                : IVisaSession;
  returnCount           : Integer;
  readResult            : WideString;

implementation

{$R *.dfm}


procedure TMnForm.Button1Click(Sender: TObject);
begin

     try

          CoInitializeEx(NIL,COINIT_APARTMENTTHREADED);
          ResourceManager := CoResourceManager.Create;
          *ResourceManager.Open('TCPIP0::172.17.0.245::inst0::INSTR',NO_LOCK,0,'',Session);*

          //IO.WriteString('*RST',returnCount);
          //IO.Clear;


     except

          on E : Exception do ShowMessage('Exception Error Occured...' + E.ToString);

     end;


end;

procedure TMnForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin

     //Session.Close;
     //IO.Close;
     ResourceManager := nil;

end;

Edited by: jesawyers on Mar 18, 2015 4:18 PM

Edited by: jesawyers on Mar 18, 2015 4:23 PM  

Outcomes