Skip to content

C#

Guide

Interface名一覧確認

1
2
3
4
5
6
7
8
    HTuple info;
    HTuple interfaces;

    HOperatorSet.InfoFramegrabber(
        "?",
        "info_boards",
        out info,
        out interfaces);

    private void ShowInstalledInterfaces()
    {
        HOperatorSet.InfoFramegrabber(
            "?",
            "info_boards",
            out HTuple info,
            out HTuple interfaces);

        for (int i = 0; i < interfaces.Length; i++)
        {
            Console.WriteLine(
                interfaces[i].S);
        }
    }

Interface名出力例

1
2
3
4
5
6
7
GigEVision2
GenICamTL
SiliconSoftware
BitFlow
SaperaLT
pylon
USB3Vision

Device名を確認

    HOperatorSet.InfoFramegrabber(
        "GigEVision2",
        "device",
        out HTuple info,
        out HTuple devices);

    for (int i = 0; i < devices.Length; i++)
    {
        Console.WriteLine(devices[i].S);
    }

CameraType候補確認

1
2
3
4
5
    HOperatorSet.InfoFramegrabber(
        "SiliconSoftware",
        "camera_type",
        out HTuple info,
        out HTuple cameraTypes);

SetFramegrabberParam() で使えるキーを確認

1
2
3
4
5
    HOperatorSet.InfoFramegrabber(
        "GigEVision2",
        "parameters",
        out HTuple info,
        out HTuple parameters);

実機・ボード情報確認

1
2
3
4
5
    HOperatorSet.InfoFramegrabber(
        "GigEVision2",
        "info_boards",
        out HTuple info,
        out HTuple boards);

    //AcquisitionLineRate line_rate LineRate
    HOperatorSet.SetFramegrabberParam(_acqHandle,"line_rate",settings.LineRateKHz * 1000.0);
    HOperatorSet.SetFramegrabberParam(_acqHandle,"image_height",settings.Height);



    private void ShowDevices(string halconInterfaceName)
    {
        HOperatorSet.InfoFramegrabber(
            halconInterfaceName,
            "device",
            out HTuple information,
            out HTuple devices);

        for (int i = 0; i < devices.Length; i++)
        {
            Console.WriteLine(devices[i].S);
        }
    }

    //Interface名ごとに問い合わせ例
    // ShowDevices("GigEVision2");
    // ShowDevices("SiliconSoftware");
    // ShowDevices("EuresysCoaxlink");

    // CameraType候補
    HOperatorSet.InfoFramegrabber(
        "SiliconSoftware",
        "camera_type",
        out HTuple information,
        out HTuple cameraTypes);



    //パラメータ名一覧を取得
        HOperatorSet.InfoFramegrabber(
            "GigEVision2",
            "parameters",
            out HTuple info,
            out HTuple parameters);

        //中身確認
        for (int i = 0; i < parameters.Length; i++)
        {
            Console.WriteLine(parameters[i].S);
        }