01-29-2008 07:06 AM
01-30-2008 09:25 AM
Hi BBANACKI,
Nope, this doesn't sound familiar, so we're going to need to go fishing for clues. First of all, that's a pretty lengthy script you're running from LabVIEW, so the key line of code may be somewhere between line 1 and line 778. Still, how about if you post what line 778 is, just in case there's a clue there. The DIAdem error messages are usually pretty good, so let's start where they're pointing to.
Also, let's take LabVIEW out of the equation for testing purposes. Try running that same "Field Test Script.VBS" from an external VBScript running in the Windows VBScript host (double-click on the VBS file in Windows Explorer). The code of the test VBScript will look something like this:
Set ToCommand = CreateObject("DIAdem.ToCommand")
ToCommand.CmdExecuteSync("ScriptStart(""C:\Field Test Script.VBS"")")
Set ToCommand = Nothing
Let me know if this VBScript-instead-of LabVIEW approach reproduces the same behavior (that is dependent on whether DIAdem was previously launched).
Brad Turpin
DIAdem Product Support Engineer
National Instruments
01-30-2008 03:39 PM
01-30-2008 06:17 PM
Hi BBANACKI,
Your last statement sounds like the hot clue I was looking for. An automatic result of loading a VBScript into DIAdem memory is that the variable AutoDrvUser is set to the Windows folder that the VBScript came from. Thereafter a command which references the file only without the file's full path would succeed, but prior to this the same command would fail. Look at the VBScript snippet I sent you earlier, this is the equivalent of the difference I'm talking about:
Set ToCommand = CreateObject("DIAdem.ToCommand")
ToCommand.CmdExecuteSync("ScriptStart(""Field Test Script.VBS"")")
Set ToCommand = Nothing
Set ToCommand = CreateObject("DIAdem.ToCommand")
ToCommand.CmdExecuteSync("ScriptStart(""C:\My FieldTest Folder\Field Test Script.VBS"")")
Set ToCommand = Nothing
The top 3 commands above would behave as you suggest, while the bottom 3 commands would run correctly even if the VBScript had not been loaded into memory.
Please check and see if you are referencing any files (*.VBS, *.SUD, *.TDV, *.TDR, etc.) by filename only and let me know. This may not be the issue, but it sure would explain the behavior you see, even though it would be at odds with the error message displayed.
Brad