04-18-2008 11:10 AM
Also, the ActiveX controls are only a subset of the available .NET tools. So if I need a gauge control I need to program in VB, C# etc? I tried creating a Win32 C++ app, added a dialog to it, but the .NET controls are still grayed out.
Is NI support of C++ not as complete as the support for VB etc?
04-18-2008 11:39 AM
04-18-2008 01:00 PM
Thanks. I will be moving to C#.
04-20-2008 02:23 PM
04-21-2008 10:25 AM
I need to capture negative going edges on a digital input from a NI-9401. The application will be in C#. Is there an example I can look at that handles an event of this type. I have done plenty of VC++ MFC code, but I need an example of how C# is constructed to do this. Thanks.
04-22-2008 09:47 AM
04-22-2008 10:16 AM
Thanks, I found the examples. Another dumb question if I may. I am getting a runtime error saying:
Additional information: Measurements: Device identifier is invalid.
Device Specified: Dev0
The line causing it is:
myTask.DIChannels.CreateChannel(
"Dev0/port0/line0", "MeterInput", ChannelLineGrouping.OneChannelForEachLine);I have a NI-9401 plugged into the first slot in a cDAQ-9172.
What am I doing wrong? The line is preceeded with:
myTask = new Task("FlowMeter");
Thanks
04-22-2008 10:56 AM
04-22-2008 11:43 AM
Thanks it is nice to see something working!
I am wanting to capture falling edges on a digital input. I have setup, I think, an event handler to catch these negative edges like so:
private string MeterInput = "Channel 0"; ...
Meter =
new Task("FlowMeter");Meter.DIChannels.CreateChannel(
"cDAQ1Mod1/port0/line0", MeterInput, ChannelLineGrouping.OneChannelForEachLine);Meter.Timing.ChangeDetectionDIFallingEdgePhysicalChannels = MeterInput;
Meter.DigitalChangeDetection +=
new DigitalChangeDetectionEventHandler(Meter_Pulse);SCR =
new DigitalSingleChannelReader(Meter.Stream);Meter.Start();
...
private void Meter_Pulse(object sender, DigitalChangeDetectionEventArgs e){
}
Is there a time stamp that I can query within Meter_Pulse?
Also is there a functional description of NI-9401's C# interface? I am getting Measurement Studio 2005 help about member functions, but it is a backward way to get an understanding of the programming structure. Sorry about such a question, but I have jumped into the deep end and I am trying to get up to speed as quick as possible.
Thanks
04-23-2008 09:17 AM - edited 04-23-2008 09:18 AM