The 1.1 version of the CLI tool now allows for the --timeout flag on each call to set how long the CLI waits for LV to start up and connect. When launching LabVIEW and opening a large project, it often takes longer than 60 seconds to finish the loading process. You may need a timeout more like 120 or 180 seconds in this case, depending on machine and project complexity.
If LabVIEW is already open, this also alleviates the problem.
Matt, I am using version 2.1 of the CLI tool (at least, that's what the NI Package Manager says it is) and it doesn't seem to recognise a --timeout parameter.
Do you definitely mean --timeout, with two dashes and a lower-case 't'? This seems inconsistent with the other command line parameters.
The ini file is located where Bas says, I think "union" is a typo. This is what it looks like by default (LabVIEW 2019). I always get the -350000 error with these settings.
DefaultPortNumber = 3363
AppendToLogFile = FALSE
AppExitTimeout = 10000
DefaultLabVIEWPath = ""
OpenAppReferenceTimeoutInSecond = 3.000000
AfterLaunchOpenAppReferenceTimeoutInSecond = 20.000000
DeleteLabVIEWCLILogFile = FALSE
UDCInstallID = ""
PingDelay = -1
PingTimeout = 10000
It's not clear to me what the two timeout values do, "OpenAppReferenceTimeoutInSecond" seems to wait that long before the LabVIEW window even opens, but adding 10 seconds to either of the timeout values fixes it for me.
@EricRCan you elaborate on AppExitTimeout?
In my case, I run CLI with -OperationName CloseLabVIEW and then LV starts compiling a pretty big project before closing (as I expect). During compilation CLI returns:
Error code : -350005
Error message : LabVIEW CLI: (Hex 0xFFFAA8CB) The CLI for LabVIEW failed to close LabVIEW. Ensure LabVIEW does not hang.
It would seem that increasing AppExitTimeout should solve the problem, but it doesn't. Any suggestions?
@bienieck that is a different error code (-350005 instead of -350000) and a different error message, occurring at the end of a successful CLI run rather than the start so is unlikely to be anything to do with timeout starting the LabVIEW server. You might do better to start a new thread.