LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Listbox setctrlindex blue focus

Well, you are configuring a buffer of 1024 samples and a callback that fires exactly every 1024 samples: since the acquisition process is continuous, you will not be able to read all the 1024 samples before they are overwritten by new measures acquired by daqmx. Try increasing the buffer size to 1.5 or 2 times the "everyNsamples" amount, this should fix the problem.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 11 of 18
(1,641 Views)
Ok,
Thanks and sorry about my lacks

Olivier
0 Kudos
Message 12 of 18
(1,632 Views)
Hi Roberto,
I have another question, does DAQmxRegisterEveryNSamplesEvent could work with a digital acquisition on a ni9401 racked on a USB NIcDAQ 9172, because I tried to use it and it does'nt seem to fire any events, and how should I do to register the digital IO events on byte value change?
Now AI acquisition works I splitted my functions in differents files and called the plot on the graph by a timer event callback.
but it only works in release configuration, even after increasing the size of the buffer.
attached my different files.

Thanks


Olivier
0 Kudos
Message 13 of 18
(1,610 Views)
Hi Olivier,

There is a CVI shipping example that shows you how to acquire digital data using change detection. it is called "ReadDigChan-ChangeDetection."  You can find it by looking in the CVI example finder (go to Help>>Find Examples...)  then navigate to Hardware Input and Output>>DAQmx>>Digital Measurement>>ReadDigChan-ChangeDetection.  Let me know if you have any questions about that example.

Now, you said your AI only works in release mode and not debug mode?  Had it worked in debug before you split it in to different files? 
Kristen
National Instruments
0 Kudos
Message 14 of 18
(1,579 Views)
Hi,
No it didn't work even before in debug mode I receive non fatal errors on, but I have tried to increase buffer size and it still does not work correctly.

Thanks

Olivier
0 Kudos
Message 15 of 18
(1,571 Views)
Just as a side note, I don't understant why you are using some ListType variables in your code: lists defined in the toolbox library have nothing to do with list or ring controls in the user interface, as clearly stated in the online help for these functions:

A list is an ordered sequence of items of the same size. Lists are very useful for managing arrays of data when the size of the arrays cannot be known ahead of time.
Important: The lists managed by this class of functions are lists of arbitrary data items. They are not related to the User Interface Library functions which operate on List Boxes and Ring Controls.

It is possible that this has nothing to do with your present problems, but I would suggest to cut all references to lists in your code since they are not relevant to it. Moreover, using lists without first creating them and disposing of them at the end can raise unexpected errors that may interfere with code execution.
 


Message Edited by Roberto Bozzolo on 02-01-2008 09:43 AM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 16 of 18
(1,557 Views)
Hi, Roberto
Ok I do not understand what you are talking about, when you speak about ListType variables, is this ListType LISTBOX you are talking about.
What should I use instead?
Moreover, I'd like to know why can't I use multiples analog tasks with different timing or acquisiton type, I'd like to keep my speedtorquetask acquisition and load another task for pressure but the hardware seems to be reserved when I do that.
I have an issue with my IO file handle I guess it is because I call it in another file than my main.c file and I receieve the error
 Datafilepath is not valid ,
 NON-FATAL RUN-TIME ERROR:   "Analog inputs.c", line 34, col 5, thread id 0x00000218:   Library function error (return value == -4 [0xfffffffc]). Panel, pop-up, or menu bar handle is invalid
Finally I do not understand why my Digital IO acquisition still doesn't work, I made a digital acquisition on the same scheme of the analog one and when I try to put a square wave with 0 to 5v value on the digital input acquisition nothing seems to be moving.( using eventdetection).

Thanks
Olivier
0 Kudos
Message 17 of 18
(1,531 Views)


olivier66 wrote:
Hi, Roberto
Ok I do not understand what you are talking about, when you speak about ListType variables, is this ListType LISTBOX you are talking about.
What should I use instead?

Short answer: nothing! You really don't need to use any ListType variable to handle a listbox: simply manage control items using strings to read/write the labels and simple numeric variables to read/write the associated values, as you are already doing. You can simply remove any reference to this variable without effect to your code (apart removing unmanaged errors in tollbox functions Smiley Wink )


olivier66 wrote:
Moreover, I'd like to know why can't I use multiples analog tasks with different timing or acquisiton type, I'd like to keep my speedtorquetask acquisition and load another task for pressure but the hardware seems to be reserved when I do that.

DAQ cards normally have only one clock to handle all the acquisitions, so when you try to start a new acquisition task the system tries to define timing characteristics but it finds the clock already allocated and returns an error. The usual solution is to define a single acquisition task with all your channels and manage acquired data according to your needs. In case your tasks need to have different clocks, one possible solution is oversampling: acquire all inputs to the maximum frequency suitable to meet all of your needs and don't consider the samples that your slower task does not need.


olivier66 wrote:
I have an issue with my IO file handle I guess it is because I call it in another file than my main.c file and I receieve the error
 Datafilepath is not valid ,
 NON-FATAL RUN-TIME ERROR:   "Analog inputs.c", line 34, col 5, thread id 0x00000218:   Library function error (return value == -4 [0xfffffffc]). Panel, pop-up, or menu bar handle is invalid

This is not clear to me: is the error related to a file I/O as you say or related to user interface error as the -4 error states? Or are they two different faults?


olivier66 wrote:
Finally I do not understand why my Digital IO acquisition still doesn't work, I made a digital acquisition on the same scheme of the analog one and when I try to put a square wave with 0 to 5v value on the digital input acquisition nothing seems to be moving.( using eventdetection).

Have you tried KristenC suggestion about ReadDigChan-ChangeDetection shipping example?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 18 of 18
(1,506 Views)