Main Menu

All times are in GMT -8 (DST) :: The time is now 1:43 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
Integration (SDK and Drivers)
Category Created
Thu, 27th Feb 2014
Last Article Update
Wed, 17th Dec 2014
Category Actions

   Integration (SDK and Drivers)

Categories 

LabVIEW™ throwing errors 

LabVIEW™ is likely throwing the error due to its default security configuration for .NET assemblies.

 

In order to get around this, create a file in the folder containing the LabVIEW™ executable, name it “LabVIEW.exe.config” and add the following to the file:

 

<?xml version ="1.0"?>
<configuration>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
</configuration>

 

Restart LabVIEW™, compile the entire project, and run the program.

 

If the issue persists, submit a support ticket.

 

Source: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8XnSAK

View Full Article

GenTL driver configuration file name limitation 

To load a configuration file from the GenTL driver (using Halcon or CVB, for example), you need to append the "job" extension to the file name. For a job named "Object1" in the UI, the file to load in GenTL should be "Object1.job".

Also note that the name must be limited to 16 characters, including the extension. Otherwise, the configuration file will not be loaded in the Gocator.

View Full Article

Checking if Buddy is assigned through SDK (Gocator firmware 3.x) 

The correct way to check if a Buddy sensor is currently assigned is to get the sensor handle of the Buddy and then get the serial number of the handle. The Buddy is NOT assigned if the serial number is 0. If the Buddy is assigned the serial number is the serial number of the physical sensor.

//retrive buddy sensor handle
buddySensor = Go2System_BuddySensor(system);
//obtain buddy sensor serial number
sensorID = Go2Sensor_Id(buddySensor);
if (sensorID > 0)
{
    //buddy is assigned!
}
View Full Article

Return value of Go2System_SensorCount 

Sensor Model G1xxx, G2xxx
Firmware Version 3.x
SDK Version 3.x

The Gocator SDK uses an internal virtual sensor that represents the Buddy state.

When NO Buddy is assigned, the virtual sensor is included in the sensor count. See the following table for examples:

Number of Connected Sensors Buddy Assigned? Sensor Count Buddy Sensor ID
1 n/a 2 0
2 N 3 0
2 Y 2 Buddy's serial number
View Full Article

Multiple sensors (Gocator firmware 3.x) 

Sensor Model G1xxx, G2xxx
Firmware Version 3.x
SDK Version 3.x

Gocator has built-in support for extending a scanning system with one additional sensor. Extending a system is done by assigning a Buddy (second) sensor to a Main sensor. Several configurations are supported in these dual-sensor systems. However, in order to work with a larger system, with 3 or more sensors, you must instead create custom code with the help of the Gocator SDK.

The Go2 API offers programmatic access to all functions exposed in the GUI (except recording). This allows programmers to design software for any system configuration and to process the data with proprietary or third-party algorithms. 

A requirement for working with synchronized multiple sensors is to connect them all through a Master 400 (or higher). These masters distribute synchronization, encoder, and I/O to all sensors on the network. In terms of the software, there are some peculiarities when working with multiple sensors that are highlighted below.

First of all, a System object has to be created for each sensor in the system, and connections have to be established individually. The code should look something like this:

// When working with multiple sensors, a Go2System has to be created for each individual sensor.
for (i = 0; i < APP_SENSOR_COUNT; i++)
{
    GO2_CHECK(Go2System_Construct(&obj->systemSensor[i]));
    GO2_CHECK(Go2System_Connect(obj->systemSensor[i], addresses[i].address, GO2_USER_ADMIN, ""));
}

In order to ensure that all sensors start at the exact same time, use the Go2System_ScheduledStart() call. This function takes an argument that is a future time at which to start all sensors. One way to determine this future time is to first get the current time from one of the sensors and then add a delay. This delay is there to deal with the overhead for internal sensor initialization. The code should look something like this:  

// When starting a multi-sensor system, it's a required step to get the current system time from one sensor and then
// schedule a synchronized future start for all sensors
GO2_CHECK(Go2System_GetTime(obj->systemSensor[0], &currentTime));
startTime = currentTime + APP_START_DELAY;
for (i = 0; i < APP_SENSOR_COUNT; i++)
{
    GO2_CHECK(Go2System_ScheduledStart(obj->systemSensor[i], startTime, GO2_NULL));
}

Finally, to configure the exact timing and multiplexing between all sensors, use Go2System_SetFrameRate(), Go2Sensor_SetExposure(), and Go2Sensor_SetExposureDelay(). Typically, the frame rate is set to the same value across all sensors in the system. If the exposure time is shorter than the frame period, it is then possible to split the frame period up in several time slots and expose the different sensors at a different time. For example, if the frame rate is set to be 2 ms for all sensors, but the exposure is set to 1 ms for all sensor, then the exposure delay can be set to 1 ms for only some of the sensors. This is how to avoid cross-talk between sensors which physically overlap their respective field of view.  

In terms of system calibration, i.e., bringing all sensors' data into a common coordinate system, the Go2 API does not provide this type of support (beyond the Buddy concept). System calibration typically involves placing a calibration target with predefined dimensions in front of the sensors. The sensors then locate specific features on the target, making it possible to calculate the values of transformation parameters (often involving a rotation angle and a 2D translation). These parameters are then applied to every data point in real time to create a scan of a complete 3D object in "world coordinates." Although this type of software is not included in the Go2 API, LMI has extensive experience in this area and can provide support for Gocator users who need to implement this.

Refer to the application guides How To Use The Open Source SDK To Fully Control A Gocator Multi-sensor System and How To Perform Alignment Calibration On A Synchronized Network Of Three Or More Gocator Sensors Mounted Side By Side at http://lmi3d.com/resources/gocator/ for more details.

View Full Article

Part count on EtherNet/IP 

Sensor Model G2xxx, G3xxx
Firmware Version All
SDK Version All

When Surface measurements (firmware 4.x) or Whole Part measurements (firmware 3.x) are used, each available measurement indicates that a part was scanned, and the total number of measurements available equals the number of parts scanned.

If a counter to indicate the number of parts scanned in profile measurements is needed, measurements have to be set up so that the output value of the measurements are "invalid" when there isn't anything being scanned but "valid" when a part is present. A simple logic in the Script tool or in the PLC can then be implemented to count the number of parts that have been scanned. (That is, the measurement output transitioning from "invalid" to a valid value and back to "invalid" again means that one part has been scanned by the Gocator.)

View Full Article

HALCON crashes when using Gocator for image acquisition 

Sensor Model All
Firmware Version All
SDK Version All

The Gocator firmware version must match the GenTL driver version for HALCON to properly work with Gocator.

Starting with HALCON 11, the device name should only contain the IP address. Refer to the HALCON integration application guide included in the Integration Tools package.

View Full Article

Knowing number of data points before receiving first profile data 

Sensor Model G2xxx
Firmware Version 3.x
SDK Version 3.x

When using Raw mode with no resampling, the number of data values will always be the resolution of the imager: 1280 data points for the Gocator 2300 series and 640 data points for the Gocator 2000 series.

When using Profile or Whole Part mode, the number of data points depends on the resampled data. The number of data points in the resampled data in turn depends on settings such as Transformation Angle and X Resampling Resolution: the resulting data contains processed data points, which means that the final number of data points could be higher than the raw imager resolution. Because of this, when using Profile or Whole Part mode, the length of the profile data can be known only after the first profile data is received. After the first profile is received and the length is known, the number of data points will not change as long as all the parameters that could affect the numer of data points remain unchanged. This value could therefore be used for memory allocation, as long as the settings remain unchanged.

View Full Article

Reading profiles in C (Gocator firmware 3.x) 

Sensor Model All
Firmware Version 3.x
SDK Version All

This example demonstrates the use of the Go2 API to connect to a single Gocator at address 192.168.1.10 to read a number of profiles. The profiles are being copied to a memory array for further processing.

Each received data message contains a header with information about the current timestamp, encoder position, and frame index. Each message can contain several data items which are identified by their type. Profiles are identified by the type GO2_TYPE_PROFILE_DATA.

 

Note: When used in a production environment, error handling functionality should be added to the code.

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <Go2.h>

#define NUMPROFILES 10

void main(int argc, char **argv)
{
    Go2UInt32 i;
    Go2UInt32 j;
    Go2System system = GO2_NULL;
    Go2Data data = GO2_NULL;
    Go2Int16* memory = GO2_NULL;

    //Initialize the Go2 API.
    Go2Api_Initialize();

    //Construct a Gocator system object.
    Go2System_Construct(&system);

    //Connect to default sensor IP address (192.168.1.10) as user Admin with default password (blank).
    Go2System_Connect(system, GO2_DEFAULT_IP_ADDRESS);

    //Connect to the sensor data channel.
    Go2System_ConnectData(system, GO2_NULL, GO2_NULL);

    //Start the system.
    Go2System_Start(system);

    //loop forever until 10 results are received
    i = 0;
    while (i<NUMPROFILES)
    {
        if (Go2System_ReceiveData(system, 20000, &data) > 0)
        {
            printf("Data message received:\n");
            printf("  Timestamp: %llu\n", Go2Data_Timestamp(data));
            printf("  Encoder: %lld\n", Go2Data_Encoder(data));
            printf("  Frame index: %llu\n", Go2Data_FrameIndex(data));
            printf("  Item count: %u\n", Go2Data_ItemCount(data));

            //each result can have multiple data items
            for (j = 0; j<Go2Data_ItemCount(data); ++j)
            {
                Go2Object dataItem = Go2Data_ItemAt(data, j);
                if (Go2Object_Type(dataItem) == GO2_TYPE_PROFILE_DATA)
                {
                    Go2UInt32 profilePointCount = Go2ProfileData_Width(dataItem);
                    Go2UInt32 profileSizeBytes = profilePointCount * sizeof(Go2UInt16);
                    printf("    Item[%u]: Profile data (%u points)\n", j, profilePointCount);
                    //allocate memory
                    if (memory == GO2_NULL)
                    {
                        memory = malloc(NUMPROFILES * profileSizeBytes);
                    }

                    //copy profiles to memory array
                    memcpy(&memory[i * profilePointCount], Go2ProfileData_Ranges(dataItem), profileSizeBytes);
                }
            }

            Go2Data_Destroy(data);
            i++;
        }
    }

    //free memory array
    free(memory);

    //Stop the system
    Go2System_Stop(system);

    //Free the system object.
    Go2System_Destroy(system);

    //Terminate the Go2 library.
    Go2Api_Terminate();
}

 

View Full Article

Integrating the SDK within a .NET application (C#, VB.NET, etc.) 

Sensor Model All
Firmware Version 4.x, 5.x
SDK Version 4.x, 5.x

A .NET wrapper is available for most SDK functions for use in .NET languages (C#, VB.NET, etc.). An upcoming release (v5.1) will add the remaining functions.

Instructions and examples are provided in the Tools package.

View Full Article

Minimum version of VC++ for SDK 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

The SDK is officially tested and fully supported with VC++ 2008.

VC++ 2010 is not officially tested by LMI at this point, but no issues are expected.

For older editions of VC++, the amount of extra effort required to use the SDK will vary, depending on what you are trying to do. For example, if you wish to compile/link your own application written with VC++ 2003/2005 against the Go2 library, that should work without any hassles. But if you wish to rebuild the Go2 library or the sample code LMI provides, you need to create project files compatible with your version of VC++ before recompiling the LMI sources. 

Using versions older than VC++ 2003 will likely require changes to the Go2 source code, and is not recommended by LMI.

View Full Article

Measurement data not received in the SDK even though measurements are added 

Sensor Model All
Firmware Version All
SDK Version All

Make sure the measurements are enabled for output in the web interface on the Output page, in the Ethernet category, under the Gocator protocol.

View Full Article

Combining data when using a multi-sensor setup (G2xxx) 

Sensor Model G2xxx
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

Use the Scheduled Start command. For detailed information, download Technical Note: Gocator – Multi-sensor Operation (Gocator 3.x).

View Full Article

No data output when using Gocator SDK examples 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

By default the Gocator will not output data over EtherNet/IP. Data output can be enabled through the Gocator's web interface. On the Output page, various output options can be configured.

View Full Article

Examples on how to use the Gocator SDK (Gocator firmware 3.x) 

Sensor Model All
Firmware Version 3.x
SDK Version 3.x

Examples on how to use the Gocator SDK to interface with the Gocator are included in the SDK download package available on the LMI3D Website at LMI3D.com. The package includes various examples to illustrate the use of the SDK.

View Full Article

Digital input to script 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

The following scripting API stamp function can be used to retrieve the current digital input state:

unsigned int Stamp_Inputs()

The digital input state can be monitored to trigger a reset logic in the script.

View Full Article

No SDK command to reset encoder count 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

No. Encoder count is reset only when you reset the sensor.

View Full Article

GenTL driver is correctly installed, but the sensor isn't discovered by CVB (Common Vision Blox) (G3xxx) 

Sensor Model G3xxx
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

This can be caused by the PC's firewall. Turn the firewall off and use the kDiscovery tool to check if the sensor can be discovered. This tool uses the same discovery functions as the GenTL driver.

View Full Article

Gocator SDK 64-bit Windows support 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

The Gocator SDK supports 64-bit Windows. You can recompile the libraries for 64-bit Windows by selecting the x64 target in the Configuration Manager dialog in Visual Studio.

View Full Article

Saving the current Gocator configuration through the SDK 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

Gocator firmware 3.x

In Gocator 3.x, the current configuration is stored in the hidden file _live.cfg. To permanently store this configuration using the SDK, this file can be copied using the Go2System_CopyFile() function.

Gocator firmware 4.x

In Gocator 4.x, the current configuration is stored in the hidden file _live.job. To permanently store this configuration using the SDK, this file can be copied using the GoSensor_CopyFile() function.

View Full Article

Activating or switching jobs via SDK (Gocator 4.x) 

Sensor Model All
Firmware Version 4.x
SDK Version 4.x

You can activate or switch a Gocator job by using the GoSdk API's GoSensor_CopyFile function to copy a job file to the hidden _live.job file.

The _live.job file contains the currently active job. If Alignment Reference is set to Dynamic, _live.job also contains the transformations associated with the job).

For example, to make a configuration and associated transormations called "myJob.job" active, call the Go2System_CopyFile method with sourceName set to "myJob.job" and destName set to "_live.job". In order for this to work, "myJob.job" has to be present on the sensor, i.e., already uploaded (for example, using GoSensor_UploadFile) or uploaded in the web interface, or saved in sensor storage in the web interface.

View Full Article

Difference between ASCII data commands Get Result, Get Value, and Get Decision 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

Below are 3 examples of the Get Decision and Get Value commands:

Let's say the Custom formatted string is (%time, %value[0], %decision[0]).


Command: Decision (no arguments specified) 

Response: OK, 33244776916, 45636, 1

<success>,<time>,<measurement>,<decision>

You receive exactly what is stipulated in the custom string.


Command: Decision, 0, 1, , , n

Response: OK, x0, x1, x, , , xn

where x[i] can be 0 (fail) or 1 (pass)


Let's say we ask for decision of measurement ID 878 which is non-existent.

Command: Decision, 878

Response: ERROR, Specified measurement ID not found. Please verify your input


Same applies to Get Value except the command is Value instead Decision and response contains measurement values rather than decision. Pretty straight forward.


Get Result example

Let's say Custom formatted string is (%time, %value[0], %decision[0])


Command: Result (no arguments specified) 

Response: OK, 33244776916, 345346, 0

<success>,<time>,<measurement>,<decision>


Command: Result, 0, 4 (I want complete results of measurement tools ID 0 and ID 4) 

Response: OK,M0x02,00,V45900,D0,M0x06,04,V-7222,D1

<success>,<measurement type>,<measurement ID>,<value>,<decision>,<measurement type>,<measurement ID>,<value>,<decision>

* measurement types are enumerated in User Manual 3.5.2.123 page 280


Command: Result, 876 (non existent measurement ID) 

Response: ERROR,Specified measurement ID not found. Please verify your input

 

View Full Article

Converting exported CSV data into other formats 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

The CSV Converter tool can be used to convert the exported CSV data into other data formats (e.g., bitmap, PNG, ASCII XYZ, etc.). The CSV Converter is in the Integration Tools package and can be downloaded from http://lmi3d.com/support/downloads/.

 

View Full Article

Gocator not detected by GenTL-compliant third-party software 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

After making sure all the steps are followed from the Gocator user manual on installing GenTL driver, ensure the correct firmware version of the Gocator and the correct version of the GenTL is installed. Restarting Windows might be required for the new system environment variable to take effect.

Checklist

  • Firmware and GenTL driver are on the same version?
  • GENICAM_GENTL32_PATH and GENICAM_GENTL64_PATH environment variables are set to the proper folders?
  • In Halcon, does the Assistant detect the Gocator sensor?
  • Is the Gocator on the same subnet as one of the NIC (same network, and not through a router)?
  • Is the Firewall on the PC set to off?
  • In the Gocator UI, in the Output tab, in the Ethernet section, the Gocator protocol is selected, with the Top surface checked?

 

View Full Article

Gocator encoder index and encoder index pulse (Z) 

Sensor Model All
Firmware Version 3.6, 4.x
SDK Version 3.6, 4.x

The encoder index pulse (Z) is a signal that is triggered once every revolution of the encoder. This signal is typically used for aligning data in a rotational application.

In the diagram below, the encoder count (EC) is given as 5 when the Z0 index pulse is triggered. It could be any value however. The important point is that at each index pulse (Z), the encoder count is increased by the number of pulses of the encoder per revolution, and it is this value

In firmware 4.x, the following can be used to retrieve what the encoder count value was at the last index (Z) pulse, which is issued only once per revolution of the encoder. During the scan of a part, an index (Z) pulse may not be even issued, that is, if the encoder does not revolve enough for the index (Z) pulse to be reached.

switch(GoDataMsg_Type(dataObj))
{
    case GO_DATA_MESSAGE_TYPE_STAMP:    
    {
        GoStampMsg stampMsg = dataObj;
        for (j = 0; j < GoStampMsg_Count(stampMsg); ++j)
        {
            GoStamp *stamp = GoStampMsg_At(stampMsg, j);
            printf("  Encoder: %lld\n", stamp->encoderAtZ); 
        }
    }
    break;
}

In firmware 3.6, the SDK function Go2Data_EncoderIndexValue() returns the last encoder count at the index (Z) pulse:

Go2Data_EncoderIndexValue(data);

 

View Full Article

Gocator encoder Z signal needed for encoder triggered operation 

Sensor Model All
Firmware Version 3.x, 4.x
SDK Version 3.x, 4.x

The Z (index) signal is triggered once every revolution of the encoder. This signal is not needed for normal encoder operation. The signal state is encoded in the result message of the Gocator protocol sent out over Ethernet.

View Full Article