Main Menu

All times are in GMT -8 (DST) :: The time is now 1:45 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
Category Details
Category Name
HexSight
Category Created
Fri, 15th Jul 2011
Last Article Update
Mon, 11th Mar 2019
Category Actions

   HexSight

Categories 

HexSight 4.x for Windows 10 

 Yes, HexSight works on Windows 10 starting at version 4.0. The same dongle can be used for all version 4.x.

On Windows 10, however, it is recommended to update the Superpro dongle driver to the newest version, after the installation of HexSight. At the moment, the driver version is 7.6.9, and can be found here:

    https://supportportal.gemalto.com/csm/?id=kb_article&sys_id=f4f769ae37950f44cc47261953990e44

 

View Full Article

HexSight License Dongle ROHS Compliance 

The USB dongle that is used to activate the HexSight software package is the Sentinel HL Pro from Gemalto. As seen in the product datasheet, the Pro is ROHS compliant as of May 11, 2016. It does not have ROHS 2 compliance.

 

View Full Article

How to create images in a HSDatabase without using the AcquisitionDevice in VB.NET, Part 3 

 This method is using the AttachImagePointer() function to set the HSImage pixels from a pre-filled buffer.

 


Dim lBytePointer As IntPtr

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim lBitmap As New System.Drawing.Bitmap("C:/image.jpg")
    FillBuffer(lBitmap, lBytePointer)

    AttachImageBuffer(lBytePointer, lBitmap.Width, lBitmap.Height)

End Sub

Public Function FillBuffer(ByRef bmpImage As Bitmap, ByRef bytePointer As IntPtr) As Boolean

    ' Copy image data from an in memory Bitmap into a byte pointer array.
    ' This buffer can be filled from another process.

    Dim Results As Boolean
    Dim rect As Rectangle
    Dim BMPdata As Imaging.BitmapData
    Dim bytecount As Integer

    rect = New Rectangle(0, 0, bmpImage.Width, bmpImage.Height)
    BMPdata = bmpImage.LockBits(rect, Imaging.ImageLockMode.ReadOnly, Imaging.PixelFormat.Format32bppRgb)

    bytecount = bmpImage.Width * bmpImage.Height * 4
    Results = True

    Try

        Dim i As Integer
        Dim bytes(bytecount) As Byte

        Marshal.FreeHGlobal(bytePointer)
        bytePointer = Marshal.AllocHGlobal(bytecount)

        For i = 0 To BMPdata.Height - 1

            Marshal.Copy(BMPdata.Scan0.ToInt64() + BMPdata.Width * i * 4, bytes, BMPdata.Width * i * 4, BMPdata.Width * 4)
            Marshal.Copy(bytes, BMPdata.Width * i * 4, bytePointer.ToInt64() + bytecount - BMPdata.Width * (i + 1) * 4, BMPdata.Width * 4)

        Next

    Catch ex As Exception

        Results = False

    End Try

    bmpImage.UnlockBits(BMPdata)

    Return Results

End Function

Public Function AttachImageBuffer(ByVal bytePointer As IntPtr, ByVal width As Integer, ByVal height As Integer) As Boolean

    ' Attach a byte pointer array to a hexsight Color image

    Dim Results As Boolean
    Dim Himg As HSCLASSLIBRARYLib.HSImage

    Himg = Me.mApplicationControl.Database.Image("Acquire", "Image")

    If (Himg Is Nothing) Then

        Me.mApplicationControl.Database.AddView("Acquire")
        Himg = Me.mApplicationControl.Database.AddImage("Acquire", "Image", HSCLASSLIBRARYLib.hsImageType.hsImage32bppRgb)

    End If

    Himg.Width = width
    Himg.Height = height
    Results = True

    Try

        Himg.AttachImagePointer(bytePointer, width, height)

    Catch ex As Exception

        Results = False

    End Try

    Return Results

End Function 
View Full Article

Logging in HexSight 

There is a way to generate a log file in HexSight, reporting all the events that occur in all the HexSight controls.

 

To generate a log file, two environment variables are necessary. Environment variables can be added in the Control Panel > System and Security > System > Advanced system settings > Environment Variables > System variables. These variables are the following:

  • HEXSIGHT_LOG_LEVEL = TRACE
  • HEXSIGHT_LOG_FILE = C:\HexSightLogs\hs.log

Note that the folder C:\HexSightLogs must already exists, or any folder that is specified by the HEXSIGHT_LOG_FILE variable.

 

The log file generated will look like this:

2017/03/06 12:16:58.785 02080	Event	HexSight: Version:	5,0,1,16 (debug)
2017/03/06 12:16:58.785 02080	Event	HexSight: FileName:	c:\HS.log
2017/03/06 12:16:58.786 02080	Event	HexSight: Level:	1
2017/03/06 12:16:58.786 02080	Event	HexSight: MaxSize:	209715200
2017/03/06 12:16:58.786 02080	Event	HexSight: Module:	
2017/03/06 12:16:58.786 02080	Event	HexSight: Console:	0
2017/03/06 12:16:58.787 02080	Debug	(HSAdFsiGocatorFunctions.cpp, 201)	HSAcquisitionDevice: Looking for P:\Gocator\4.5.4.120\GO_SDK\bin\win64\kApi.dll
2017/03/06 12:16:58.815 02080	Debug	(HSAdFsiGocatorFunctions.cpp, 206)	HSAcquisitionDevice: Module loaded
2017/03/06 12:16:58.815 02080	Debug	(HSAdFsiGocatorFunctions.cpp, 201)	HSAcquisitionDevice: Looking for P:\Gocator\4.5.4.120\GO_SDK\bin\win64\GoSdk.dll
2017/03/06 12:16:58.836 02080	Debug	(HSAdFsiGocatorFunctions.cpp, 206)	HSAcquisitionDevice: Module loaded
2017/03/06 12:16:58.927 02080	Debug	(HSAdFsiGocatorFunctions.cpp, 149)	HSAcquisitionDevice: GoSystem Initialized
2017/03/06 12:17:00.303 02080	Warn	(HSAdImniProcess.cpp        , 140)	HSClassLibrary: HSException
2017/03/06 12:17:00.641 02080	Info	(hsdpycontrol.cpp           , 9860)	HSDisplay: DirectX Enabled
2017/03/06 12:17:00.641 02080	Trace	(hsdpycontrol.cpp           , 9872)	HSDisplay: DirectX Surface creation
2017/03/06 12:17:00.666 02080	Trace	(hsdpycontrol.cpp           , 9888)	HSDisplay: Surface created
2017/03/06 12:17:00.668 02080	Info	(hsdpycontrol.cpp           , 9860)	HSDisplay: DirectX Enabled
2017/03/06 12:17:00.668 02080	Trace	(hsdpycontrol.cpp           , 9872)	HSDisplay: DirectX Surface creation
2017/03/06 12:17:00.668 02080	Trace	(hsdpycontrol.cpp           , 9888)	HSDisplay: Surface created
2017/03/06 12:17:00.758 02080	Debug	(HSAdGiProcess.cpp          , 171)	HSAcquisitionDevice: GigE: Finding PvSystem.
2017/03/06 12:17:02.807 02080	Debug	(HSAdGiProcess.cpp          , 192)	HSAcquisitionDevice: GigE: Interface: 0.
2017/03/06 12:17:02.807 02080	Debug	(HSAdGiProcess.cpp          , 201)	HSAcquisitionDevice: GigE: 0 Devices on Interface: 0.
...

The HEXSIGHT_LOG_LEVEL can be set to any of the following settings, depending on the level required. For example, during runtime execution, it is recommended to use the level Warn or higher, to limit the log file accesses. The higher the level, the smaller the log file, but also  less information 
 
  • 1. Event
  • 2. Trace
  • 3. Debug
  • 4. Info
  • 5. Warn
  • 6. Error
  • 7. Fatal

 

Other variables can be set to control the output of the logs.
 
 
HEXSIGHT_LOG_SIZE

HEXSIGHT_LOG_SIZE is the maximum number of bytes written in the logs. When the initial log file reaches half of this number, the log file is rolled and renamed (name + "_rolled"), and a second file is created. Once the new file also reaches half of this number, the old _rolled file is removed and replaced with the new file, and the cycle restarts. With this method, the logs can never exceed the HEXSIGHT_LOG_SIZE, and it guarantees that at least half of the amount specified is kept in the logs.

The default value for this variable is 200MB, meaning it will create a maximum of 2 files of 100MB each.

  • Ex: HEXSIGHT_LOG_SIZE = 200000000

 

HEXSIGHT_LOG_MODULE

HEXSIGHT_LOG_MODULE allows the user to specify a single module to report. Setting this variable will block any other control to stop reporting. This is useful to keep the log files scoped to a single module, in case of an issue specific to this module. This is the prefix of the description in the log file. The default is set to no module, in order to log information for all modules.

  • Ex: To see only reports of events such as HSClassLibrary: HSException, use HEXSIGHT_LOG_MODULE = HSClassLibrary

 

HEXSIGHT_LOG_CONSOLE

The HEXSIGHT_LOG_CONSOLE allows the user to see the events in an additional console, for quick investigation. The log file is still generated, but the console can show the events at runtime.

  • Ex: HEXSIGHT_LOG_CONSOLE = TRUE

 

View Full Article

No image in the Display 

This is most likely due to the DirectX integration.

You need to add this registry key on the computer, using regedt32.exe:
 
[HKEY_CURRENT_USER\Software\LMI Technologies\HSDisplay]
"DirectX Enabled"=dword:00000000
 
Then, to be on the safe side, reboot the PC, and try again.
 
View Full Article

Visual Studio 2013 AnyCPU application running as 32-bit, even on a 64-bit OS 

By default, Visual Studio 2013 configures a setting in an AnyCPU project to "Prefer 32-bit". If you unselect the check box, it should run as a 64-bit application on a 64-bit operating system. However, HexSight 64-bit must be installed to be used in 64-bit processes.

View Full Article

Installing only the 32-bit version on a 64-bit platform 

In some cases the final system can be known beforehand. If the target OS is 32-bit, it is recommended to install the 32-bit version to avoid any problem, even though the 64-bit version can create a 32-bit application as well.

View Full Article

Advantages of installing the 64-bit version instead of the 32-bit version 

The 64-bit version of HexSight supports both types of applications, if the OS is indeed a 64-bit platform. This allows you to create applications for both platforms (AnyCPU, x86, or x64). This is useful when linking the application with other third-party libraries. As a practical advantage, HexSight can use much more memory when running natively in a x64 environment.

View Full Article

Application crashing, samples running 

The application is probably set to compile on a 64-bit system, while the installed version is the 32-bit version. As a test, validate that the project of the application is set for x86 platform. If this solves the issue, either leave it as is, or install the 64-bit version.

View Full Article

Using three USB cameras with HexSight 

The HSAcquisitionDevice is a special process. Instead of having one per camera, you only need one to manage all three cameras. The reason why it has been designed this way is to have better control over the acquisition process; for example, it allows the asynchronous triggering of different cameras while not being dependant on the others, and it simplifies the capture waiting process.

However, to make this work, the HSAcquisitionDevice needs a lock on all devices, rendering any other instance of HSAcquisitionDevice useless (emulation only).

For more information see Using Multiple Configurations, in the HSAcquisitionDevice section in the user guide.

View Full Article

Adding and removing processes from the Process Manager 

Adding and removing the processes should not be leaking memory. However, when seeing an increase of memory usage, it is recommended to verify that the handles to the HexSight processes are all released properly.

When getting a reference to a COM object (HexSight tool), it is important to use the ReleaseComObject() function on it, or to make sure it is properly deleted (C++) or reassigned to NULL or Nothing (.NET). Otherwise, a handle is maintained for the object, and it will remain alive, even if deleted using the RemoveProcess(). This is usually where the leaking symptoms happen.

In the VBNET version of the LocatorDemo, you can see that the references to the tools are always set to Nothing before the end of the scope, and that the GC (GarbageCollector) is ordered to completely remove any copy from memory. This is another way to do the ReleaseComObject().

        Dim lAcquisition As HSACQUISITIONDEVICELib.HSAcquisitionDevice
        lAcquisition = applicationControl.ProcessManager.Process("Acquisition")         applicationControl.ProcessManager.Execute("Acquisition")         System.Runtime.InteropServices.Marshal.ReleaseComObject(lAcquisition)         lAcquisition = Nothing
View Full Article

Device not present in the HSAcquisitionDevice 

There are different reasons why the device is reported as not available. The main reason is because it is disconnected, or no similar device could be matched to the device in the loaded configuration. Verify that the device is present and visible in HexSight. The best way to verify its visibility in HexSight is to boot up the system and only run the LocatorDemo. In the AcquisitionDevice Properties, try to add the device.

If the device is still not present, check these settings:

  • Is the IP address on a reachable subnet?
  • Is the power plugged in?
  • Can you see it with the proprietary software?
  • Is the HexSight dongle plugged in the system?

If the device is present at bootup in HexSight, but at some point it gets reported as not available, check out this link.
 

View Full Article

Device not available in HSAcquisitionDevice 

If you don't see the nag screen when starting the application, it's possible that you have a second instance of the HSAcquisitionDevice in the system. There must be only one HSAcquisitionDevice throughout the system, to interact with the devices. Any additional HSAcquisitionDevice will not be able to use any device. These additional HSAcquisitionDevice can only do emulation, image copy, or calibration assignment.

That being said, to avoid having more than one HSAcquisitionDevice in the system, you have to follow these precautions:

  1. Don't add more than one HSAcquisitionDevice in the process manager. If you do, it should be done intentionally, only for purposes explained above.
  2. If you have more than one HSApplication, there can also be only one HSAcquisitionDevice for all of them. Only one can communicate with the devices, and it will be the first one instantiated.
  3. If you are using Visual Studio, make sure the Designer (UI editor) is not open in Visual Studio. For editing purposes, the HSApplication control in the form will capture the devices and prevent any other instance from seeing them. This is particularly true when debugging.
  4. Make sure you have one and only one instance of application running at a time. Open the TaskManager to see if you do not have a hidden and unterminated instance of your application running in the background.
  5. Finally, when programming, if you use the GetProcess() or the Process() accessors to get the HSAcquisitionDevice, you must call the ReleaseComObject() or FinalReleaseComObject() fucntions after. If these functions are not called, a handle is maintained to the object, and it will keep the HSAcquisitionDevice alive. Trying to delete it will fail and any subsequent instantiation of a HSAcquisitionDevice will report the devices as not available.
        Dim lAcquisition As HSACQUISITIONDEVICELib.HSAcquisitionDevice
        lAcquisition = applicationControl.ProcessManager.Process("Acquisition")         applicationControl.ProcessManager.Execute("Acquisition")         System.Runtime.InteropServices.Marshal.FinalReleaseComObject(lAcquisition)         lAcquisition = Nothing  
View Full Article

How to create images in a HSDatabase without using the AcquisitionDevice in VB.NET, Part 2 

This method is copying the pixels of a Bitmap, line by line, to set the HSImage pixels.

 


Public Function ImportImage(ByRef bmpImage As Bitmap) As Boolean
    ' copy image data from an in-memory Bitmap into a hexsight Color image


    Dim Results As Boolean

    Dim Himg As HSCLASSLIBRARYLib.HSImage

    Dim rect As Rectangle

    Dim BMPdata As Imaging.BitmapData

    Dim bytecount As Integer

    Himg = Me.mApplicationControl.Database.Image("Acquire", "Image")


    If (Himg Is Nothing) Then

        Me.mApplicationControl.Database.AddView("Acquire")
        Himg = Me.mApplicationControl.Database.AddImage("Acquire", "Image", HSCLASSLIBRARYLib.hsImageType.hsImage32bppRgb)

    End If

    Himg.Width = bmpImage.Width

    Himg.Height = bmpImage.Height

    bytecount = Himg.Width * Himg.Height * 4

    rect = New Rectangle(0, 0, bmpImage.Width, bmpImage.Height)

    BMPdata = bmpImage.LockBits(rect, Imaging.ImageLockMode.ReadOnly, Imaging.PixelFormat.Format32bppRgb)


    Try

        Dim i As Integer
        Dim bytes(bytecount) As Byte

        For i = 0 To BMPdata.Height - 1

            Marshal.Copy(BMPdata.Scan0.ToInt64() + BMPdata.Width * i * 4, bytes, BMPdata.Width * i * 4, BMPdata.Width * 4)
            Marshal.Copy(bytes, BMPdata.Width * i * 4, Himg.RawImagePointer + bytecount - BMPdata.Width * (i + 1) * 4, BMPdata.Width * 4)

        Next

        Results = True

    Catch ex As Exception

        Results = False

    End Try

    bmpImage.UnlockBits(BMPdata)

    Return Results

End Function 

 

View Full Article

Command line options for installers 

Both the Runtime and Development installers have been updated to allow for more control via the following command line options:

/GIGE_DRIVER=OPTION, where OPTION can be TRUE or FALSE. When TRUE, the GigE driver will be forced to install, even on unsupported operating systems (such as Windows XP without SP3, 64-bit Windows, and Windows 2000). When FALSE, the driver will not install. If the option is not used, the GigE driver will only install on Windows XP SP3 or Windows Vista.

/DONGLE_DRIVER=OPTION, where OPTION can be USB, PARALLEL, XPE, or NONE. When USB, the USB-based dongle driver will be installed. When PARALLEL, the parallel-based dongle driver will be installed. When XPE, the USB-based dongle driver suitable for Windows Embedded will be installed. When NONE, the dongle driver will not be installed. If any of these options are used, the driver component configuration will be disabled within the installer. If the option is not used, the installer defaults to using the USB-based driver, which is then configurable within the installer.

View Full Article

How to create images in a HSDataBase without using the AcquisitionDevice in VB.NET 

Dim lDB As HSCLASSLIBRARYLib.HSDatabase

lDB = mApplicationControl.Database

 

Dim i As Integer

Dim j As Integer

 

Dim lImage1 As HSCLASSLIBRARYLib.HSImage

lDB.AddView("Import View")

lImage1 = lDB.AddImage("Import View", "Import", HSCLASSLIBRARYLib.hsImageType.hsImage32bppRgb)

lImage1.Width = 10

lImage1.Height = 10

 

For i = 0 To 9

     For j = 0 To 9

           lImage1.Pixel(i, j) = 8421504

           If i = j Then lImage1.Pixel(i, j) = 16711680

     Next

Next

View Full Article

How to create images in a HSDataBase without using the AcquisitionDevice in C++ 

HSDatabase lDB = mApplicationControl.GetDatabase();

 

HSView lView = lDB.AddView ("New View");

const long ltype = HSImage::hsImageType::hsImage32bppRgb;

HSImage lImage = lView.AddImage("New Image",COleVariant(ltype));

 

lImage.SetWidth( 10 );

lImage.SetHeight( 10 );

 

// RawImagePointer may be changed after the allocation from SetWidth/SetHeight

// (hsImage32bppRgb represent a DWORD, hsImage8bppGreyScale is a BYTE)

DWORD* lPtr = (DWORD*)lImage.GetRawImagePointer();

 

for( int i=0; i<10; i++ )

{

    for( int j=0; j<10; j++ )

    {

        // The two lines in here are both valid, the raw pointer, however, is faster

 

        //lImage.SetPixel(i,j,0xffffff);

        lPtr[j+i*(int)lImage.GetWidth()] = 0xffffff;

    }

}

View Full Article

Error messages regarding "MIL DLL", or "MappHookFunction()", or "MappInquire()" 

The errors are actually caused by the MIL library from Matrox. MappInquire and MappHookFunction are two functions from that library. Please refer to Matrox regarding those errors. As a test we suggest disabling the MIL (or uninstalling it) and trying again. It is likely that the MIL has the camera locked before the Acquisition Device can get a hold of it.

View Full Article

Import vector file for synthetic model? 

You can import a DXF, but only closed shapes are imported. The biggest shape will be imported as the main part and all other (smaller) shapes will be defined as holes.

View Full Article

Camera resolution limit 

There is no defined limit, but it depends heavily on the available memory.

View Full Article

Running applications built with HexSight 3.2/3.3 on newer HexSight 

Projects created with HexSight versions 3.3, 3.2, 3.1, and 3.0 will load on systems where HexSight 4 or 5 is installed and should work without modifications (except for the enums of the Display control’s PenWidth property).

Although an application built with HexSight 3.2/3.3 will run on newer HexSight, we recommend recompiling it for the proper version.

View Full Article

Limitations when running HexSight in demo mode (without a dongle) 

When in demo mode, a ten-second nag window is displayed at random intervals and you can't save configurations. Also, the AcquisitionDevice is limited to file emulation (no cameras or frame grabbers) during demo mode.

View Full Article

Failed to import ActiveX Control 

There is a problem with VS2010 and ActiveX controls. Details can be found at http://support.microsoft.com/kb/2066987 (basically, the issue is that the information fails to load in the proper place). To fix this, install the proposed HotFix.

Once installed, make sure you reboot the PC. You will also need to reinstall HexSight for the registration process to be completed.

View Full Article