12-16-2024 04:20 PM
I am getting this error
The source of this error is coming a cloneable instance of my Card module in DQMH.
The above screenshot is the front panel for the DO card (Card Module with Module ID = 2).
Here is the RQST Stop Card Event that has the Stop Task call which is causing the error
The task is getting started in another case called RQST Start Card which is here
Here is that START CARD VI
Here's the True case. The True case is used in another module where there is a Timed Loop that should start this task automatically so the start task VI has been removed from there.
I'm pretty sure the task is being created but I'm not sure if it's being done correctly so from the error message I'd guess that there is something invalid with the task rather than it not existing. Also the timing for that task should be using the sample clock from the AI card as shown here
That timing source OUT gets fed into a timed while loop here which should start all the tasks for all the cards after the all get stopped first
The cards are being started for continuous samples when the PXIe-8861 controller starts up then when the real time model starts, the cards all get stopped, then started again except for in hardware timed single point for the cards that allow it.
Is there something wrong with the way I'm setting up the DO card or is it something else in my code?
Solved! Go to Solution.
12-17-2024 10:09 AM
This is one of the reasons that I recommend creating your Task in the project. Just use the DAQmx Wizard and test the Task during development. Then, at runtime, simply control the Task. Nothing can go wrong that you didn't resolve during development and Unit Testing for the DAQmx IO operation. The lvproj will contain all of the Task stuff in xml format that is human readable in any text editor. Bonus, your build output will automagically convert the DAQmx stuff into a ini format configuration file for you in a NI DAQ folder (which can also be edited AFTER being deployed if you need to adjust some stuff)
I don't know how many times I've seen developers waste time trying to rewrite existing DAQmx features that just plain work correctly and conveniently right out of the box.
12-17-2024 10:17 AM
I'm not sure exactly why this got rid of that error but I stopped and cleared the DO task in the CLOSE MODEL VI and it's no longer there. Before I was just stopping and clearing the AI, Bridge Input, and AO tasks. I haven't thought to create a task in the project so I might look into seeing if this would be a better approach. Thanks!