08-14-2017 10:20 AM
I have system set up with a Data Translation DT9804 DAQ card (utilizing the LV-Link 3 VI library). Currently two of the AI channels are being used by a main VI program that scans the channels continuously. I would like to write a second seperate VI that would access a third AI channel that would run simultaneously with the main program. Since the main program is fairly complicated, I do not want to alter it in any way. The issue is that whenever I start the secondary program, occasionally it will work for several seconds before crashing and giving me an invalid task error (code 1021).
I was wondering if there is any way to have these programs be able to run simultaneously on the same board without interfering with one another. I saw in other threads that usually you cannot run multiple tasks on the same board due to resource reservation errors (this is probably my issue?) but it was also mentioned that there is a way to accomplish this.
Is what I want to do possible? Or do I just have to use a second DAQ board?
(I'll include a snapshot of the block diagram of the secondary program I am trying to run)
08-14-2017 10:28 AM
It may depend on the card, but usually you can only have 1 task running at a time.
08-14-2017 10:50 AM
This will definitely depend on the card. I suggest contacting the manufacturer of the card, as it is a problem completely independent of LabVIEW.
08-14-2017 01:45 PM
@cswee wrote:
Since the main program is fairly complicated, I do not want to alter it in any way.
My comment is based on the above statement and the picture (grrr -- attach VIs, not pictures of VIs, please) that you attached.
If the "complexity" of the main program is due to having almost all of the code in a single VI, with Stacked Frames and far too many wires traversing the landscape, I'd strongly recommend that you "start over" and begin developing your Main Program using good LabVIEW Design Principles (like using State Machines, multiple loops, encapsulating details in sub-VIs, keeping all of your Block Diagrams small enough to fit on a laptop screen (very simple to do with lots of sub-VIs to hide the Messy Details), and, of course, writing Documentation specifying what the code is supposed to do, ideally before you start coding, and trying to "leave until a later sub-VI" as many details on how you do it as practical.
Taking data from multiple devices simultaneously is not difficult if the code is designed in such a way as to have some flexibility.
For more suggestions without guesswork, compress the folder containing your existing LabVIEW Project and attach the resulting .zip file.
Bob Schor