Closed mhanuel26 closed 6 years ago
Hi,
Instance of KPLogic works as a part of ScadaCommSvc.exe while instance of KPView is created by ScadaCommCtrl.exe. So you can't access from UI to an instance of Connection that is in the different application. You can interact by using read/write to files, WCF service or other method of communication between applications. You can also read the configuration ScadaCommSvcConfig.xml by the existing class if needed.
Hi Mikhail,
Thank you for your response,
Be free to ask.
Hello Mikhail @2mik
I am trying to do some dynamic menu for Communicator and so far I haven't able to do it, I am not positive if I am missing something that might help me in the task.
I have an Ethernet to Serial device that has a communication TCP port (different from Data) for configuration, the modbus KLogic using TCP client as communicator channel works really good for the data channel.
I want to integrate the configuration under Rapid Scada, so far I have the following basic Forms created and working.
The Serial Menu opens after the first one using the Serial Settings button. What I want is to be able to send configuration data using a button, such as the Apply button without leaving the UI. The problem is that I cannot use Connection property from KPView.
I have tried the following as a possible workaround without success
The example follows the KpTestLogic code (actually I did my project under this)
I defined a Connection property
private static Connection baseConnection;
Then I assign it's value under the OnConnectionSetmethod such asThe ugly part is to have a static method that do the write
from the Apply Button method I call it
It seems the baseConnection property is always null.
But from Session I can call the SendCommandToWiznet method and it works.
The reason I want to have it call from UI is because I have some GPIO that I want to visualize dynamically there, but also because I found the Session the only place to send over the channel and it seems it's called periodically based on the period defined in main window, which will make the settings taking effect dependable on that period.
I have study even the Communicator code without success since I don't know how can I get a reference to Connection in KPView, but also I understand it might not be a good idea to modify upper code, unless it take the forms of callbacks such asn OnConnectionXXX sort of.
For example a method that get called after closing the windows might help, such as OnPropertyViewClose...
I will appreciate your response,