09-14-2021 08:55 AM
Hi Voila,
@Voila1 wrote:
The sections of interest are in the LTS FTR MK2.vi in the "test" event case then sections 2 and 3 of the state machine.
In state "3" all I see is a missing subVI.
In state 2 there is a DAQ routine calling several task in the described manner (create/use/kill). Which of them is giving errors?
09-14-2021 09:08 AM
I only focused on the DAQmx stuff. I remain surprised because I didn't find anything I could point to as a cause for that error code. All your hardware-clocked tasks are set for Finite Samples and the same wire feeds both the DAQmx Timing '# samples' input (setting the task buffer size) and the DAQmx Read '# samples' input.
I've neither experienced nor heard of that combo leading to the -200279 error, which arises when the DAQmx driver is trying to deliver more samples from the board to the task buffer, but there's no room left in the task buffer to receive it all. This should never happen in a Finite Sampling task - the board/driver should know when to stop trying to deliver data such that this overflow never happens.
It could (and probably *would*) happen in a Continuous Sampling task where you make 1 single call to DAQmx Read requesting a # samples equal to the buffer size. But I don't see how or why your Finite tasks would behave as though they were configured to be Continuous.
I agree with GerdW that it's a bad practice to create and clear tasks more often than necessary. One can usually create & clear just once, hold onto the task refnum while running, and then start and stop repeatedly instead. (The software-timed digital lines should only do writes repeatedly while having a single one-time create, start, stop, and clear.)
I don't have a *specific* theory why overuse of clear & recreate could lead to your -200279 error, but would advise that you work on mods that let you create and clear just once with repeated start, read, stops for the analog channels.
<went away, came back, took a little closer look at some of the code>
Your Keyence Engine subvi has a weird arrangement. You start configuring an AI task for 'Dev1/ai0' (the default value when unwired from the calling code). Then you drop in a call to your DAQ Measure1 subvi which also creates, runs and clears an AI task for the same 'Dev1/ai0' channel. Having finished that, you *then* retrieve the task refnum from your first config and start it up.
So another simple thing you can try quickly is to do your call to DAQ Measure1 *before* you start to configure the task that's sync'ed with DI. Just speculating, but I wonder whether your unusual sequence of calls is contributing to your errors.
-Kevin P
09-17-2021 05:24 AM
weird is a bit of an understatement. There is also the bit where it creates a task to read an entire dio port for the status of 2 dio pins, the same port they are trying to do digital writes on.
Anyway,
Did a full reinstall and added some more ram. That seems to have reduced the occurrence of the error but not removed it, which suggests its probably a genuine overflow error. So I think its rewrite time.
Cheers for the help
V