# Help with global variables

**URL:** <https://forums.digi.com/t/help-with-global-variables/10292>\
**Category:** Rabbit\
**Created:** [April 16, 2009, 10:14pm UTC](https://forums.digi.com/t/help-with-global-variables/10292 "2009-04-16T22:14:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweit](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sweit](https://forums.digi.com/u/sweit)\
**Post date:** [April 16, 2009, 10:14pm UTC](https://forums.digi.com/t/help-with-global-variables/10292/1 "2009-04-16T22:14:09Z")

</div>

I’ve created some global char variables in my main program file. I would like to manipulate them in a library function. When I try to compile the program I get the following error:

> line 405 : ERROR MODBUS\_SLAVE\_RCM3610.LIB : Assignment to read-only variable not allowed.

What am I doing wrong?

Thank you

---

<div class="post-metadata">

**Author:** ![kobuseng](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kobuseng](https://forums.digi.com/u/kobuseng)\
**Post date:** [April 17, 2009, 9:39am UTC](https://forums.digi.com/t/help-with-global-variables/10292/2 "2009-04-17T09:39:23Z")

</div>

It should work, works in my program.  
Please show where you have declared your global variable in your main program, as well as where you are using it.

---

<div class="post-metadata">

**Author:** ![sweit](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sweit](https://forums.digi.com/u/sweit)\
**Post date:** [April 17, 2009, 12:38pm UTC](https://forums.digi.com/t/help-with-global-variables/10292/3 "2009-04-17T12:38:11Z")

</div>

Thank you for the reply.

I used different capitalization of the variable in the library file. It works fine now.
