# Camera IP address

**URL:** <https://forum.commonvisionblox.com/t/camera-ip-address/609>\
**Category:** C-style API\
**Tags:** csharp\
**Created:** [December 10, 2018, 12:57pm UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609 "2018-12-10T12:57:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Farid](https://forum.commonvisionblox.com/u/Farid)\
**Post date:** [December 10, 2018, 12:57pm UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609/1 "2018-12-10T12:57:00Z")

</div>

When using `GenApi.NMGetNode(..)` , what is the correct string for the `nodeName`, so that the camera’s IP address could be queried ?

---

<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:** [December 10, 2018, 8:02pm UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609/2 "2018-12-10T20:02:40Z")

</div>

Hello @Farid

if the camera follows the [_GenICam Standard Features Naming Convention_](https://www.emva.org/wp-content/uploads/GenICam_SFNC_1_5_1.pdf) then the name would be:

> `Std::GevCurrentIPAddress`

But this feature is optional. You can also query the _Device TL_ nodemap for `Cust::DeviceIP`:

```cs
int result = Driver.INodeMapHandle2.GetNodeMap(cameraImage, "TLDevice", out SharedNodeMap deviceTLNodeMap);
if (result >= 0)
{
  result = GenApi.NMGetNode(deviceTLNodeMap, "DeviceIP", out SharedNode ipNode);
  if (result >= 0)
  {
    result = GenApi.NGetAsInteger(ipNode, out long ipValue);
    if (result >= 0)
      Console.WriteLine(IntToIPAddress((int)ipValue));

    ipNode.Dispose();
  }
  deviceTLNodeMap.Dispose();
}

```

with helper:

```cs
static IPAddress IntToIPAddress(int ipValue)
{
  var ipBytes = BitConverter.GetBytes(ip);
  if (BitConverter.IsLittleEndian)
    Array.Reverse(ipBytes);

  return new IPAddress(ipBytes);
}

```

… or with _Stemmer.Cvb.dll_:

```cs
Device device = ...; // see getting started to get such a device
var ipNode = device.NodeMaps[NodeMapNames.TLDevice]["DeviceIP"] as IntegerNode;
var ipAddress = IntToIPAddress((int)ipNode.Value);

```

---

<div class="post-metadata">

**Author:** ![Farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Farid](https://forum.commonvisionblox.com/u/Farid)\
**Post date:** [December 11, 2018, 12:43pm UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609/3 "2018-12-11T12:43:41Z")

</div>

Hi @parsd

Thank you for the info, I can get the IP now.  
Where would I be able to get a list of he strings which can be used for GenICam and Device TL ?

Thanks.

---

<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:** [December 11, 2018, 9:44pm UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609/4 "2018-12-11T21:44:40Z")

</div>

An easy way would be to use one of our camera configuration GUIs like the GenICam Browser which list all feature nodes (meaning the nodes intended to be used).

With the _Stemmer.Cvb.dll_ you can query all features nodes like this:

```cs
var nodeMap = device.NodeMaps[NodeMapNames.Device];
nodeMap.Where(entry => entry.Value.IsFeature)
       .Select(entry => entry.Key);

```

Or with the old wrappers:

```cs
GenApi.NMNodeCount(nodeMap, out int nodeCount);
var featureNames = new List<string>();
for (int i = 0; i < nodeCount; i++)
{
  GenApi.NMListNode(nodeMap, i, out string nodeName);
  if (GenApi.NMGetNode(nodeMap, nodeName, out SharedNode node) >= 0)
  {
    GenApi.NInfoAsInteger(node, (GenApi.TNodeInfo)20, out long isFeature);
    if (isFeature != 0)
      featureNames.Add(nodeName);
				
    node.Dispose();
  }
}

```

---

<div class="post-metadata">

**Author:** ![Farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Farid](https://forum.commonvisionblox.com/u/Farid)\
**Post date:** [December 12, 2018, 8:10am UTC](https://forum.commonvisionblox.com/t/camera-ip-address/609/5 "2018-12-12T08:10:27Z")

</div>

Hi @pasrsd

Thank you for the information.
