02-26-2008 02:40 AM
02-26-2008 08:30 AM
02-27-2008 02:46 AM
Hi Stuart,
Thank you very much for your efforts, perhaps is better I `ll explain me better, the fact is taht I have made so many trials and changes that was difficult to summarize where exactly the problem is located. I need a PID that is able at least to run 1000 Hz.
Short to say: it is not possible for me until now to make the card working in the Hardware Timing sample mode. Each time I try to select it the error above pop up saying "the value seleted for the timing property is not supported." and suggests me thereafter to change in continuously or limited number of value timing. Could be that this kind of timing is not supported from the USB?
Now one could think then to change to continuously acquisition but then another error appears saying the Buffer size is "only 1 when at least 2 would be needed" and until now I didn`t suceed to make it changing idea even when I set the sample pro channel 1000 or I try to use the buffer property node.
The first way I got something out was to include the data output in a for cycle and produce so an array of double values of limited length but in this way I loose the PID synchronization.
A second way was using a vi similar to the one I attached in this message. So keeping the writing task not timed (but then I need a timed read task) I ´m able to make it writing directly single samples double format . The problem here is that the writing sampling can`t go below 1 ms whatever fast the reading sampling is. This forces to keep the reading sampling to 1000 Hz also.
The only way to make it faster would be to select explicitely the sampling frequency for the writing but in this way I have to place a timing Vi on the write task and this again produce the buffer error I explained above.
Now I`m asking myself if someone has never done a PID with such a card, if it is possible, and which wuld be then the maximum frequency (if 20 000 would be more than enough).
If you or someone else could help me to understand where the misunderstandig stays I will be very grateful indeed.
bye
Principiant
02-27-2008 05:34 PM
02-28-2008 06:32 AM
Hi Stuart,
Yes you are right the PCI device is not a National Instruments device, sorry I have not expressed me well.
Anyway I followed yor suggestion ( I`m sure I already tried it but I repeated for safety). As you can Imagine if i try to use the example changing only the sample mode and removing the "Wait for sample cloks" Vi it repeats the same error " the buffer should be at least 2".
So I have to create an array of at least 2 samples in order to get out something. It is anyway hard to make it working properly (if it is possible), the results are by now not nice at all.
I also called NI support to get informations. In addition to what you already confirmed and I suspected (USB do not support HW sampling) they also added that a PID could not be made in principle on not Real Time systems which sounds me a bit strange.
Anyway I try now to make a simpler thing performing a PI action on a signal read from the USB 6259 card, using the same to output an error signal.
Here comes another problem when I try to use Shift registers on the while loop: "the card do not support unbuffered operations" something that I cannot relate with this apparently innocent change.
Anyway thanks for all your help, I hope that someone which has already made a PID loop with such a card read this thread and could give me an help.
Bye
Principiant
02-28-2008 09:28 AM
Can you send me a screen shot of your block diagram? That might help.
StuartG
02-29-2008 06:09 AM
Hi Stuart,
I want to say you that it seems the problem for the error I said you was not so critical, I went through (even if I really don`t know how).
But perhaps another question which could hlep me a lot in the next steps.
I haven`t until now understood how to make fitting sampling rate and number of sample pro channel to make the thing working at my selected frequency.
So to say until now everything works just playing around with not so much awarness of what is really happening. Very often two main errors appear: or the buffer has been overwritten and so data are lost or there`somehow a problem with slow communication between the parts of the setup.
Adding on it seems these errors are not deterministic. Sometimes when I start the program of acquisition let`s say 1000 rate and 10 samples for channel in reading task, it works smooth, other times (unpredictably) it crash on one of these two errors. Sometimes is enough to enlarge the buffer size some others it has no influence and some others even reducing the buffer size helps.
The only thing I discovered is that seems not advisable to make the input and output number of samples per channel different.
Have you a recipe to make the rate and the buffer size fitting together?
Thank you
Principiant