DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET wrapper for DIAdem Connectivity Library

Hello
 
Does anyone wrote a .NET C# Wrapper for the DIAdem Connectivity Library,
or am I the one who need this the first time?
 
Thanks
James
 
0 Kudos
Message 1 of 4
(3,537 Views)
Hello James,
if you are talking about writing a .net wrapper around the LabVIEW-DIAdem Connectivity Library, this is not necessary. The connectivity toolkit is just calling the DIAdem ActiveX APIs ToDataSheet (for data exchange) and ToCommand (for automation commands).
Here is a VBS example from the DIAdem online help of version 10.2:

Dim oDIAdem
Const strCanNotStart = "An error has occurred while executing the example."
'================================================================
Sub DIAdem_exec(DIAdemCommand)
'Execute the DIAdem command
Dim Exe_All, Exe_One, Exe_Type, Para
    If ConnectToDIAdem Then
        If oDIAdem.CmdExecuteSync(DIAdemCommand) <> 1 Then
           MsgBox strCanNotStart
        End If
        oDIAdem.CmdExecuteSync("WndShow('SHELL','Show')")
        Call DisconnectFromDIAdem
    Else
        MsgBox strCanNotStart
    End If
End Sub
'================================================================
Function ConnectToDIAdem
'Create the DIAdem object
  Dim nValueT
  ConnectToDIAdem = 0
    On Error Resume Next
    Set oDIAdem = CreateObject("DIAdem.TOCommand")
    If Err.Number > 0 then
      MsgBox ("Err No " & CStr(Err.Number) & " " & Err.Description)
      Err.Clear
    Else
      iWait = 0
      Do
        iWait = iWait + 1
        If iWait >=10000 Then
          If MsgBox("DIAdem is not responding. Try again?", vbYesNo, "Warning") = vbYes Then
            iWait = 0
          Else
            Exit Function
          End If
        End If
      Loop Until Not oDIAdem.bInterfaceLocked   
      oDIAdem.bNoErrorDisplay = true
      oDIAdem.bNoWarningDisplay = true
      ConnectToDIAdem = 1
    End If
End Function
'================================================================
Sub DisconnectFromDIAdem
'Destroy the DIAdem object
  Set oDIAdem   = Nothing
End Sub



Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 4
(3,518 Views)

Hi Ingo

Using the OLE interface with ToDataSheet and ToCommand is the way I implemented the communication between my application and Diadem.

-> but this results in a very slow data transfer! ...about 2 minutes - to load the same data with a tdm file it takes about one or two second!

I need a much faster way < 5 sec.

Any idea or hint - other than implementing the data transfer using tdm files?

Thanks

James

 

0 Kudos
Message 3 of 4
(3,512 Views)
Hi James,
maybe there is room to improve the performance of the data transfer. Please check the online help for the function ValueRangeSet. This one should work faster than ChnValSet. The reference contains an example which you can use for a quick benchmark.
Or have you allready been using this function?
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 4 of 4
(3,506 Views)