# Usage of C-Script Macro SignalInput(int, init) in "Code Declarations"

**URL:** <https://forum.plexim.com/t/usage-of-c-script-macro-signalinput-int-init-in-code-declarations/981>\
**Category:** PLECS\
**Tags:** c-script\
**Created:** [March 9, 2021, 2:58am UTC](https://forum.plexim.com/t/usage-of-c-script-macro-signalinput-int-init-in-code-declarations/981 "2021-03-09T02:58:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcel](https://forum.plexim.com/u/marcel)\
**Post date:** [March 9, 2021, 2:58am UTC](https://forum.plexim.com/t/usage-of-c-script-macro-signalinput-int-init-in-code-declarations/981/1 "2021-03-09T02:58:37Z")

</div>

Hi all,

I’d like to copy data at C-Script-input-ports to MyFunctions.c code.Since this is a boring job, I need to do very often, I decided to write a helper to do so.This helper need to access “SignalInput()” macro, which seems to be defined in “Output function code” section only.How to access this in a helper-function as descripted below?

Some pseudo code:

```auto
<code declarations>
#define <MyFunctions.c>
#define <copyInputsToMyFunctionsHelper.c>
</code declarations>

```

The file copyInputsToMyFunctionsHelper.c consists of:

```auto
void coypData(int port, MyFunctions::DataStruct* data){
   int i = 0;
   data->element = SignalInput(port, i++);
   ......
}

```

```auto
<Output function code>
copyData(0, &datastructA);
copyData(1, &datastructB);
......

// calc. something with datastructA...
// assign to SignalOutport( port, index)
</Output function code>

```

Thank You!Marcel

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [April 1, 2021, 11:25am UTC](https://forum.plexim.com/t/usage-of-c-script-macro-signalinput-int-init-in-code-declarations/981/2 "2021-04-01T11:25:21Z")

</div>

Hello, it’s not clear what you are trying to do. Can you provide a more complete example?
