question

Laurenz Peleman avatar image
0 Likes"
Laurenz Peleman asked Ben Wilson commented

Start event log by Flexscript

Dear all

I am looking for a coded way to start the event log for each scenario/replication when using the Experimenter, and to export the event log to csv files.

Regarding the export step, I found this answer already

https://answers.flexsim.com/questions/99618/how-to-operationalize-a-flexsim-model-error-handli-1.html

However, I cannot find which function name to add to the applicationcommand() to start the event logging on the start of each replication. Is this function also available?

Many thanks, kind regards

Laurenz Peleman

FlexSim 20.2.3
flexsim 20.2.3event log
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

I think it is a fundamental setting before you run a model, because you are going to log all of selected events of objects and the duration of the logging. And the first events occure on the list, when you hit the reset button already.

0 Likes 0 ·
Laurenz Peleman avatar image Laurenz Peleman Joerg Vogel commented ·

Thanks for your quick reply. If what you say is correct, how do I get what I want in that situation?

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Laurenz Peleman, was Patrick Zweekhorst's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Patrick Zweekhorst avatar image
1 Like"
Patrick Zweekhorst answered Phil BoBo commented

Hi @Laurenz Peleman,

Have you tried:

applicationcommand("seteventlogging",1,-1); // enable logging
applicationcommand("seteventlogging",0,-1); // disable logging

I have never used this but it seems to be the code you are looking for.
I would give this a try

Patrick

· 10
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
0 Likes 0 ·
Laurenz Peleman avatar image Laurenz Peleman commented ·

@Patrick Zweekhorst Thanks for your helpful answer. I don't know what the parameters 1 and -1 represent (is there any documentation on this applicationcommand()?), but it turns out that only a part of the events at time stamp 0 are collected when running your code...

0 Likes 0 ·
Patrick Zweekhorst avatar image Patrick Zweekhorst Laurenz Peleman commented ·

The first parameter seems to be the toggle on/off. I don't know why the parameter -1 is there. All I can see is that this is the code that is called if the check the checkbox for logging the events. I would assume that all events after you have called the code would be logged. If that is not the case someone from the FlexSim team in the US might be able to help you further.

1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ Patrick Zweekhorst commented ·

The -1 is for enabling/disabling event logging in general. You use the same command to enable/disable particular event type codes. See VIEW:/standardviews/eventlog/EventLogSettings>OnApply

1 Like 1 ·
Show more comments

Write an Answer

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

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.