New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
50 2 1 6

Synchronization manager for .NET to gather connection state?

Hi there,

I have an Excel sheet that updates market data on a regular basis if Eikon is connected. I can determine the connection status with the synchronization manager and then request the update (my Eikon is not connected all day, as I don't need it that intensively and the program is quite ressource-heavy).

I plan to get rid of the instable Excel file and build a .NET application for this. However, I do not manage to receive the connection status of Eikon from the .NET API. As soon as i want to check the connection status with Initialize(), the API opens EIKON.

Is there any other way to determine if the program is connected without automatically starting EIKON every time? Can I use the synchronization manager also in .NET?

eikoneikon-com-apiconnectioninitializationsynchronisation
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
39.4k 78 11 27

Thanks a lot @inercomp,

I finally understand. Yes, you are correct. Your application is not connected to Eikon until you initialize the connection, even if Eikon is already running. Eikon running and connection status are not the same thing. Connection status may be down even if Eikon is running, e.g. in case of communications failure such as network connectivity loss. The properties I mentioned in my first response can tell you whether your application is connected to Eikon and whether data services are available. They do not tell you if Eikon is running, even though when your application is connected and data services are available you can deduce that Eikon is running. If you want to check whether Eikon is running you can for example see if eikon.exe is among the processes running on the machine.

Does this help?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
4.6k 27 7 22

@inercomp

All desktop APIs require Eikon up and running while using them, so when you call Initialize(), API determines that Eikon is not running and launches it.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.4k 78 11 27

Hi @inercomp

In addition to the comment by Zhenya, rather than calling Initialize method of IEikonDesktopDataAPI interface, you can check Status property, which does not trigger the launch of Eikon application. However, if you consider closing and restarting Eikon during the runtime of you application, you should mind the following limitation of Eikon COM APIs: when Eikon application shuts down and your application using EikonDesktopDataAPI library is running, it creates a terminal state for your application. Even if you restart Eikon you won't be able to connect to it. The only way to recover from this state and re-establish connection to Eikon is to restart your application process.
Eikon .NET SDK provides better experience. It allows you to reconnect to Eikon after Eikon shutdown. It also provides State and IsInitialized properties you can use to check connection to Eikon without triggering the launch of Eikon application. The downside is that Eikon .NET SDK is only capable of retrieving real-time data and timeseries of price history. If you need fundamental and reference data, then I'm afraid there's no alternative to Eikon COM APIs yet.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
50 2 1 6

Hi Alex,

thanks for your answer. That would be excaclty what I need. However, I don't manage to get it running. To be honest, I am completely new to C#, so I might not exclude that I am using the API wrong. Here is what I tried on the basis of the tutorials:

COM-API

eikonConnect = new EikonDesktopDataAPI.EikonDesktopDataAPI();
Console.WriteLine(eikonConnect.Status);

If eikonConnect is not initialized, Status returned is allways "disconnected".

.NET API

Services = DataServices.Instance;
// check if we are online
Console.WriteLine(Services.State == DataServicesState.Up);

Services.State is always none.

Maybe I used something wrong here. Could help me out here, Alex? Thanks!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.4k 78 11 27

Hi @inercomp,

Sorry, I don't think I understand what you're struggling with. Could you elaborate on what you mean by "I don't manage to get it running"?
What you see is what you should expect. In case of Eikon COM APIs before you initialize EikonDesktopDataAPI, its status is indeed Disconnected. What did you expect it to be?

And in case of Eikon .NET SDK it is perfectly expected that Services.State returns None before DataServices are initialized. You could also add
Console.WriteLine(DataServices.Instance.IsInitialized.ToString());
which will return "False".

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
50 2 1 6

Hi @Alex Putkov.,

what I would like to do is to check for Eikon connection on my PC without auto-opening of Eikon when it's closed. As soon as I initialize EikonDesktopDataAPI and there is no connection, Eikon is opened automatically. I thought from your post that I could check the connection status without triggering Eikon.

Is it correct that your post says that i need to initialize the connection once (which will in any case result in triggering Eikon) but can then check status continuesly? Or is there a way to check if Eikon is runnign without triggering EIKON at all?

Thanks.

PS: The .NET SDK API would be sufficient for my stuff.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.4k 78 11 27

Hi @inercomp,

Yes, you can indeed check connection status without triggering the launch of Eikon. No, you don't need to initialize the connection (not even once), which triggers the launch of Eikon, in order to check the connection status. I don't know where in my posts you found the idea that you need to initialize the connection in order to check its status. I said no such thing. The code snippets included in your previous post do exactly what you ask for, which makes me feel quite confused about what it is that you're struggling with. Both code snippets you included return connection status, and since Initialize method is not included in these snippets, Eikon will not be launched when you run this code. Given that you got the connection status result from the snippets you included, I figured that you must have tested this code. In which case I'm afraid I don't understand what you're missing or what else you need.

Sorry for all the confusion. I'm trying to help, but I'm afraid I'm struggling to understand what it is that you find challenging here.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
50 2 1 6

Hi, I am really glad your are trying to help me out here, its really important for me.

In fact, I tested the code snippets above and although I had Eikon up and running, the status returned always "disconnected" - although I had Eikon open at this time. I do net get a status other than disconnected, if I do not initialize.

Hope this is understandable.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
50 2 1 6

Thanks, now its clear to me...

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.