# C# sample code

**URL:** <https://forum.velbus.eu/t/c-sample-code/15717>\
**Category:** For developers\
**Created:** [March 1, 2019, 9:13am UTC](https://forum.velbus.eu/t/c-sample-code/15717 "2019-03-01T09:13:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavier\_wielemans](https://forum.velbus.eu/letter_avatar_proxy/v4/letter/x/7feea3/32.png) [@xavier\_wielemans](https://forum.velbus.eu/u/xavier_wielemans)\
**Post date:** [March 1, 2019, 9:13am UTC](https://forum.velbus.eu/t/c-sample-code/15717/1 "2019-03-01T09:13:08Z")

</div>

Hi guys, I’m new to velbus but I have already worked with several “terrain bus” technologies (AS-i, Bechkhoff), I’m mostly developing in C# (within Unity for projects requiring a visual user interface, or directly in Visual Studio for console apps) and have done a lot of C/C++/Java in the past.

I am seeking to integrate Velbus in my catalog of solutions. For simple electronic I/O I usually rely on Arduino or Phidget boards, but I’d like to go a step further and be able to enjoy the power of Velbus.

Would anyone have some C# sample code that he is willing to share to help me get started? I’d like to read/write simple digital inputs/outputs on the modules present on the bus, using a VMBRSUSB module connected to my windows PC via USB.

I found a “VelbusLib” .net project on the web (from a link in one of the posts on this forum) but it is 10 years old so I guess there may have been changes in the protocols since then…

Any help/tip/words of sympathy will be most appreciated! 😉

Cheers,

Xavier

---

<div class="post-metadata">

**Author:** ![Stef\_Coene](https://forum.velbus.eu/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Stef\_Coene](https://forum.velbus.eu/u/Stef_Coene)\
**Post date:** [March 2, 2019, 12:08pm UTC](https://forum.velbus.eu/t/c-sample-code/15717/2 "2019-03-02T12:08:54Z")

</div>

I don’t know if there is a C# framework for Velbus integration.

I have written my own perl-based velbus code. It started with some perl code I found, but I wrote most code from scratch, step by step.

The protocol files are very handy but sometimes difficult to understand. You can find them here:

> **[velbus/moduleprotocol](https://github.com/velbus/moduleprotocol)**
>
> Protocol manuals for Velbus modules. Contribute to velbus/moduleprotocol development by creating an account on GitHub.

My software:

> **[StefCoene/velserver](https://github.com/StefCoene/velserver)**
>
> Contribute to StefCoene/velserver development by creating an account on GitHub.

I hope this helps.

Stef

---

<div class="post-metadata">

**Author:** ![xavier\_wielemans](https://forum.velbus.eu/letter_avatar_proxy/v4/letter/x/7feea3/32.png) [@xavier\_wielemans](https://forum.velbus.eu/u/xavier_wielemans)\
**Post date:** [March 18, 2019, 9:57am UTC](https://forum.velbus.eu/t/c-sample-code/15717/3 "2019-03-18T09:57:33Z")

</div>

Hello Stef! Many thanks for your reply!

In the meantime I have found an old C# project on the forum, “velbuslib”. Although it is 12 years old it still works perfectly, as far as I tested it. I love stable technology… 🙂

[http://www.velleman.eu/downloads/files/downloads/velbuslib.zip](http://www.velleman.eu/downloads/files/downloads/velbuslib.zip)

I am not familiar with Perl but I keep your project close by in case I need to understand some subtleties.

Met vriendelijke groeten,

Xavier
