# Setting Exposure Time via Node Map

**URL:** <https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702>\
**Category:** Python API\
**Tags:** acquisition\
**Created:** [March 5, 2019, 3:48pm UTC](https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702 "2019-03-05T15:48:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://forum.commonvisionblox.com/u/Adam)\
**Post date:** [March 5, 2019, 3:48pm UTC](https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702/1 "2019-03-05T15:48:01Z")

</div>

Hi, in relation to your posts, i’m attempting to take consecutive photo’s with increasing exposure time, but i’m unsure how to alter the node value for exposure time?

this is what i have

```python
import os
import cvb

with cvb.DeviceFactory.open(os.path.join(cvb.install_path(), "drivers", "GenICam.vin"), port=0) as device:
    
    stream = device.stream
    stream.start()
    device_node_map = device.node_maps["Device"]
    #exposure = device_node_map["ExposureTime"]

    for i in range(10):
        
        device_node_map["ExposureTime"].value(i*1000)
        
    
        img, status = stream.wait()
        
     
        if status == cvb.WaitStatus.Ok:
            print("Acquired image: " + str(i))
        
        img.save("C:\\Users\\TechHP1\\Pictures\\newattempt" + str(i) + ".jpg")

        
    stream.stop()

```

anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![Theo](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/theo/32/482_2.png) [@Theo](https://forum.commonvisionblox.com/u/Theo)\
**Post date:** [March 7, 2019, 7:29am UTC](https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702/2 "2019-03-07T07:29:25Z")

</div>

Hi @Adam,

can you tell us more what actually is wrong with your code? On the first look this code seems ok to me.

Only thing I can imagine is that if the camera is in freerun mode you might be to slow to change exposure settings for each frame. Better would be to use a software- or hardware trigger.

regards,  
Theo

@illusive, can we copy this question to a new topic?

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://forum.commonvisionblox.com/u/Adam)\
**Post date:** [March 7, 2019, 11:10am UTC](https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702/3 "2019-03-07T11:10:55Z")

</div>

Hi, i managed to get it to work but i had to change the exposure time variable to a string and use the from\_string function, i couldn’t get the value function to work. The code below works as intended though if anyone ever wants to use it

```python
import os
import cvb

with cvb.DeviceFactory.open(os.path.join(cvb.install_path(), "drivers", "GenICam.vin"), port=0) as device:

#opens the camera
    
    stream = device.stream
    stream.start()

    #starts streaming

    device_node_map = device.node_maps["Device"]

    #calls the node map

    for i in range(10):
        exposure=(i+1)*10000
        val = str(exposure)

	#change exposure to a string and define variable

        device_node_map["ExposureTime"].from_string(val)

	#this changes the exposure time to whatever value val has        
    
        img, status = stream.wait()

	#waits till next image is ready and takes it        
     
        if status == cvb.WaitStatus.Ok:
            print("Acquired image: " + str(i))
        
        img.save("C:\\Users\\TechHP1\\Pictures\\newattempt" + str(i) + ".jpg")

        
    stream.stop()

```

---

<div class="post-metadata">

**Author:** ![Andreas](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/andreas/32/75_2.png) [@Andreas](https://forum.commonvisionblox.com/u/Andreas)\
**Post date:** [March 8, 2019, 7:19am UTC](https://forum.commonvisionblox.com/t/setting-exposure-time-via-node-map/702/4 "2019-03-08T07:19:36Z")

</div>

Hi @Adam,

at first I missed your issue - but now I see.  
`Node.value` is not a method but a property `device_node_map["ExposureTime"].value = i * 1000` should work fine.
