From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SCAN_Start & "Real Time Acquisition"

Hi there,
I'm sorry for my poor English, but it avoid me to correctly understand
the way the SCAN_Start function works.
I would like to draw some acquired signals from a 6023E
analogic/numeric card as soon as the values have been read
(each group of point have to be drawned at once).
I have 5000 points to acquire, at a scanning frequency of 1KHz. To
realize this, I currently use the following functions:

iStatus = DAQ_Rate(1000, 0, &iSampTB, &uSampInt);
iStatus = DAQ_Rate(10, 0, &iScanTB, &uScanInt);

iStatus = SCAN_Setup(g_Param.iPCI_6023E,g_shNbChannels,shChannelList,
shGainList);

iStatus = SCAN_Start(g_Param.iPCI_6023E, shData, 5000*g_shNbChannels,
iSampTB, uSampInt,iScanTB, uScanInt);

while ((usDAQStopped != 1) && (iStatus == 0))

{
iStatus = DAQ_Check(g_Param.iPCI_6023E, &usDAQStopped, &ulNbEchant);

/*Here, I just convert the values into Votages ...*/

}

I wonder if someone could explain me how to correctly use these
functions, so as I can realize a "real time display" of
these signals ...
My big problem is that I'm unable to configure the 6023E card so as it
scans my signals at the correct scanning frequancy.
Thanks a lot for your sooner help.
MANU
0 Kudos
Message 1 of 2
(2,636 Views)
MANU,

First, I would suggest that you do not use the DAQ_Rate() function. It was created before E-Series devices existed, and it does not always return the optimum values for the timebase and sampleInterval output parameters. Thus, I would suggest that you explicitly specify the sampTimebase, sampInterval, scanTimebase, and scanInterval input parameters of the SCAN_Start() function. Documentation for this function, and all NI-DAQ functions, is available in the NI-DAQ Function Reference Help. This resource can be found in the following location:

Start >> Programs >> National Instruments >> NI-DAQ >> NI-DAQ Function Reference Help

Below are the values you should use for the SCAN_Start( ) function's input parameters in this particular situatio
n:

You will use the 20 MHz clock as the sample timebase.
sampTimebase = -3

The maximum sampling rate of the NI 6023E is 200 kS/s.
20M/200k = 100
sampInterval = 100

You will use the 20 MHz clock as the scan timebase.
scanTimebase = -3

You desire a scan rate of 1 kHz.
20M/1k = 20000
scanInterval = 20000

Good luck with your application.

Spencer S.
0 Kudos
Message 2 of 2
(2,636 Views)