NI DIAdem DAC Panel

Use the DIAdem DAC panel for measurement and for open and closed loop control when the PC running DIAdem has a NI DAQ device connected (DAC = digital analog controller).  

 

Beginner DAC panel tutorial

NI DIAdem DAC manual

 

Generating Simulated Data

Enter the script below into a new DIAdem script panel tab and press the F5 key to run it. This will load and run a DIAdem DAC example.   After 15 seconds, the recording will end and then the DAC panel will be shown.  

Call Data.Root.Clear
Call SchemeLoad(sFilePathDIAdemExample("StoreCh.dac"))
Call SchemeCheck("Normal") 
Call SchemeMeasStart()
Call WndShow("DAC")

Function sFilePathDIAdemExample(ByVal sFilename)
  'Returns the full absolute file/path for the location of the DIAdem
  'example (TDM/TDMS) file sFilename.  Looks in the usual places.
  'Returns "" if the file cannot be found.
  'v20191023
  sFilePathDIAdemExample = ""
  Dim arrFilePaths, sFilePath, sFolder: ReDim arrFolders(1): arrFolders(0) = ProgramDrv: arrFolders(1) = CommonDocumentsPath
  For Each sFolder In arrFolders
    arrFilePaths = DirListGet(sFolder,sFilename,"Date/Time","FullFilenamesRecursive")
    If IsArray(arrFilePaths) Then
      For Each sFilePath In arrFilePaths
        If InStr(1,sFilePath,"Libr",vbTextCompare) = 0 Then sFilePathDIAdemExample = sFilePath: Exit For
      Next
    End If
    If Len(sFilePathDIAdemExample) > 0 Then Exit For
  Next
  If IsArray(arrFilePaths) Then Call Erase(arrFilePaths)
  If IsArray(arrFolders) Then Call Erase(arrFolders)
End Function  'sFilePathDIAdemExample()

 

Explore the function blocks by double clicking on them.   Save the DAC file to a temporary file and then try replicating the signal generation.   The three outputs from Sine, Random, and Noise are routed together in the same green color cable, and then go as inputs to the Channel Storage and Data Display function blocks.  

NOTE: Data will not be generated to the Data Portal or an external file unless you click the 'Start Measurement' toolbar button.   Pressing the 'Start Display' button will not generate data to the Data Portal or an external file.

After you have successfully generated the three signals to channels in the Data Portal, try changing the Channel Storage function block to write the data to a TDM file.  

 

Do you need help with your project?   Send me an email requesting a free phone / web share consultation.  


 

Copyright © 2021,2022,2023 Mechatronic Solutions LLC, All Rights Reserved