04-12-2010 04:46 PM
On my check threshold state I am monitoring 30pressure(even no channels) and 30vacuum(odd no channels) AI from USB-6225. Only one channel at a time starting with pressure increases upto 30psi and goes to vacuum -16psi. Initially I had 30 boolean led indicators for each pressure and vaccum just to show the user when the pressure reaches the TOP XPSI. Then I thought I will use the boolean array instead having a case statement for 30 indicators. I wait for a particular channel (even no first) to go above 3psi and used threshold_peak_detect.vi to get the index of that channel. Then I monitored that particular channel and used slide indicator to display the user, and when the pressure reaches top XPSI pressure I wanted to lit the boolean indicator array for that particualr channel. First time around my loop it works but when I monitor the next channel for pressure it resets all the indicator in the array.
For eg first time channel 2 reaches 30psi I want to lit PS2 indicator to true and after some time when channel 4 reaches 30psi I want PS2 and PS3 true and so on. I thought if I use the shift register I would be able to do it. But obviously I am missing something. Please need some help.
Thanks
04-12-2010 04:58 PM
I think is the "Use default if unwired" option, wire all the cases.
04-12-2010 05:44 PM
04-12-2010 06:14 PM
romesh wrote:
Thanks for your reply. That did the trick. But now when I tried to test a particular sequence this is what happens. I first applied pressure on channel4 which lit the ps3 then I tried channel 0 which lit PS1 but now PS1 and PS4 are lit instead PS1 and PS3. It like the led value shifted.
Your statement does not make sense. You state channel 4 is ps3. So the ps number is one less than the channel number. So channel 0 would be ps -1, which probably doesn't exist. I would think if channel 0 is ps1, then channel 4 should be ps5. The ps should be one more than the channel number if channel numbers start with 0 and ps numbers start with 1.
Also, I don't think anyone here has a monitor the size of a room. Cut down the size of your block diagram to make it easier to read. Use subvi's. Your super large diagram makes it very difficult to read and understand, and not many people will want to help you because it takes too much time and effort to try to figure out what you are doing.
04-12-2010 11:58 PM
If I'm right, ps means pressure sensor, and the pressure sensors are the even numbers so ps1 = ch0 ps2 = ch1 ps3=ch4, but yes it's hard to debug your vi, and I need the hardware to run it, but when you index the array of the peaks, you just index one peak, what happend if there is more than 1 peak? try to copy just your algoritm and will be easier to track the error.
P.S. It is a good practice that all your code fits in one screen.
04-13-2010 06:27 PM
Thanks for all your help. I am learning labview and this is my first project. I went and read about sub VI and modified my block diagram. In the process of doing this I broke the functionality. Please need some help to fix it.
Ch 0 is ps1
ch1 is vs1
ch2 is ps2
ch3 is vs2 and so on.
Only one channel at a time will be pressurized. If multiple pressure occurs I check the count variable from threshold peak detect vi and stop the exectution.
1) Previously I used to read the card no from the index output of the threshold peak detect vi + 1 when the pressure reaches some threshold just to indicate the user that channel X is the channel I am sampling now. Now if I debug single stepping I see the correct card no but on the next loop around my card no is reset to 0. So instead of debugging when I run the program my card no is always 0.
2) As soon as I press start all my pressure and vaccum indicators greys out. Previously it used to be in off state and depending on the pressure threshold on particular channel that particular LED lits up.
3) vacuum flow rate is working but pressure flow rate calcualation is always 0.
Please need some help. Thanks
04-13-2010 06:43 PM
One thing I see right off the bat is that in your Check Threshold case, you have a True/False case where the terminal on the right side are set to "Use Default if Unwired". I don't use this setting except for stop buttons. You should uncheck that option and wire a value to it. I suspect the correct thing to do is to wire the Pressure Array input to the output when using vaccuum and the Vacuum Array input to the output when using pressure.
As for you other problems, this vi is too complex to troubleshoot without the hardware. I don't have any way making the pressure go up or down, or the vacuum either.
04-13-2010 11:09 PM
Thanks that fixed the LED for pressure/vacuum indicator issue. But still I dont see the card no update on the screen(it resets to 0 quick) and pressure flow rate. Vacuum flow rate works. Is it possible to use some control instead simulating from hardware. If so I can put together something to simulate it. Please let me know.
04-14-2010 10:41 AM
Have you tried tracing the execution flow (the light bulb) and putting probes at certain places? This should help you see what is going on and where the value is being reset to 0. That is how you troubleshoot a vi. You could replace your hardware code with a simple control to help troubleshoot.
04-14-2010 05:49 PM
I figured out all the issues and one thing I couldn't figure out is when I start the application If I use my mouse to click the proceed button on my initial screen, my application will popup an window and when the user press OK it will go to the main screen and the user has to press start button for data acquisition.
Instead using the mouse if I press enter from keyboard my application just directly jumps to data acquisition and skips the message box inbetween and the start button press. Why would it do that.
Thanks