07-18-2016 10:09 AM
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
07-18-2016 11:05 AM
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
07-19-2016 10:48 AM
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
07-20-2016 09:06 AM
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
07-20-2016 09:43 AM
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
07-21-2016 04:23 AM
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
07-27-2016 08:53 AM
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
07-27-2016 08:56 AM
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