LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for suggestion on mV graph output

Hello everyone,

 

Here is the output with positive voltage value (0-1),

sam67_0-1637947865482.png

 

But when I am trying to change the graph values to negative (mV) values that time output was stuck on static, here is the output,

sam67_1-1637948012315.png

 

Attached is my current VI. 

 

Please let me know how I can use mV or negative voltage values in a graph.

 

Looking forward to hearing from you, 

 

 

0 Kudos
Message 1 of 19
(1,749 Views)

Hi sam,

 

did you do any of those "Training resources" offered at the top of the LabVIEW board?

 

Why are there only local variables in that loop?

Why are ALL terminals unused left of that loop?

Why is that "Graph" a control, when it should be an indicator?

Why did you name that "Graph" even though it is a chart? Do you know the difference between graphs and charts?

Why did you maximize the windows to full screen? This is very annoying, especially when opening your VI on a computer with a smaller screen!

Why do you compare a float value with integer "i" in the inner while loop? Why is "Sleep time" a float value at all? Why is it called "Sleep time" when there is no timing involved with that value?

Why do you compare the calculated result with "Reset" for equality? Do you know the problems of comparing floats for equality?

Why does that inner while loop run as fast as possible?

Why is there no stop button in the outer loop? How will you ever stop your program?

Why does that formula on the frontpanel mention the values "V", "C" and "I", but they don't appear in the blockdiagram?

 

Usually I assume the person who created a program thought about what and how to code: when I don't understand the code I ask all those "Why…" questions…

 

See this:

(Some, but not all issues addressed.)


@sam67 wrote:

But when I am trying to change the graph values to negative (mV) values that time output was stuck on static, here is the output,

 

Please let me know how I can use mV or negative voltage values in a graph.


Maybe you should debug your VI and implement the correct behaviour…

(Really: when you don't get the expected result then either your expectation or the implementation is wrong!)

 

Btw. using the VI shown above I got this result:

Surely some samples in the "mV" range and surely some negative values in between…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
Message 2 of 19
(1,733 Views)

@sam67 wrote:

Attached is my current VI. 

Please let me know how I can use mV or negative voltage values in a graph.


As has been said, never ever create an oversized VI front panel like that. On my laptop, I cannot see the windows title bar and the VI is completely covering the windows task bar and start menu, making it unreachable. All I can do is ctrl+w to close this VI. Very (very!!!) annoying!!!!

 

All your front panel needs are neatly arranged controls and indicators and a panel size sufficient to show them. Don't micromanage things with splitters and decorations etc. You can do that as the final step once the Vi is fully debugged and working.

 

If you discuss two version, one working and one not working, you should attach both or at least tell us HOW you are introducing a negative voltage (not clear at all!!!) and what changes if you do. Did you attach the working or non-working version?

 

You already got plenty of excellent advice, so I won't repeat it all. Remember, in LabVIEW "the wire is the variable" and that's where the data lives. Terminals are just for the UI (take user input and display results, etc.). None of your local variable are needed. This is not text base code where the data is carried in "variables". That's completely different!

 

On a side note, I would recommend to initialize the shift register (I assume you know what I mean by that, right?)

 

 

Note: Obviously, it helps to link to related discussions for context!

Message 3 of 19
(1,676 Views)

Hello, Thank you for the suggestions and definitely I will care about the size and other important factors while uploading on the LabVIEW community platform. 

 

And definitely, it helps and from now I will try to stick to the same question as mentioned above unless a. different problem needs to discuss. 

 

0 Kudos
Message 4 of 19
(1,660 Views)

Hello and thanks for your advice and I tried to follow your suggestion but still, I am stuck on somehow somewhere, 

 

based on previous suggestions (referred to the other thread) I tried to implement the same formula but still don't know why chart values are stuck when I am using Y-Axis values from. -70 to -50 (mV). Could you please suggest where the problem is and what possible method can help me to figure out the issue?

 

here is the output which I am trying to achieve, 

sam67_0-1638278939587.png

 

 

 

And here is my current output,

sam67_1-1638278939928.png

 

 

and the current implementation of the VI is attached,

 

Thanks

0 Kudos
Message 5 of 19
(1,629 Views)

Hi sam,

 

why do you think it's a good idea to show a downsized blurry image to explain your problem?

All I can recognize from that image is: the plots in the chart seem to change - in contrast to your problem of "values are stuck"...

 


@sam67 wrote:

based on previous suggestions (referred to the other thread) I tried to implement the same formula but still don't know why chart values are stuck when I am using Y-Axis values from. -70 to -50 (mV). Could you please suggest where the problem is and what possible method can help me to figure out the issue?

As far as I can tell: your VI is doing exactly what you have programmed to do! Did you try to debug your VI using probes? Do you get expected values for all calculations done in your VI?

Are the implemented calculations exactly those you want to implement?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 19
(1,625 Views)

Hi again, 

 

Thanks for the comment, 

 

Well, I have not expected that the image was too blur but still, it is clear to see the static output of the chart, right? and mistakes can happen many times but definitely it will be considered next time carefully. And I hope this time it will not be blurred. 

 

sam67_3-1638286977631.png

 

 

Regarding implementation, Yes I tried to debug using breakpoints and observing the values using the "Blub icon on the top of the back panel vi" and it seems everything is working perfectly but somehow the values of I (t) effects the chart plot as it needs to be less or equal to 1. 

 

 

 

0 Kudos
Message 7 of 19
(1,611 Views)

Hi sam,

 


@sam67 wrote:

Well, I have not expected that the image was too blur 


Well, you should have seen immediatly after posting…

 


@sam67 wrote:

Regarding implementation, Yes I tried to debug using breakpoints and observing the values using the "Blub icon on the top of the back panel vi" and it seems everything is working perfectly but somehow the values of I (t) effects the chart plot as it needs to be less or equal to 1. 


There are also probes to debug a VI.

 

Could you please write down the formula you actually implemented in your VI?

(So we can compare it with the formula given as comment in the block diagram!)

 


@sam67 wrote:

but somehow the values of I (t) effects the chart plot as it needs to be less or equal to 1. 


I agree: that's why I ask for the formula you implemented in your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 19
(1,606 Views)

Hi again, 

 

thank you so much for your support and comment, 

 

here is the formula/equation which I am trying to implement,

 

sam67_1-1638303112628.png

 

It is also added on my front panel which you asked about in your previous comments. 

 

FYI, The implementation is based on this logic, once the input hits the V(t) value it will immediately be set to E_L value, and a few milliseconds of static output is required where no input occurred. 

 

This is working perfectly but once I tried to change Y-Axis values to mV (negative). from positive values, the chart is stuck on static output. 

 

 

0 Kudos
Message 9 of 19
(1,592 Views)

Hi sam,

 


@sam67 wrote:

here is the formula/equation which I am trying to implement,

sam67_1-1638303112628.png


This is a differential equation - and not the formula you implemented in the VI.

You probably trying to solve that differential equation first, before implementing it in LabVIEW: please write down the formula you implemented in the VI!

 


@sam67 wrote:

FYI, The implementation is based on this logic, once the input hits the V(t) value it will immediately be set to E_L value, and a few milliseconds of static output is required where no input occurred. 


Can you write down some formulas for this sentence, too?

 


@sam67 wrote:

This is working perfectly but once I tried to change Y-Axis values to mV (negative). from positive values, the chart is stuck on static output. 


This makes no sense at all!

Changing the Y axis values of the chart does not change the algorithm you use to calculate those values! A chart is just an indicator, showing the values you calculate in your VI…

Btw. using negative values will result in (very) small values after that e^x function: did you use some probes in your VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 19
(1,588 Views)