Main Menu

All times are in GMT -8 (DST) :: The time is now 8:30 pm.

Login or Register
Create an account and register your LMI products to gain access to useful resources.

Register Account

Login

Sub Menu

Knowledge Base
Article Data
Article Ref
9830-ETUP-7901
Date Created
Fri, 9th Aug 2019
Date Modified
Fri, 9th Aug 2019

   GenTL XmlSetting and XmlCommand operations

Question 

 What are the current GenTL commands that can be sent to the Gocator?

Answer 

 We have a few commands/functions that can be used, with the XmlSetting and XmlCommand. We can change or trigger these operations:

 
Commands
  Command
  GenTL/FlushGocatorBuffers  
  GenTL/StartGocator  
  GenTL/StopGocator  
  GenTL/ClearData  
  GenTL/SoftwareTrigger  

 
Settings
  Setting   Type   Range
  GenTL/Buffers     Integer     0 - 20  
  GenTL/FlushOldBuffers     Integer     0, 1  
  GenTL/StartStopControl     Integer     0, 1  
  GenTL/ScheduledStart     Integer     64 bit  
  GenTL/SystemScheduledStart     Integer     64 bit  
  GenTL/SensorScheduledStart     Integer     64 bit  
 
 
 
To use these commands, in Halcon, set the XmlCommand frame grabber parameter repeatedly with the corresponding string:
set_framegrabber_param(AcqHandle,'XmlCommand','GenTL/SoftwareTrigger\n')
 
Note that you can issue the string commands for up to 16 characters at a time. If you need more characters, do multiple sets. You can either end the string with '\n' (carriage return character), or with an empty string. The following commands are the equivalent of the previous one:
set_framegrabber_param(AcqHandle,'XmlCommand','GenTL/')
set_framegrabber_param(AcqHandle,'XmlCommand','SoftwareTrigger')
set_framegrabber_param(AcqHandle,'XmlCommand','')
 
To assign values to settings, append =<value> to the string:
set_framegrabber_param(AcqHandle,'XmlSetting','GenTL/Buffers=10\n')

To get the current values of the settings, issue a get immediately after doing the set:
set_framegrabber_param(AcqHandle,'XmlSetting','GenTL/Buffers\n')
get_framegrabber_param(AcqHandle,'XmlSetting',var)
 
 
Additionally, there is a more advanced feature, to modify the current job's xml from the GenTL driver, using the XmlSetting again. This is how to use it:
 
Setting:
Repeated sets for setting a value in the format of "Setup/Filters/XSmoothing/Window=5", ended with a single empty string.
set_framegrabber_param(AcqHandle,'Setup/Filters/XSmooth')
set_framegrabber_param(AcqHandle,'ing/Window=5')
set_framegrabber_param(AcqHandle,'')
 
For setting an attribute, use the same format, but use the space for delimiting the attribute ('Setup/Filters/XSmoothing/Window min="0.044"')
 
Getting:
For getting a value, repeat setting the path ('Setup/Filters/XSmoothing/Window'), and end with a get.
set_framegrabber_param(AcqHandle,'XmlSetting','Setup/Filters/XSmooth')
set_framegrabber_param(AcqHandle,'XmlSetting','ing/Window')
get_framegrabber_param(AcqHandle,'XmlSetting',var)

Similar usage for an attribute ('Setup/Filters/XSmoothing/Window min').