Skip to content

LabOne API/data-server version compatibilityΒΆ

It is strongly recommended to always connect to a data-server using an API with matching version. By default, all APIs will raise an error or a warning when attempting to connect to a data-server on a different version.

If needed, this check can be bypassed by setting the allow_version_mismatch/allowVersionMismatch flag to true:

from zhinst.core import ziDAQServer

daq = ziDAQServer("localhost", 8004, 6, allow_version_mismatch=True)
from zhinst.toolkit import Session

session = Session("localhost", allow_version_mismatch=True)
#include "ziAPI.h"

void handleError(ZIConnection conn, ZIResult_enum resultCode) {
    // ...
}

int main(int argc, char** argv)
{
    ZIConnection conn = nullptr;
    handleError(conn, ziAPIInit(&conn));
    handleError(
        conn, ziAPIConnectEx(conn, "localhost", 8004, ZI_API_VERSION_6, "allow_version_mismatch=1")
    );
}
ziDAQ('connect', 'localhost', 8004, 6, 1);
using zhinst;

namespace LabOneTutorial
{
    class Program
    {
        static void Main(string[] args)
        {
            ziDotNET daq = new ziDotNET();
            daq.init("localhost", 8004, (ZIAPIVersion_enum)6, true);
        }
    }
}

LabVIEW specific

In LabVIEW a warning will be reported in case of version mismatch. This behavior cannot be altered.