03-31-2010 07:16 AM
Hello-
This is a fairly simple question. I am trying to convert from Legacy DAQ drivers using the Component Works controls to DAQmx 8.7+ drivers. I did the majority of the work a year ago and it works fine. It was reported, though that sometimes the "single read" function I implemented to replace CWAIPoint.SingleRead is timing out.
In my code:
// Since this is an instantaneous read, set the timeout to 10ms
m_DAQmxTask.Stream.Timeout = 10;
// Read the data
dataArray = m_DAQmxChannelReader.ReadSingleSample();
I am setting the Timeout to 10. I went looking back at the CWAIPoint object in the vb6 code and am having problems finding the basic documentation on it.
So I guess I have two questions;
1.) How do I translate this control into a set of C# "task configuration" commands:
Begin CWDAQControlsLib.CWAIPoint CWAIPoint
Left = 3180
Top = 2580
_Version = 393219
_ExtentX = 847
_ExtentY = 847
_StockProps = 0
Reset_0 = 0 'False
CompatibleVers_0= 393219
AIPoint_0 = 1
ClassName_1 = "CCWAIPoint"
opts_1 = 16
Device_1 = 1
TotalScansToAcquire_1= 100
ScanClock_1 = 0
ChannelClock_1 = 2
ClassName_2 = "CCWAIClock"
ClockType_2 = 2
Frequency_2 = 100
Period_2 = 0.01
InternalClockMode_2= 1
Buffer_1 = 0
Channels_1 = 3
ClassName_3 = "CCWAIChannelArray"
Editor_3 = 4
ClassName_4 = "CCWAIChannelsArrayEditor"
Owner_4 = 1
StartCond_1 = 0
PauseCond_1 = 0
StopCond_1 = 0
HoldoffClock_1 = 0
End
2.) Where is the general reference help on the CWAIPoint control so that I don't have to post these questions in the future?
-Bill Ames
04-02-2010 05:09 PM
Hi Bill,
So there becomes a problem in that the settings for the CWAIPoint control do not have a one-to-one equivalent with DAQmx. The variables and settings used to configure a Traditional DAQ task are the variables in the CWAIPoint control. When writing this for DAQmx, you need to instead define new settings and configurations that follow the DAQmx convention.
There are a few documents to help you out with that. First is a tutorial titled Transition from Traditional NI-DAQ (Legacy) to NI-DAQmx using Microsoft Visual Basic .NET which is actually a five part document that is extremely detailed and specifically mentions the CWAIPoint control. The links to the next pages are at the bottom. The second is another tutorial to help with understanding the differences from Traditional DAQ to DAQmx: What are the Terminology Changes in NI-DAQmx?
I would also check out the examples in C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\DotNET\Examples\DAQmxWithUI and C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\