05-09-2006 02:46 AM
05-11-2006 10:36 AM
05-15-2006 04:32 PM
Hi MatthieuG,
You have not made an error. It turns out that during an OLE Server session, DIAdem automatically locks the DIAdem GUI, with the idea that otherwise the user and the OLE Server controlling application could get in each other's way and lead to unexpected results. Ideally this would not be the case if the OLE Server controlling application happened to be running a DIAdem VBScript, but at the moment DIAdem does not distinguish between an arbitrary OLE Server session and one that is currently running a VBScript.
For now the best workaround I can suggest is to break your VBScript into two VBScripts-- everything before and after the InteractionON, respectively (but not including the InteractionON command). Then call the first VBScript from LabVIEW and begin polling DIAdem once per second to see if the desired steps have been carried out in DIAdem-- hopfully they lead to new channels or some other measurable change. Once the desired action has occured, LabVIEW can kick off the second VBScript. This is neither clean nor pleasant, but it is the best I can think of with currentl functionality.
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-22-2006 05:10 AM
Hi,
I recently used Diadem 9.1 with labview 7.1 to create a data capture/analysis system, labview did the capture, opened diadem using the connectivity vi's and instructed diadem to run a vbs script.
Analysis was performed then the user could print graphs etc from a SUD dialog, or use the interactionON (run from the vbs file)function to gain access to the full capabilities of diadem and then return to the script.
This worked using diadem 9.1, am I correct in assuming that this functionality will no longer work using Diadem 10.
I'm about to build 10 more systems and before I order 10 copies of diadem I need to get this resolved.
This change in functionality will cause major problems (splitting the script in two is not an option).
Is it possible to buy diadem 9.1 (at reduced cost of course) instead of 10.
Regards
Nick
05-23-2006 03:14 PM
Hi Nick,
I went another round with R&D on this question, and they reported that the GUI lock that occurs when accessing DIAdem through its OLE Server, which precludes InteractionON, is only applied with the CmdExecuteSync() method. They say if you use instead the CmdExecuteASync() method that the InteractionON state will be allowed, even in DIAdem 10. They are looking into addressing this for the next version of DIAdem, but for DIAdem 10 that means you'd need to poll on a DIAdem variable from LabVIEW which the VBScript would set as its last command, in order to know when it finished (assuming LabVIEW doesn't quit then too). You might also want to poll on the error status in case the VBScript asynchronously errors out. In that case, try playing with the below code:
Set ToCommand = CreateObject("DIAdem.ToCommand")
Call ToCommand.CmdExecuteSync("LastErrorReset")
Call ToCommand.CmdExecuteSync("AutoIgnoreError:= 1")
Call ToCommand.CmdExecuteSync("L1:= 0")
Call ToCommand.CmdExecuteSync("L1:= ProgramRevision(1,3,4)")
'Call ToCommand.CmdExecuteSync("L1:= ProgramRevision")
'Call ToCommand.CmdExecuteSync("LastErrorReset")
Call ToCommand.CmdExecuteSync("LastErrorGet")
Call ToCommand.IntegerVarGet("L1", Version)
Call ToCommand.IntegerVarGet("LastErrorNo", ErrNum)
Call ToCommand.TextVarGet("LastErrorFile", ErrText)
Call ToCommand.IntegerVarGet("LastErrorPart", ErrPart)
Call ToCommand.CmdExecuteSync("AutoIgnoreError:= 0")
Set ToCommand = Nothing
MsgBox "DIAdem Revision = " & Version & vbCRLF & "ErrNo = " & ErrNum & vbCRLF & "ErrMsg = " & ErrText & vbCRLF & "ErrPar = " & ErrPart
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-25-2006 02:46 AM
Hi Brad
Thanks for looking further into this.
I've created the attached vi + script, the vi opens diadem asynchronously and runs the script and then reads variable R1 repeatedly until R1=1 then diadem is closed.
The script sets interactionOn then when it resumes sets R1 to 1.
This seems to work ok most of the time but occasionally I find that when the end interaction button is pressed labview locks up, R1 is not read and diadem remains open.
This happens maybe one time in 10 but its a bit to often for things to be considered reliable.
Any suggestions appreciated
Nick
06-09-2006 01:14 AM
Hi Nick,
Thank you for your test files. With this information we could reproduce the behaviour you described. It can appear if DIAdem is controlled by an application (e.g. LabVIEW) and the “InteractionOn” mode is activated via script. This will be fixed for the next revision.
Greetings