# Getting Started with CVB.Net

**URL:** <https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246>\
**Category:** .Net API\
**Tags:** csharp, tutorial\
**Created:** [September 9, 2019, 10:00pm UTC](https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246 "2019-09-09T22:00:00Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![parsd](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/parsd/32/7_2.png) [@parsd](https://forum.commonvisionblox.com/u/parsd)\
**Post date:** [September 11, 2019, 11:54am UTC](https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246/7 "2019-09-11T11:54:42Z")

</div>

# Configure a Device with the GenApi

Often, before acquiring images from a `Device`, you want to configure it. So we open a `Device` as described in the previous post:

> [@parsd](#):
>
> # Acquire from a Camera (Console)

If the `Device` supports _GenICam GenApi_, then there will be `NodeMap`s:

> `device.NodeMaps.Count > 0`

Most of the time we are interested in the features of the camera (remote device):

> `NodeMap deviceNodeMap = device.NodeMaps[NodeMapNames.Device];`

For remote `Device`s we will always have at least the `NodeMapNames.Device` `NodeMap`.

With this `NodeMap` we can access the camera’s features. Let’s start with some reporting:

```auto
Console.WriteLine("Vendor: " + deviceNodeMap["DeviceVendorName"]);
Console.WriteLine("Model: " + deviceNodeMap["DeviceModelName"]);
Console.WriteLine("Version: " + deviceNodeMap["DeviceVersion"]);

```

This results in something like this:

```auto
Vendor: STEMMERIMAGING
Model: CVGevServer
Version: 3.4.0.797_C#-Example

```

What happened here? The indexer of the `NodeMap` returns a `Node` object. `Console.WriteLine` then calls `.ToString()` on these which is mapped to the derived types’ `Value` property:

```auto
// for StringNode you need: using Stemmer.Cvb.GenApi

var vendorName = deviceNodeMap["DeviceVendorName"] as StringNode;
Console.WriteLine("Vendor: " + vendorName.Value);

```

In case of a `StringNode` the `.Value` property is a `string`.

In case of _ExposureTime_ this would be a `FloatNode` (this is according to the _GenICam Standard Features Namimg Convention_ – _SFNC_):

```auto
var exposure = deviceNodeMap["ExposureTime"] as FloatNode;
exposure.Value = 40000.0; // unit is micro-seconds

```

You can also get other feature/type specific information like

- `.Max`: current maximal allowed value
- `.Min`: current minimal allowed value
- `.Increment`: the step-size: `feature.Min + x * feature.Inrement`

Common to all `Node`s is also the `AccessMode` which shows whether this feature is readable and/or writeable or currently not available at all. For better readability you can also use the `.IsAvailable`, `.IsReadable` or `.IsWritable` properties before trying to access `Node`s.

> **How to find the Node's type?**
>
> You can do it
> 
> 1. Programatically  
> By getting the `Node` and look up its type in the debugger (or calling `.GetType().Name`). This gives you its most derived type, of course. Normally you don’t want the `RegisterNode` interfaces, so you can simply use a `StringRegNode` as a `StringNode` as a `StringRegNode` derives from `StringNode`.
> 
> 2. Use the _GenApi Grid_. For the _Windows_ control (e.g. in the _Management Console_ or as in `Stemmer.Cvb.Forms.Controls.GenApiGrid`) you can use the context menu on a feature and open _Properties…_:

---

_[View the full topic](https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246)._
