Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRegisterEveryNSamplesEvent

Melanie,

 

please find attached the header file. LabWindows added this header file automatically when I added the first DAQmx function to the program. On my computer this header file is located in the folder "C:\Program Files (x86)\National Instruments\Shared\CVI\toolslib\custctrl".

 

Regards,
Thomas

0 Kudos
Message 11 of 18
(1,518 Views)

Hi Thomas,

 

I copied the file to the location you mentioned, but the build won't complete. The error message is just the same.

 

By the way, in the folder already exists a header file with the same name. Did you change something inside?

 

Best,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 12 of 18
(1,514 Views)

Hi Melanie,

 

there is a screenshot added that shows which files are existing in the project folder of my small program. I don't touch no LabWindows files, too dangerous. I only edit those that I created myself.

What error messages are you getting?

 

Regards,

Thomas

0 Kudos
Message 13 of 18
(1,499 Views)

Hi Thomas,

 

I did some testing again today. I needed to eliminate the channel name read from the UI, now the code runs on my machine.

 

I get an upcount of the samples by ten, everytime I click the OK button in the dialog. I expect this behavior, because the configuration of the task is set to 100 samples to acquire and read every 10 samples.

 

I used CVI 2015.

 

Best,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 14 of 18
(1,483 Views)

Hi Melanie,

 

I am happy that you can test the small program now.

 

Your observation is absolutely correct: the function being implemented by "DAQmxRegisterEveryNSamplesEvent" is called every 10 samples so the corresponding variable increases by 10 everytime this function is called. Inside this function that is called every 10 samples the number of total samples is assigned to a numeric slide using SetCtrlAttribute(...). I was expecting the length of the bar to update immediately. In this way the program would give a visual feedback on how far the task has come. But this does not happen. It is not before all samples have been acquired that the numeric slide displays a full length bar.

 

This is where I am wondering how to achieve that the numeric slide updates during the sampling process.

 

Regards,
Thomas

0 Kudos
Message 15 of 18
(1,478 Views)

Hi Thomas,

 

I had some time to fix it today.

 

To put everything together, the following line included in the NSamples Callback fixed it:

 

SetCtrlVal(mainpanel, PANEL_NUMERICSLIDE, (double)dummy); 

 

I changed other things in the code, like the data type of the slide to double, etc. I attached the project, if you want to run it and compare with your code.

 

A thing, that we missed in the beginning is, that properties are not updated through a redraw of the UI. So when you use the value update instead of the property update, everything works fine.

 

Best,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 16 of 18
(1,468 Views)

Hi Melanie,

 

that is the solution. Using "SetCtrlVal" does the job. Now the numeric bar updates while the sampling task is running.

 

Thank you very much for your help,

Thomas

0 Kudos
Message 17 of 18
(1,428 Views)

Hi Thomas,

 

thank you for letting me know. Glad we could solve this.

 

Please help others to find the correct answer faster by marking the solution.

 

Thanks and best,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 18 of 18
(1,425 Views)