The correct way to instantiate an enum like this in Python .NET is:
stat = CML_EVENT_STATUS.EVENT_STATUS_BRAKE
Then you can call the method like so:
stat = amp.ReadEventSticky(stat)
Note that ref
and out
parameters don't work the same way in Python as in C#. As described in more detail in Writing iron python method with ref or out parameter, ref
and out
parameters are returned from a method instead of modifying the variables that were passed in. If there are multiple return values (e.g. the method returns a value and there is a ref
parameter), then a tuple will be returned with the method's return value first, followed by the ref
and out
parameters in order.
Assuming ReadEventSticky
is void
, this is pretty simple: it just returns the new CML_EVENT_STATUS
value.