setOuputBit
Top  Previous  Next

setOutputBit ( integer Bit, integer Value )

Use this function to
set the state of the specified general purpose output bit (GPOUT) on the currently selected framegrabber.

Parameters

Timeout  
Integer specifying the zero-based index of the output bit.  
 
Value  
Boolean specifying the logical value of the output bit.  
 
 
Error flags
 
ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
 
Example
 
This set of statements performs the continuous measurement of the average gray level of a live image, compares it to the value of 183 and sets output bit #1 to a certain logical state depending on the result:  
 
do  
grabim(1)  
threshold(1,100,M_PRESET,0.,255.,TRUE,FALSE)  
selectParam("grayAvrg")  
measObjects(100,1,"")  
x=Grid.GetParamValue(0, "GrayAvrg")  
if x>183 then   
setOutputBit(0,TRUE)  
else  
setOuptupBit(0,FALSE)  
endif  
loop  

Remark
 
If you use BitFlow framegrabbers, the valid values of the input bit index are 0-2 for RoadRunner and R3 Diff boards, 0-4 for R3 CL, 0-5 for Raven and 0-6 for R64.