Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I tried to solve the problems by the existing solution in this forum . I'm still getting Error 50405

Solved!
Go to solution

Dears,

 

I'm using USB -6009 to control pumps , valves, DO and two Mass Flow Control . Every two cycle i'm getting error 50405 . I tried to solve the problems by the existing solution in this forum but the error still showing every 2 cycle from operation . I'm attaching my completed VI for the expertise, wondering if its design issue ?. Attached screen shoot for the error . thank you.

Download All
0 Kudos
Message 1 of 10
(4,874 Views)
Solution
Accepted by topic author MESHA'AL

You certainly have some design issues.

 

The stacked sequence structure tends to create more problems than it solves. I have not used it in new programs since version 1.2 of LabVIEW (in 1989). A state machine is a much better choice of architecture.

 

Local variables can cause race conditions, extra data copies, slower performance, and hard to debug code. There are specific cases where they should be used, but those conditions are not in your code. Just wire directly from the control terminals to the places the data will be used.

 

My guess about the likely cause of your error is the use of multiple DAQ Assistants to perform the same task (with different data values) in each frame of the sequence structure. With the state machine arcitecture I suggested above you would only need one. The DAQ Assistant tries to be smart about configuring and closing tasks, but the different instances do not talk to each other, so they do not know when to release resources.  You  might be able to make it work if you used the standard DAQmx VIs as you did with the Digital Output task.  You do not wire the error out lines from the DAQ Assistants so you may be missing errors.

 

Unlabeled controls and indicators can be a troubleshooting nightmare. Please give each control and indicator a unique label. If you do not want the label visible on the front panel, you can use the control properties to hide it. If you want multiple controls to have the same text visible to the operator, use the Caption.

 

Learn to use subVIs. Most of the code in the 6 frames of the inner sequence structure is identical. By converting that to a subVI, you would reduce the size of the diagram drastically and if you ever needed to change that code, it would only need to be changed in one place - the subVI.

 

The while loop in frame 0 of the outer sequence structure is a "greedy" loop. It will run as fast as possible and grab all available CPU resources while waiting for the user to press a button. Put a Wait (ms) function in the loop with ~100 ms wait. Better, learn to use the Event Structure for User Input.

 

The second while loop inside the inner case structure does nothing and can be removed.

 

Many of these items hint that you have a programming background using text-based programming language.  LabVIEW uses a dataflow paradigm which largely eliminates the need for such things as the sequence structure and local variables. I recommend you work through the on-line tutorials on Getting Started with LabVIEW.

 

Lynn

0 Kudos
Message 2 of 10
(4,852 Views)
Hi Lynn,

Thank you very much for the detailed solution .
I'm modifying the design following your suggestion step by step . Will back to post the updated vi soon . Thank you.
0 Kudos
Message 3 of 10
(4,818 Views)

Hi Lynn,

 

"Thank you very much for the detailed solution .
I'm modifying the design following your suggestion step by step . Will back to post the updated vi soon . Thank you."

 

 :mansad:

 

I modified the vi as you suggested except some points which it's welcomed from expertise person such as you .
My aim is to solve the error in this vi which its cause critical interrupt to my experiment . As i have a basic knowledge in labview i made this vi to keep my planktons a live.

Your suggestion to remove the DAQ Assistants is powerful as it's gave me a time to let the experiment running for long period than before .

It's hard  to catch new planktons and replace it with new . However the same error showing up ,but after long running cycles .The error pointing on DAQmx Read (Analog DBL 1 channel 1 sample) !?. This analog input connected to Dissolved Oxygen Transmitter -Eutech Instruments (specification attached) .Which it's trigger a Mass flow controller . As you can see there is set point in each stage when the DO increased over the set point in water the MFC will open the gate allowing pass set quantity of gas .

 

Kindly for you suggestion and  support .

 

0 Kudos
Message 4 of 10
(4,745 Views)
Could someone help with suggestion ?
0 Kudos
Message 5 of 10
(4,660 Views)

That error (50405) on the DAQmx Read.vi might be related to a timeout. The DAQmx Read.vi has a default timeout of 10s. You can wire a -1 numeric constant to the timeout terminal from the vi and if the problem is that it is timming out, that should fix it. Please check the following document for additional information.

 

http://www.ni.com/example/31172/en/

Camilo V.
National Instruments
0 Kudos
Message 6 of 10
(4,621 Views)
Thank you very mush the error not showing it's running for unlimited cycle :). But 😞 the analog output dropped to zero after 5 cycle operation while it should be fixed as I can set the output voltage from the front panel . It's control Gas Flow through Analog 0-5 VDC ! Is the timeout.vi can fix it?.
0 Kudos
Message 7 of 10
(4,608 Views)

I want to ask you how did you find that your VI stops the output after 5 loops. I actually tested it today and I don't see the same behavior on my system.

 

Can you give me more details about this?

Camilo V.
National Instruments
0 Kudos
Message 8 of 10
(4,557 Views)

Thank you Cavarval and everybody who tried to solve my problem.

I changed the PC with another. Its working without interrupt now 🙂 . The problem was is the computer setting e.g. USB and its serves setting .

0 Kudos
Message 9 of 10
(4,439 Views)

Glad you got the problem solved.  USB devices can be very difficult because the OS sometimes shuts them down to conserve power. Jeff Bohrer has put together a list of things to do to deal with USB issues, specifically on Windows OS, but good advice in general.  I do not have a link but searching for USB shut down should find it.

 

Lynn

0 Kudos
Message 10 of 10
(4,431 Views)