# Mworks Monkey name

**URL:** <https://mworks.discourse.group/t/mworks-monkey-name/831>\
**Category:** Support\
**Created:** [October 3, 2022, 4:14pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831 "2022-10-03T16:14:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgouldin](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sgouldin](https://mworks.discourse.group/u/sgouldin)\
**Post date:** [October 3, 2022, 4:14pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/1 "2022-10-03T16:14:40Z")

</div>

Hi Chris,

I’m wondering if it’s possible to add a field to an mworks experiment file for recording the name of the monkey that is running. We want to use that field to name the .mwk2 files instead of naming the files after the user (ex. pico-normalizers-20220615-113241.mwk2 instead of datamaco-normalizers-20220615-113241.mwk2). Is this something we could get your help with?

Thank you,  
Sarah

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 3, 2022, 5:47pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/2 "2022-10-03T17:47:48Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 3, 2022, 5:47pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/3 "2022-10-03T17:47:48Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 3, 2022, 5:47pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/4 "2022-10-03T17:47:48Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 3, 2022, 5:47pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/5 "2022-10-03T17:47:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 3, 2022, 7:28pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/6 "2022-10-03T19:28:11Z")

</div>

Hi Sarah,

> [@sgouldin](#):
>
> I’m wondering if it’s possible to add a field to an mworks experiment file for recording the name of the monkey that is running.

Sure. The best way to do this is by adding a [data file device](https://mworks.github.io/documentation/latest/components/data_file.html) to your experiment.

First, create a variable with the monkey’s name:

```
var animal_name = 'pico'

```

Then, use that variable in the [filename](https://mworks.github.io/documentation/latest/components/data_file.html#filename) parameter of the data file:

```auto
data_file ("${animal_name}-normalizers-$(date('%Y%m%d-%H%M%S'))")

```

If you’re using the same protocol with multiple animals, then you could declare the variable and data file in the same MWEL file as the protocol:

```auto
var animal_name = 'UNKNOWN'
data_file ("${animal_name}-...")

```

and then have a separate file for each animal that [includes](https://mworks.github.io/documentation/latest/mwel/index.html#includes) the protocol and assigns the correct name:

```auto
%include 'shared_protocol.mwel'
animal_name = 'pico'

```

For a bit more info on data file devices, see [this post](https://mworks.discourse.group/t/how-to-change-default-save-directory/235/7). If you have any questions, please let me know.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![sgouldin](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sgouldin](https://mworks.discourse.group/u/sgouldin)\
**Post date:** [October 3, 2022, 8:16pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/7 "2022-10-03T20:16:53Z")

</div>

Thanks Chris! Will try this and get back to you if I’m failing.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 4, 2022, 1:09pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/8 "2022-10-04T13:09:23Z")

</div>



---

<div class="post-metadata">

**Author:** ![sgouldin](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sgouldin](https://mworks.discourse.group/u/sgouldin)\
**Post date:** [October 11, 2022, 6:51pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/9 "2022-10-11T18:51:11Z")

</div>

Hi Chris,

I tried this on one of our rigs, but I’m thinking our mworks version is too outdated to have data file devices? We have version 0.9 and I keep getting the error message “data\_file is not a valid component type signature”.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 11, 2022, 8:51pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/10 "2022-10-11T20:51:52Z")

</div>

Hi Sarah,

> [@sgouldin](#):
>
> I tried this on one of our rigs, but I’m thinking our mworks version is too outdated to have data file devices? We have version 0.9 and I keep getting the error message “data\_file is not a valid component type signature”.

Yes, data file devices were added in [MWorks 0.10](https://mworks.github.io/news/2020/09/08/0.10-released/). You’ll need to upgrade to a more recent release to use them.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![sgouldin](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sgouldin](https://mworks.discourse.group/u/sgouldin)\
**Post date:** [October 11, 2022, 8:54pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/11 "2022-10-11T20:54:13Z")

</div>

Thanks Chris, thought this may be the case. I will get back to you once we eventually do all the upgrades in Rig 1!

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 12, 2022, 3:51pm UTC](https://mworks.discourse.group/t/mworks-monkey-name/831/12 "2022-12-12T15:51:31Z")

</div>


