12-12-2014 04:41 PM
(I hope this is the right forum to ask this question.)
I wish to load the NI DAQmx feature set in Microsoft Powershell. I am on Windows 7. I cannot find any samples show to do this.
I believe I have everything installed. I also have some Excel files that load NIDAQmx.tlb and properly run the device attached to me PC. The Excel files have VBA code (written by someone else) that inject current and voltage to an attached device. Excel's VBA project references load C:\Windows\SysWOW64\NIDAQmx.tlb (and also C:\Program Files (x86)\NationalInstruments\Shared\TDM Excel Add-In\ExcelTDM.dll).
Since the Excel files run properly, I assume I have everything installed I might need to use NIDAQ MX in Powershell. However I am stymied how proceed. I would like to replace what the Excel file plus is VBA code do and do it in Powershell code.
Any advice or samples how to get NI DAQ MX features loaded in Powershell would be of great benefit.
Thanks
Joe
12-14-2014 07:11 PM - edited 12-14-2014 07:11 PM
@joespr wrote:
(I hope this is the right forum to ask this question.)
I wish to load the NI DAQmx feature set in Microsoft Powershell. I am on Windows 7. I cannot find any samples show to do this.
I believe I have everything installed. I also have some Excel files that load NIDAQmx.tlb and properly run the device attached to me PC. The Excel files have VBA code (written by someone else) that inject current and voltage to an attached device. Excel's VBA project references load C:\Windows\SysWOW64\NIDAQmx.tlb (and also C:\Program Files (x86)\NationalInstruments\Shared\TDM Excel Add-In\ExcelTDM.dll).
Since the Excel files run properly, I assume I have everything installed I might need to use NIDAQ MX in Powershell. However I am stymied how proceed. I would like to replace what the Excel file plus is VBA code do and do it in Powershell code.
Any advice or samples how to get NI DAQ MX features loaded in Powershell would be of great benefit.
Thanks
Joe
How is this question in any way related to Measurement Studio for .NET ?
12-15-2014 07:03 AM
12-16-2014 04:46 PM
Thanks for the replies.
I didn't know where to post the original questions which is why I guessed here might be good.
>>How is this question in any way related to Measurement Studio for .NET ?
So if there is a better place, let me know and I will move it.
I would like write Powershell scripts that run the NI DAQ MX functionality using Powershell (so I am running from the command line) to minimize (or eliminate) use of a UI.
I'm at a loss how to get started with Powershell and NI DAQ MX. I know, for example, if one is writing an application in in C this situation, the first thing one does in the code is load NIDAQMX.LIB and also one includes NIDAQMX.H. Well, the .H file is inappropriate in Powershell for sure. And loading .LIB files does not go well. So, what to do, since there is no NIDAQMX.DLL ?
I mentioned the Excel file with macros that I obtained which loads NIDAQMX.TLB. Loading the objects in a TLB file Powershell is possible, the TLB needs to be "registered". I was able to register NIDAQMX.TLB (after installing WIndows Update KB2640696). However, even after registring I could not load its objects.
So I am looking for a sample from someone who might have gotten this to work.
Thanks for your help or any advice.
Joe
12-17-2014 09:39 AM
@joespr wrote:
Thanks for the replies.
I didn't know where to post the original questions which is why I guessed here might be good.
>>How is this question in any way related to Measurement Studio for .NET ?
So if there is a better place, let me know and I will move it.
Here's an idea. How about asking at a PowerShell forum?