How do i keep camera going without stopping every time in JAVA?

public void Camera() {

	NIVision.IMAQdxStartAcquisition(session);
    NIVision.IMAQdxGrab(session, frame, 1);
    CameraServer.getInstance().setImage(frame);
	NIVision.IMAQdxStopAcquisition(session);
	
	}

This is our code, I have tried many things to try and fix it, but all i got is errors. I’ve tried while loops and ifs nothing worked.

Thanks

You need to open your camera and start capture before you try to grab an image.

The StartAcquisition is Starting the camera before it starts the capture. I just don’t want the StopAcquisition in there. It loops through so the Camera is constantly turning on and off. So it makes our programs pretty laggy and delayed.

Put the stop acquisition outside the loop then?

I’ve done that, nothing but errors.

What is the error? Without the stacktrace, it is hard to debug.