Jump to content

help- subvi usuage


Recommended Posts

when the subvi run by itself seperately, it can give me the right answer.

But when I use it as a subvi in the main vi, it can not give the same answer.

My program is check the number of the peak of a graph. The vi runs well. But if I made it as a subvi, it can not give the same performance.

Anyone can give me a hint to trace it? I have worked for it more than two days. :throwpc:

Thanks.

Link to comment
Which one is it? Bad performance or wrong answer?

Are the values (on the inputs) going into the VI the same as when the VI is run by itself?

No input.

this subvi gets data from DCA (a broadband oscilloscope), analysis the graph, give the peak number as output.

So for the same graph, the output should be the same either I run tha main vi to get the peak number from this subvi's output, or I run the subvi as a independent vi program.

Also at the beginning of this subvi, I cleared the buffer of the DCA. So it should not be a problem.

I will try to paste the program later. but the pc with labview have no access to Internet. I will print the screen and copy it here later.

Thank you so much for your quick response.

Link to comment
when the subvi run by itself seperately, it can give me the right answer.

But when I use it as a subvi in the main vi, it can not give the same answer.

My program is check the number of the peak of a graph. The vi runs well. But if I made it as a subvi, it can not give the same performance.

Anyone can give me a hint to trace it? I have worked for it more than two days. :throwpc:

Thanks.

Are you sure the problem is with the subVI or is something else in your application hogging resources that the subVI uses (like hogging the cpu, etc)??

Link to comment

post-24540-0-97973100-1306404950_thumb.j

Would you rather try to send the VIs themselves. Copy it to memory stick, CD, disk or what ever and upload it here. It's much easier to troubleshoot real program that just an image of it.

histogram is the subvi.

when using as a subvi in getstoppoint, the peak number never reach to 2, always 1.

histogram is the subvi.

when using as a subvi in getstoppoint, the peak number never reach to 2, always 1.

post-7403-1167876581.jpg?width=400

post-7403-1167876659.jpg?width=400

Link to comment
histogram is the subvi.

when using as a subvi in getstoppoint, the peak number never reach to 2, always 1.

I have found out the problem.

I have not reset the histogram function. So when the subvi is called, it remember the history value and gives the wrong histogram distribution.

After I have set the True as default value for the reset item of histogram input, it is solved.

thanks everyone.

Link to comment
I have found out the problem.

I have not reset the histogram function. So when the subvi is called, it remember the history value and gives the wrong histogram distribution.

After I have set the True as default value for the reset item of histogram input, it is solved.

thanks everyone.

Good you solved it,

I had a look at your program, if you reset the histogram function, why do you run the measurement twice?

If you need that for some reason, but only use the histogram function at the last run, put it outside the for-loop.

Ton

Link to comment
I have found out the problem.

I have not reset the histogram function. So when the subvi is called, it remember the history value and gives the wrong histogram distribution.

After I have set the True as default value for the reset item of histogram input, it is solved.

thanks everyone.

Lesson:

Pay attention to the data stored in the buffer.

Do clear buffer for device you acquired data from.

Patience, patience and hard work.

Good you solved it,

I had a look at your program, if you reset the histogram function, why do you run the measurement twice?

If you need that for some reason, but only use the histogram function at the last run, put it outside the for-loop.

Ton

Yes. I will take your suggestion. Set the reset is true outside the loop. Inside the loop, reset is fault.

Thank you so much, Ton.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.