Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub Vi problem with Selecting Signals

I have Windows XP, Labview 7.0, a PCI-6034E card, and a CB-68LP pinout board.  I am currently using this to collect temperature readings over a time period of a couple of days.  I want to add into my program an indicator such that if the temperature changes "x" amount it will tell me.  Because I'm not goign to be staring at the computer screen for a long time I need the indicator to come on and stay on.  I have figured out how to do it for 1 signal but it gets confused if I try more than that.  It could be the way that it is wired that is causing the problem.  Attached should be 2 files, the SubBlockDiagram and the MainBlockDiagram.  The sub vi basically takes in one signal and sends it down two paths.  The one path is delayed a certain amount of time and then the two paths are subtracted so that if there was a sudden jump in temperature it would show up as a large number.  Comparing it to some threshold value (how large the spread), it will either turn on a switch or not turn on a switch.  If the switch is turned on it will send data to a graph whereas no data is sent to the graph when the switch is off.  The problem occurs when I try and add in several of these sub Vi's as indicated in the MainBlockDiagram.  When I select different signals (Selected Waveforms) the sub Vi compares the one signal versus the other instead of comparing a delay signal 1 versus a non-delayed signal1.  Do I have to create separate sub Vi's for this or am I doing something wrong?  Any help would be greatly appreciated.  Thanks.

Bill
Download All
0 Kudos
Message 1 of 4
(3,001 Views)
Have you made your sub vi's 'reentrant'??
0 Kudos
Message 2 of 4
(2,987 Views)
I have not made my sub Vi's reentrant, in fact I didn't know what that meant.  I looked it up and made my sub Vi's reentrant which seemed to solve that problem.  The only other thing that I did which seemed to be useful was move the Relay from the Sub Vi to the Main Vi so that it would switch on when an individual signal read a spike in temperature instead of when all signals read a spike in temperature.  I thought it would work either way but the with it on the Main Vi seems to work best.  The PCI card seems to be malfunctioning so I havent had time to perfect it.  Thanks for your help.
0 Kudos
Message 3 of 4
(2,968 Views)

This link has a good discussion on reentrancy and must help you understand it

Read the post where Greg Mckaskle explains when to use reentrancy

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