12-01-2020 08:12 AM
I was searching how to display multiple plots on a single chart and came across this thread.
@altenbach provided a neat solution to program chart characteristics, which I have used in my VI. But the chart doesn't update. It changes only when I check/uncheck one of the plots or when I click on clear.
Even the stop button doesn't function when the event structure is in the VI and I have to click on Abort Execution.
Can anyone please explain to me what is going on?
Solved! Go to Solution.
12-01-2020 09:20 AM
The event structure waits for an event. Your loop will once per event.
Add a timeout case to the event structure.
Wire that a constant (<<1000) to the timeout terminal of the event structure.
12-01-2020 11:29 AM
Get rid of the event structure. Since you are spinning the loop anyway, you can just poll these buttons and activate certain code based on controls (use simple case structure with the FALSE case empty).
.I would recommend NOT to use the timeout case, because it will interfere with your loop timing.
You can get rid of the "select channels control". Just show the visibility checkbox. No code needed.
I would probably place the event structure in a parallel loop.
There are plenty of problematic issues in your code. Let me look at it.
12-01-2020 11:58 AM
@altenbach wrote:
I would probably place the event structure in a parallel loop.
There are plenty of problematic issues in your code. Let me look at it.
Here are some comments:
(Also never maximize the front panel and diagram to the screen. Makes it hard to debug)
12-01-2020 02:50 PM
(Also never maximize the front panel and diagram to the screen. Makes it hard to debug)
Thank you for the comments @altenbach.
I did not understand what you mean by do not maximize the front panel and diagram to the screen. I didn't do this! Or may be I did and do not what the correct terminology is.
12-01-2020 03:59 PM
@girish_jadhav wrote:
I did not understand what you mean by do not maximize the front panel and diagram to the screen. I didn't do this! Or may be I did and do not what the correct terminology is.
When I open your main.vi, the front panel fills my entire 2560x1440 screen. Same for your diagram. I am not sure why that is, but my own VIs never do that. This makes it difficult to e.g. look at the help while editing. You would constantly need to switch between windows and lose focus. A gigantic diagram windows also promotes sloppy, oversized code.
Can you explain your use of the integration and what you are expecting from it.
12-02-2020 08:06 AM
@altenbach wrote:
@girish_jadhav wrote:
I did not understand what you mean by do not maximize the front panel and diagram to the screen. I didn't do this! Or may be I did and do not what the correct terminology is.
When I open your main.vi, the front panel fills my entire 2560x1440 screen. Same for your diagram. I am not sure why that is, but my own VIs never do that. This makes it difficult to e.g. look at the help while editing. You would constantly need to switch between windows and lose focus. A gigantic diagram windows also promotes sloppy, oversized code.
Can you explain your use of the integration and what you are expecting from it.
I wanted to calculate E = P * t and used the integration. But I see my mistake now as it just displays whatever the power value is being read from the digital power meter. I think it is better if I log all these data and later calculate the energy consumed.
12-02-2020 09:12 AM
@girish_jadhav wrote:
I wanted to calculate E = P * t and used the integration. But I see my mistake now as it just displays whatever the power value is being read from the digital power meter. I think it is better if I log all these data and later calculate the energy consumed.
As I mentioned, maybe Integral x(t) PtByPt VI would work.
12-02-2020 09:22 AM
@altenbach wrote:
@girish_jadhav wrote:
I wanted to calculate E = P * t and used the integration. But I see my mistake now as it just displays whatever the power value is being read from the digital power meter. I think it is better if I log all these data and later calculate the energy consumed.
As I mentioned, maybe Integral x(t) PtByPt VI would work.
I will try that method (y)
12-08-2020 07:57 AM
@girish_jadhav wrote:
(Also never maximize the front panel and diagram to the screen. Makes it hard to debug)
Thank you for the comments @altenbach.
I did not understand what you mean by do not maximize the front panel and diagram to the screen. I didn't do this! Or may be I did and do not what the correct terminology is.
I have one more question. Why did you add clear and stop control for the event? I removed stop and I don't see any changes.