jr_BobDobbs Posted August 27, 2015 Report Share Posted August 27, 2015 I've got a working event logger that uses NLog.dll in LabVIEW. It does 95% of what I would like it to do, but I wanted to implement adding programmatic filtering. To filter a log event, you need to first create a rule (which works fine in LabVIEW), and than add a condition to it's list of Filters. The API reference for the ConditionExpression is here; http://nlog-project.org/documentation/v4.0.0/html/T_NLog_Conditions_ConditionExpression.htm There's an Operator that will convert a string to the Condition object that I need as an input to the ConditionExpression. But, since you can't call that in LabVIEW, anyone have any ideas on how to get around that? I suppose I could write a quick .dll myself that inputs a string and outputs the appropriate Condition object. Just didn't want to go down the path if I didn't have to. Quote Link to comment
Rolf Kalbermatter Posted August 27, 2015 Report Share Posted August 27, 2015 Since that is an abstract class you can't instantiate it. Abstract classes are similar to interfaces. They describe an object interface and implement part of the object but leave out at least one method to be implemented by the end user. Even in a real .Net language you would have to create an actual implementation of this class in your code that derives from this abstract class and implements all abstract methods of it LabVIEW can interface with .Net but can not derive from .Net classes itself. As such you can't pull this of without some external help. You will have to create a .Net assembly in VB or C# or any other .Net development platform that you are familiar in. This assembly has to impement your specific MyConditionExpression class that derives from ConditionExpression and then you can instantiate that from your assembly and pass it to this method. Quote Link to comment
jr_BobDobbs Posted August 27, 2015 Author Report Share Posted August 27, 2015 Thanks Rolf, that's the route I was figuring I'd have to take, I just thought that I'd consult with the experts here before going there. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.