def grab_next_image_by_trigger(nodemap, cam):
    '\n    This function acquires an image by executing the trigger node.\n\n    :param cam: Camera to acquire images from.\n    :param nodemap: Device nodemap.\n    :type cam: CameraPtr\n    :type nodemap: INodeMap\n    :return: True if successful, False otherwise.\n    :rtype: bool\n    '
    try:
        result = True
        if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
            input('Press the Enter key to initiate software trigger.')
            node_softwaretrigger_cmd = PySpin.CCommandPtr(nodemap.GetNode('TriggerSoftware'))
            if ((not PySpin.IsAvailable(node_softwaretrigger_cmd)) or (not PySpin.IsWritable(node_softwaretrigger_cmd))):
                print('Unable to execute trigger. Aborting...')
                return False
            node_softwaretrigger_cmd.Execute()
        elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
            print('Use the hardware to trigger image acquisition.')
    except PySpin.SpinnakerException as ex:
        print(('Error: %s' % ex))
        return False
    return result
This function acquires an image by executing the trigger node.

:param cam: Camera to acquire images from.
:param nodemap: Device nodemap.
:type cam: CameraPtr
:type nodemap: INodeMap
:return: True if successful, False otherwise.
:rtype: bool
def grab_next_image_by_trigger(nodemap, cam):
    '\n    This function acquires an image by executing the trigger node.\n\n    :param cam: Camera to acquire images from.\n    :param nodemap: Device nodemap.\n    :type cam: CameraPtr\n    :type nodemap: INodeMap\n    :return: True if successful, False otherwise.\n    :rtype: bool\n    '
    try:
        result = True
        if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
            input('Press the Enter key to initiate software trigger.')
            node_softwaretrigger_cmd = PySpin.CCommandPtr(nodemap.GetNode('TriggerSoftware'))
            if ((not PySpin.IsAvailable(node_softwaretrigger_cmd)) or (not PySpin.IsWritable(node_softwaretrigger_cmd))):
                print('Unable to execute trigger. Aborting...')
                return False
            node_softwaretrigger_cmd.Execute()
        elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
            print('Use the hardware to trigger image acquisition.')
    except PySpin.SpinnakerException as ex:
        print(('Error: %s' % ex))
        return False
    return result