Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant error handling

I am using 9178 chassis to run several cards, including NI9213 to read several thermal couples in one execution. I have put reading/writing each card in separated sequences to avoid conflicts. One sample on demand was selected for each card. I have test the program in 2 second while loop for robust. I am expecting errors, so I have wired the error of each DAQ assistant error output to a case structure. Log the error if there is one in the case structure. 

It works in NI9421, if the data was not obtained after timeout, and an error message was logged. NI9421 was passed, the program moves to next sequence. However, it didn't work with NI9213 when error happens. The program just stuck in there, a message appears on the window. I have to stop the program manually and an error message was logged afterward. Here is the error message:

NI9213Error -88708 occurred at Test7.vi:Instance:1:1

Possible reason(s):

The specified resource is not available. The operation could not be completed as specified.

Task Name: _unnamedTask<20>

 

My first question, what could be the reason of error with NI9213? The card is quite straight forward, reading data. I chose one sample on demand (5 channels simultaneously). The cards ran in 2s a loop for almost 3 days until it was stuck You can calculate how many times the card ran without a problem. So I wonder where the error come at last. I didn't wire thermal couples though, so the temperature readings were ridiculous high, I am not sure this is a possible reason, but I doubt it.

Another question is why NI9213 was not passed out as NI9421 when error happens. How to let it pass, log the error and moves to next sequence? Set a timeout value? I think there should be a default timeout value.

 

Thanks 

 

 

0 Kudos
Message 1 of 9
(4,424 Views)

Hi hrwang,

 

I'm having a little bit of trouble understanding why you are expecting errors.  Could you please clarify a little further.  Also, screen shots would be helpful to see whats going on in your program!

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 2 of 9
(4,406 Views)

Thanks for reply. Unfortunately, I didn't write down the information on the screen, but I did wire the error message and logged it to a txt file, which showed in my original message. I hope that helps. Anyway, the error happened randomly, after the loop being executed thousands of times. I hope some one can help me to figure out what's wrong and how can I avoid it, from the error message I got.

Another question is, the program stuck on the DAQ assistant where an error occurred. I wonder if there is a way to pass that DAQ and finish the other sequences in the loop if that DAQ has an error. I have another sequence that controls a high power heater, I don't want the heater hang on there before some one has to terminate the program manually. It just like a frequency counter I had in one of the sequences, if a frequency wasn't read before time out, it generate an error, which is fine, and simply passes a 0 frequency and program moves on to next sequence.

 

Thanks. 

0 Kudos
Message 3 of 9
(4,394 Views)

If I remember correctly, the window shot has the same message shown in my error log. I had quite some DAQ assistants to control several modules. But I put each of the DAQ assistance in an individual sequence to avoid the conflications among them. That is the control loop. I have anther parallel loop, call it writing loop, which operates some of the values, such as writing temperatures to a file or ploting them. There is no DAQ in this loop. However, I use local variables to get the values from the control loop to writing loop. There could be a time that DAQ was tring to update temperatures in my first loop, while the writing loop is trying to read the same varible. But I think, since it is just writing or reading the memory, one can wait for the other to finish. Although I am not sure.

0 Kudos
Message 4 of 9
(4,391 Views)

Since you have not posted the code or a snippet of your code I am doing a guess. The NI 9213 error says that the resourse is not available this means that you have used the task and have not cleared it and you are again trying to read the AI values with the same task (may be with different channels). So attach a code for better solution

 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 9
(4,378 Views)

Sorry, my bad. See code attached.

Again, how can I make a DAQ terminate the task when there error occures? I thought if I put error message to a case structure as I did in the code, the task can be terminated.

 

Thanks.

0 Kudos
Message 6 of 9
(4,373 Views)

I also put each of DAQ into a separate sequence to avoid potential confliction among modules. I was really suppressed that its the thermocouple module went wrong. It has a very easy task, read 5 TCs (one sample on demand) and close the task.

 

Thanks,

0 Kudos
Message 7 of 9
(4,369 Views)

Its pretty tough to understand your code and it needs a lot of time. If you want do a better coding style I would suggest you to go for the low level vi's and then use sub vi with different state to create a task for the AI, AO, DI, DO and the in another state read the values from AI and DI and send data in another state to DO and AO and finally in a state clear the task and close the DAQ. I can be sure that the present code with DAQ mx will bring lot of issue in the future just right click and convert that into low level code. Since in the present code its tough to check which one is doing what.

 

Good luck.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 9
(4,363 Views)

Thanks for help. Since I am pretty new to Labview, I only know how to use no-brainer DAQ assistant to configurate my tasks. I have  no idea how the DAQ assistant close the task if error happens. 

Therefore, in order to avoid potential conflications, I made each of DAQ assistant in a separate sequence. Anyway, the temperature reading sequence is quite straight forward, I don't have another temperature reading DAQ assistant, however, I set the temperature output indicator local variables, did something like math operations, writing to the file in another while loop. Could that be a potential risk, like I said, DAQ assistant write the tempratures in memory buffer, and the other operations might want to access that buffer or re-write it. If both request happens same time, one of them should fail. But I doubt my hopothesis, because cpu operation is a single process, and writing to memory takes much shorter time than DAQ assistant timeout. DAQ assistant can wait for other writings to finish.

Anyway, thanks and have a nice weekend.

0 Kudos
Message 9 of 9
(4,359 Views)