09-29-2016 08:11 PM
Hi, I'm trying to fix this error. (201133) I originally only had one channel (flow sensor) in this code. Then I added one more channel and this is when I started getting the error. It takes several minutes but my readings just go out of control. When I abort I get the error message.
According to what I have read already it has something to do with the NI 9401 module that I use. I believe I need to reserve the channels or something like that. (I'm lost at that point) With the code I have what would be the most efficient way to resolve this issue? Or is a complete code change required?
The code watches flow sensors and adjusts pump speeds according to flow presets.
Hardware:
cDAQ-9178
NI 9401 slot 1
NI 9265 slot 3
Program values (fill in):
Sensor K-Factor = 500
Fluid sp. gr. = 1
Fluid sp. gr. = 1
Pump 1 flow rate = .050
Pump 2 flow rate = .100
(90-200Hz square wave 5vTTL can simulate the sensors)
Thanks for your time.
Ryan
Solved! Go to Solution.
09-30-2016 01:37 AM - edited 09-30-2016 01:42 AM
Hi ry,
one VI with 8 DAQAssistent ExpressVIs and NO error handling at all…
Two recommendations:
- Configure the DAQAssistents to support two channels instead of just one…
- Read this knowledge base and get rid of all those DAQAssistents!
More (unrelated) recommendation:
- Always use UNIQUE labels for controls/indicators! In a text-based programming language you would never use the same name for several variables…
- What's the purpose of the sequence? THINK DATAFLOW!
09-30-2016 09:18 AM
-Ok I could configure the DAQAssistant for two channels. The only issue I had with that was I couldn't configure a different physical port. I could add all the channels I wanted but the assistant wanted all of them to go through one port. (PFI1) How can I add a channel and change the physical port in DAQAssistant?
-Don't understand your "no error handling" there is a simple error handler at the end?
-I added numbers to the end of my text labels to help differentiate between them. I was unaware labels on the front panel although the same would affect the code. I thought they were separate?
-I tried your link but it is broken.
The reasoning behind the logic of the code is as follows;
The first frame sends a 12mA current to the motor controllers to start the motors. This will produce a pulse train from the flow sensors. (fluid flow) If I don't do this the code in the second frame will just sit there waiting. (no pulses) The third frame sends a 4mA current to the motor controllers to shut the motors down when I hit the stop button. (Without this the motors will just run continuously at the speed last determined by the PID controller.)
Ryan
10-01-2016 01:39 AM - edited 10-01-2016 01:43 AM
Hi ry,
sorry for the broken link…
How can I add a channel and change the physical port in DAQAssistant?
This is only supported for some selected devices…
I thought they were separate?
All those indicators have identical labels. This is just bad coding style and can lead to confusion once you start to use property nodes!
Don't understand your "no error handling" there is a simple error handler at the end?
That's not error "handling", it's just error "display". To handle errors you would react on them in the loop…
The reasoning behind the logic of the code is as follows
The reason for my question is: you don't need that sequence structure at all. THINK DATAFLOW!
10-02-2016 08:47 PM
Okay I've decided to abandon the DAQAssistant for this one. I will try to avoid identical label names. I have changed the code and hopefully have addressed the error handling issue. I also have tried to get my head wrapped around Labviews dataflow. I believe what I have now will work for the inital motor start (get the flow meter moving) and shut down sequence before and after the main loop.
I'll try to update the code again this time with another channel added.
Ryan
10-04-2016 11:45 AM
Ok I have added the second channel. I had to remove the implicit timer. (Having issues, I'll read up on that) Question I have is; without the implicit timer is the acqusition (Frequency) being calculated by a hardware or software based clock?
The following code seems stable and does what I want. It's also easy on my cpu, based on the windows performance monitor.
Ryan