I am programming a vision application using 1409 board and a Jai camera in external trigger, pulse width mode. This enables setting the camera exposure time by programming the trigger pulse width. Based on one of the examples I found in the knowledge base I came to the following code:
mImaq.Images.RemoveAll
mImaq.Images.Add NUM_BUFFER
mImaq.Signals.Add.Name = "TRIG_IN"
mImaq.Signals.Add.Name = "TRIG_OUT"
mImaq.Pulses.Add.Name = "CamTrig"
ExposeTime = txtExpTimeMs.Text / 1000#
delay = 1# / txtFPS.Text - ExposeTime
''Debug.Print delay, ExposeTime
mImaq.Pulses("CamTrig").Initialize delay, ExposeTime, cwimaqTrain, cwimaqActiveLow, cwimaqImmediate
mImaq.Signals("TRIG_OUT").I
nitialize cwimaqExternal, cwimaqGeneratePulse, cwimaqActiveLow, 3
Set mImaq.Signals("TRIG_OUT").Pulse = mImaq.Pulses("CamTrig")
mImaq.Signals("TRIG_IN").Initialize cwimaqExternal, cwimaqCaptureEveryImage, cwimaqActiveLow, 1
mImaq.AcquisitionType = cwimaqAcquisitionContinuous
mImaq.Start
This code works fine. I know would like to change the exposure time (i.e. reprogram the pulsewidth) without interrupting the acquisition, so I tried the following:
ExposeTime = txtExpTimeMs.Text / 1000#
delay = 1# / txtFPS.Text - ExposeTime
mImaq.Pulses("CamTrig").delay = delay
mImaq.Pulses("CamTrig").width = ExposeTime
mImaq.Start
Now why does this not work? I do not get any errors, yet the pulsewidth does not change.