-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New PLCException #65
New PLCException #65
Conversation
…s an Exception if the connection is not established 2. Implementation of PLCException. This Exception holds the Libnodave Error code for easier debugging 3. PLCGetBlockAsMC7 now throws an Exception if it is not able to upload
just a Question. Why does it fail on an Readonly Autoproperty? |
Communication\PLCException.cs(11,24): error CS0840: 'DotNetSiemensPLCToolBoxLibrary.Communication.PLCException.ErrorCode.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accesors |
Thank you for your work. I also wanted to rework some parts of the Library, at least my connection configuration class is from my C# starting days and needs to be reworked |
I also want to rework the connection configuration. I think tomorrow i will be able to make an new pull request. I have planed to replace all Int with their corresponding Enums. |
that was also a plan from me. if you done this already, thanks. |
The Connection configuration is now using Enumerations and Timespans where apropiate. This means existing code, using the configuration class directly might break. The configuration file also changed, but the system can load both, the new and old one! So the Configuration file loading mechanism is backwards compatible. 1. Changed int to corresponding Enumerations in PLCConnectionConfiguration and created new Enums where needed. 2. Changed ConnectionConfiguration Loading code, to minimize Breaking change impact. When the Connection file can not be loaded, it tries to fix the existing file and then retries once more. This means, the Configuration file is stil backwards compatible! 3. Timeouts are now defined as Timespan and not as int. PLCConnection is making apropiate use where necesary. 4. Refactored PLCConnection to use Enumerations 5. Refactored PLCConnection.Connect for better readability 6. Change ConnectionEditor so that the Timeout is now edited as miliseconds instead of microseconds. Internally it is an timespan anyway and the PLCConnection still converts it to Microseconds apropiatly 7. Addes lots of Comments to configuration parameters
OK. I just commited the reworked Configuration, its still not perfect, but its getting better. All Ints are Enumerations or Timespans now where appropriate. I but in some effort to keep the config file loading mechanism backward compatible. |
i will look |
thanks |
The Auto-Connect feature now has its own subroutine for easier handling, and also throws an exception if the Connection is not established and not set to AutoConnect
Implemented PLCException. The idea is that we have an Exception for PLC (libnodave) related error codes, with the corresponding ErrorCode to String conversion mechanisms. I refactored all "Exceptions" to "PLCExcetions" and thus eliminating nearly all calls to the "libnodave.daveStrerror".
Of course there is the "_errorCodeConverter" variable, that is not considered correctly at the moment. But it does not affect anything at the moment (The exception use the Managed version of the converter).
PLCGetBlockInMC7 now throws an Exception instead of returning Null on failure
This is very important for bugfixing, because if it returns Null there is no information about the actual error that caused the fucntion to fail