From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-19-2016 05:25 AM
I keep saying it, but thank you very much to you all for your help. I would have never been to create such a VI without your help. And if my code look messy to you, I am a little bit proud of it 😄
so:
1) 500ms linked to the dequeue. done.
2) this is more or less answeed by 1)
3) hello confusion, my old friend! soooo, I get that I have an unreacheable piece of code (the case "0" in my third loop). What if I delete the case structure? would that solve?
Also you say: Acquire + Display and Log in the next loop. isn't that what I am already doing ? I dont get the hint here.
finaly, why should I use a write to delimiter ? Should I gather everything to an array then send it to that function?
Thabk you all !
(messy) Flo
12-19-2016 04:20 PM
Dear Messy (but I hope we are helping you become Neat),
I notice a huge structure in Controller v5 where you have about a dozen Floats that you convert into a string (a dozen times), then concatenate with commas between them.
Here's a suggestion:
Bob Schor
12-21-2016 08:13 AM
Re everyone !
I have worked a little bit more on my code. I also did my best to make it less messy. I think It's looking better now.
I have tried to take into account every suggestion here.
1st loop: should be done by now
2nd loop: I've added the DAQmx functions. As my real DAQ ins't plugged in right now, I've just copied the input of my DAQ asistant.
3rd loop: I've removed the case structure and added a way to average each colomn every minute (hence every ~120 iterations of the 2nd /3rd loop). this piece of code works well. I've tried it with simple data on a separate VI that I am keen to give away if anyone is iterested.
I've also added a way to save each new row generated every minute (or 120 iterations) to a text file.
Let me know what could go wrong? what's wrong? what's good maybe ?
Thank you all !
Flo
12-21-2016 10:08 AM - edited 12-21-2016 10:09 AM
Anyway, I see the improvement in your work, do not give it up, and use the online courses to learn further...
12-22-2016 04:41 AM
Thx Blokk,
1) will do
2) well...
3)I am still unsure about what this is, and how it would help me.
4)yeup, that's something I forgot. I will add that stpo button straight away!
5) done
6) So yeah, I may not be the best programmer in the world. but it does hte job.
My real concern here is that this array will eventually eat all my RAM. Do you have any way to prevent that ??
Thank you,
Flo
12-22-2016 07:31 AM - edited 12-22-2016 07:34 AM
@Flo-w wrote:
Thx Blokk,
1) will do
2) well...
3)I am still unsure about what this is, and how it would help me.
4)yeup, that's something I forgot. I will add that stpo button straight away!
5) done
6) So yeah, I may not be the best programmer in the world. but it does hte job.
My real concern here is that this array will eventually eat all my RAM. Do you have any way to prevent that ??
Thank you,
Flo
Type definied clusters are very useful things. I give a little example here to show you how to use them. First of all, drop an empty cluster on any Front Panel. After this, right click on it, and select: "Make Type Def.". Right click on this cluster control again, and select: "Open Type def.". Now an extra window opens where you can work with your new type definied cluster, lets add 3 elements to it just for this example (right click inside the empty cluster and browse out the required element from your palette):
Lets also customize the icon of this type def cluster control: double click on the icon at the top right corner, and change it to some descriptive, maybe some text. When you are done with this, save this "ctrl" file into your LV project folder (it should be added automatically to your opened project, or you can do this manually too). This type def cluster should look like this now, see it below. You see that a little black triangle appeared at the topleft corner visible in te BD? That triangle means that this is not a simple control, but a typedef control!
Why is this very useful in a LabVIEW project? Easy to use it with the "Bundle by name" and "unbundle by name" functions. Even more important is the following: imagine, you use this typedef control at many places in your code. What about if one day you need to extend your code?? For example, if you need to add one more serial com to your measurement. If you do not use a typedef control, you have to search for EVERY instances in your code where you used that non-typdef cluster, and manually change ALL. But if you use a type def, you only need to right click on a SINGLE instance of such typdef control, open up the saved CTRL file ("Open type def."), and modify it as you need. After saving the modification, ALL of its instances in the block diagram will be updated at once! You see how much better this?
I attach a sample project zipped up, do not run the main VI, it is just for experimentation how you can add/remove elements from this typedef cluster (hint--> when you drop a typdef cluster into a VI, you can quickly change between control/indicator/constant types using right click):
My real concern here is that this array will eventually eat all my RAM. Do you have any way to prevent that ??
You should not build these arrays indefinitelly. You could use Charts instead of Graphs, Charts have "memory", by default they can show up to 1024 data points. So if you use Charts, you do not need those shift registers with the forever growing arrays...
01-10-2017 07:43 AM
I am back from hollidays, and ready to update that code a little bit more before checking it !
I've added those modifications !
I now bundle and unbundle by name, which makes the code a bit more readible. I've not created subVIs yet, as I find it easier to read it that way. I'll do it (but later 🙂 )
I've also changed the waveform graphs for charts. The only memory leak right now, as far as my understanding of labview goes, is represented by this 2D array of strings (3rd loop). I'd like to display the data in the array throughout the acquisition, but this would lead to a build up in the RAM.
Any suggestions ?
Thanks again for your help!
Flo