11-09-2021 03:40 PM
Hello Everyone,
I am trying to implement a simple python based code into the LabVIEW,
Once the value in a graph hits the threshold level then immediately the value dropped to zero (or based on the defined value).
Now in implementation, it works fine but the graph line didn't come to zero immediately and created a slight slope, Also the other thing is the when it hits the threshold one time then the line in the graph didn't increase again.
Here is my current implementation,
here is the python code output which I am trying to implement,
Looking for your suggestions,
Solved! Go to Solution.
11-09-2021 06:56 PM
Sorry, I don't have LabVIEW 2021, so all I can see is the picture of the snippet. Feel free to "save for previous" and attach the VI instead.
Why do you think that you need to generate the same ramp with every iteration of the FOR loop. Wouldn't once before the loop be sufficient? (OTOH, you only generate the noise once, so it will always be the same for 100 iterations. You can combine the two FOR loops into one, right?
I think all you need is the while loop and a chart, nothing else.
11-10-2021 03:24 AM
here is the previous version snippet. also, the VI attached,
The addition function will be performed between each wave where every noise wave (small waves) will add and create the biggest waves if the small wave addition value is greater or equal to the threshold value.
In python, I am using an array function where I can add all those and perform a simple function for this but in LabVIEW, the structure makes me too confused however the results always impressed me because of its front end 😆
11-10-2021 01:05 PM
It might be easier to show is your working python code... 😉
You are generating a Gaussian, which has no similarity to what you show on your picture. Are you trying to chart the integral of the Gaussian. What determines the amplitude?
@sam67 wrote:
In python, I am using an array function where I can add all those and perform a simple function for this but in LabVIEW, the structure makes me too confused however the results always impressed me because of its front end 😆
This sentence makes no sense to me. You need to define all terms used (There are dozens of "array function"! What is a "simple function"! What LabVIEW "structure"?
Here's some simple code that generates something that looks similar to your picture. See if it can give you some ideas.
11-11-2021 04:57 AM
Thank you so much for your reply and positive response,
Sure, the python code is somehow updated but it gives a clear picture definitely,
Please find the attached python code file.
However, I am trying to understand the previously attached VI but I have a question regarding "Tau" value, if you'd don't mind could you please give me a big picture of how to come with this solution.
Thank you 😆
11-11-2021 11:31 AM
@sam67 wrote:
However, I am trying to understand the previously attached VI but I have a question regarding "Tau" value, if you'd don't mind could you please give me a big picture of how to come with this solution.
Your python code has no tau. (It does not even have squares and exponentials as in your snippet.)
Are you talking about the snippet that you have attached, or my VI? If you want to adjust the time constants, you can play with the increment. Explain what you mean by "big picture". Do you have a problem with the algorithm or with the LabVIEW implementation?
Can you write out the exact formula you are trying to implement? Do you have a link to a research paper?
11-15-2021 09:34 AM
Hello,
Once again thank you so much for your response and. support.
Sure, here is the formula which I am trying to implement,
11-29-2021 04:07 PM
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,
And here is my current output,
and the current implementation of the VI is attached,
Thanks
12-05-2021 03:06 PM
It's still a total mess. Your equal comparison will never (ever!) return TRUE because you are comparing floating point values from complicated formulas. Why are you naming controls such a V_t or I(t). Shouldn't they depend on time? Math looks all wrong!