From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge two VI’s into one

Solved!
Go to solution

I have been studying and experimenting for a while now trying to get these two working VI’s merged into one.  Any help would be greatly appreciated.  I’m new to lab view and experimenting with a cDAQ-9172 Chassis and a NI 9205 analog input module plugged in.  The Pressure VI measures the pressure from 5 pressure sensors and the Analog count VI just counts how many times a reed switch is cycled from on to off and writes the time stamp to file.  Seams fairly simple but I want them all in one VI so I can run them at the same time.  Basically I have 5 air pumps with the pressure sensors attached and I want to count how many times during the day a door is open to the pump enclosure.  Thank you for any help or ideas.

Download All
0 Kudos
Message 1 of 4
(2,699 Views)
Solution
Accepted by topic author cdteo

Your Analog Counter VI creates a DAQ task asking to reserve the hardware to read analog 5.  The chassis is reserved and because there exists only one clock this is the only task that can be running until it finishes.  In Pressure.VI you are creating a task where you try to read AI0 through 4, asking to reserve the chassis.  But you can't because it is already reserved.

 

A few pointers.

 

Move away from dynamic data types.  

Move away from express VIs. 

Create the DAQ task once. 

Setup explicit timing and command the Start instead of just Read.

Use DAQmx scales instead of hardcoding it

Don't view terminals as icons.

Add some delay into your loops so they don't take 100% CPU usage.

 

EDIT:

Also here are some training materials if you are interested

 

3 Hour Introduction http://www.ni.com/white-paper/5243/en/

6 Hour Introduction http://www.ni.com/white-paper/5241/en/

LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/

Self Paced training for students http://www.ni.com/academic/students/learn/

Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/main.xhtml

LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_Links

0 Kudos
Message 2 of 4
(2,669 Views)

Thank you! I did get the VI to work using one DAQ task for all 5 channels I still did my scales outside of the DAQ (mainly just becuase I have to tweek the numbers once I get it all installed).  I just need to put some sort of delay in the loop.

0 Kudos
Message 3 of 4
(2,631 Views)
The reason I use DAQ scales is because it allows you to change the scale using MAX and not need to make a new EXE.
Message 4 of 4
(2,617 Views)