From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 1742 pulse output occurs when it's not supposed to

Please see attached screenshots. The last step in my program is the pulse generator, where my intent is to generate a 10 second pulse ONLY if any test above fails. These attachments show how I've implemented this. What's happening is when the program executes by clicking the run button at the top of the window and there are no failures, an abbreviated pulse occurs, about 1/2 second long, not the programmed pulse of 10 seconds. If I run the program from the run button on the State diagram, it pulses for the complete 10 seconds. I don't understand why it is pulsing under these conditions.  Since none of the tests are failing, it shouldn't pulse at all. Also, when I'm in the pulse setting configuration window and click OK or Cancel after making no changes, it activates the 10 second pulse. What am I doing wrong?
Download All
0 Kudos
Message 1 of 3
(2,768 Views)
I have an additional observation. Whenever I open up the Setup Overlay window, every time I click any box in the grid it activates the pulse.
0 Kudos
Message 2 of 3
(2,762 Views)

It turns out there is an issue with initialization of pulses for Smart Camera/NI-IMAQ devices. The lines are initlailly marked as "Not Used". The first time the inspection is run, the pulse is configured and the line is marked as a pulse line (this is to disguish it from when the line is used with a Read/Write I/O line to drive the line high/low or it hasn't been configured yet).  So this only affects Generating Single Pulses based on a condition that is not true the first time. To work around this until we address this, you can put a Generate Pulse step in the Setup State configured for Single Pulse using encoder counts or a really long delay (~4,300 seconds) so no pulse will happen and then the first time the pulse step is called in the main inspection, it won't have to configure the line for pulse mode, so it will just look at the boolean condition to determine if it should pulse.

 

The reason the pulse was happening when you clicked on the overlay step was that this step was after the pulse step and clicking on the overlay step caused the pulse step to run for the first time. I mentioned that this only happens the first time, even though you were reporting that it was happening all the time. The reason for this discrepancy is that you would run once using the top button, which runs the inspection on the smart camera, and then you would run once using the bottom button and this actually runs the inspection on Windows. When you were switching back and forth between running on windows/smart camera, the line kept getting reinitialized back to Not Used and this was why the pulse kept happening. If you had run in a loop, you'd only see the pulse happen the first iteration of the loop. 

 

Hope this helps,

Brad 

Message 3 of 3
(2,729 Views)