LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Code -50150 from DAQmx Create Channel (AI-Voltage-Basic).vi

I have an executable, built from Labview 7.1 VI's. All it is doing is reading 6 voltages back from a 6008 USB-DAQ, and reporting the results back. Occasionally, it is throwing an Error -50150 from DAQmx Create Channel (AI-Voltage-Basic).vi. The full error message is:
 

Error Code: -50150

DAQmx Create Channel (AI-Voltage-Basic).vi<append>

<B>Task Name: </B>_unnamedTask<0>

 

Can anyone shed some light on this problem?

 

Cheers.

0 Kudos
Message 1 of 10
(3,951 Views)

Hi Neilelph,

What version of DAQmx are you using?

Emma R

NIUK & Ireland

 

0 Kudos
Message 2 of 10
(3,935 Views)

Version 7.5

 

Thanks.

  Neil.

0 Kudos
Message 3 of 10
(3,931 Views)

Hi Neil,

Do you have access to the code? If so can you Post the relevent section - containing AI-Voltage-Basic.vi?

You say that the error 50150 occurs occasionally, can you get it to error on purpose? how? does it error when you enter a certain value or perform a particular task?

Thanks

Emma R

NIUK & Ireland

0 Kudos
Message 4 of 10
(3,928 Views)

Hi.

I can't replicate the problem or force the error at all. I only see the error code in the database where the results are saved, and an email is also automatically sent to me with the entire error message.

I've attached the code for yo to have a look at (minus a couple of sub VI's)

Cheers.

  Neil.

0 Kudos
Message 5 of 10
(3,927 Views)
Hi Neil,
 
I cannot run your full code without the subVIs.
However, having edited your code so that I only have the voltage acquisitions, I can run your code without error.
I am attaching the segment I have been running to this email.
Can you run it continuously and see if you get your random error?
If you do not, that would suggest that your error is being caused somewhere else in your code ie maybe in one of your subVIs.
 
Emma R
NIUK & Ireland
0 Kudos
Message 6 of 10
(3,893 Views)

Apologies. Didn't notice a sub vi was missing.

All the missing Sub vi does, is returns the time and date.

The code you posted is not quite the same as what I am doing - I only run the code you posted once, then quit the application, then do the same at regular intervals. This is controlled using the PC Task manager. Your code will just cycle until the stop button is pressed.

Perhaps you can try your testing on the code attached using your PC Task Manager to run it every 30 seconds, for example (you may have to build the code into an executable first). I'll try tesing with the code you posted to see if the error can be produced without quitting the app at the end.

Just curious, but does the error code -50150 not mean anything?

Incidentally, the VI's that I removed from the code, just send an email out if an error occurs - the DAQmx code is run before any other Sub VI's and so the error can't be emanating from them (given that the app is killed, and then re-started afresh for the next cycle)

Thanks.

  Neil.

 

0 Kudos
Message 7 of 10
(3,888 Views)
Hi Neil,
 
The code -50150 means that you have entered an underfined state.
It's due to the fact that you're opening and closing your application continuously. The application probably isn't closing properly some times and then when it tries to reopen that's when it goes into this undefined state and the error comes up.
 
I noted that within your code you do not actual start or stop the task VIs.
I have attached a different version of your code which has these and does all 6 aquisitions in one go rather than one at a time, which is a more efficient.
 
I have left enogh space for you to insert your email generating VIs marked by a text box.
 
Can you try running this code and see if this works.
 
Also I would suggest using something like a state machine rather than opening an closing your task. This way the task is always open in the background but only aquires at set intervals.
 
Hope this helps you
 
Emma R
NIKU & Ireland
 
 
0 Kudos
Message 8 of 10
(3,877 Views)
Thanks for your help on this. It's much appreciated.
 
The code used to work in a timed loop rather than opening and closing the app, but I felt it was better to use the Task Manager - I may go back to timed loop as you suggest.
 
The multiple channel acquisition is better way of doing things - thanks for that.
 
Incidentally the Clear task 'help' claims that this VI also stops the task, but I'll put the Stop Tasks in also to see if this helps.
 
Thanks again.
  Neil.
 
 
0 Kudos
Message 9 of 10
(3,865 Views)

Hi fellas,

 

I have a really similar problem to the one Neilelph had, but I can´t see how to solve it from your answers. I attached a picture of my main .VI.

 

It´s basically a photodiode measurment system working as follows:

 

1. First the moving stages for the system get ready (X-Y moving stages for the Photodiode and Z stage for the Laser). That´s the CONFIG subVI in the left.

 

2. Then there is a For Loop, that repeats N times depending on the Initial Z, final Z and step values. So in this .VI the laser moving stage is the only one changing.

 

3. In each loop, the stages go to the X,Y,Z(t) posiition (MOV subVI), wait for the movement (WAIT subVI) and read the position. After that, the DAQmx acquistion part starts. I just sample the output DC voltage coming from the  Photodiode (Dev1/ao1), 1000 samples in 1 second, and then I make an average of all of them with the Basic DC/rms block. So at the end I have 1 position of Z and one DC value. And it worked perfectly. At least for small number of iterations I have no problems. 

 

 

The problem comes with small steps and a great number of iterations. For example last night I ran a measurement. 10000 iterations, the whole range of Z, and today i checked it. It worked fine until 5000 give or take, the half of the range. From that point, the DC ouput recorded in the .lvm file is just 0.00000. It´s the second time it happens, so I´m wondering what´s wrong because I´m affraid to make more long measurments and obtain the same results. 

 

The error message I obtained is the same than in the thread title: -50150  DAQmx Create Channel (AI-Voltage-Basic).vi:6<append> <B>Task Name: </B>_unnamedTask<53BC>

 

Maybe it would be useful to mention that, sometimes, there is no error and I have some DC Output Voltage value, for random Z potitions, but since the first error message, that barely happens. The output is almost always 0.

 

 

Sorry for my writting skills in English. I hope you can understand my situation.

 

Thank you in advance.

 

Kind regards,

frilance.

 

0 Kudos
Message 10 of 10
(3,067 Views)