06-18-2020 02:38 PM
06-19-2020 10:28 AM
Sure, this is part of my proyect.
Every iteration data is sent to the XY graph, and also the time in ms, so, I have a case structure that makes the XY graph be like a chart setting maximun and minimun values of X scale each time.
But that makes the loop frequency being reduced! I suspect there is another solution for high performance...I hope. Can you help me?
Sorry for my english...
06-21-2020 11:19 AM - edited 06-21-2020 11:21 AM
Hi yamelbio,
building (large) arrays in a loop will be slow!
And outputting all those data to a graph in every iteration will also be slow!
When you want real help you should attach real code, not just images of parts of code…
06-22-2020 10:45 AM - edited 06-22-2020 10:48 AM
GerdW, Hi!
Here is the entire code, please help me, I dont know how to avoid those problems you mentioned.
Thank you!!
06-22-2020 01:36 PM - edited 06-22-2020 01:56 PM
Hi yamelbio,
@yamelbio wrote:
Here is the entire code, please help me, I dont know how to avoid those problems you mentioned.
To avoid problems you should take a step back and rework the whole (main) VI!
Please avoid code like this:
You use way too much local variables - and all the terminals are unused in the block diagram!
Replace locals by either terminals or wire!
Using a "Stop" function in a subVI is a no-go ("Password.vi")!
Don't have loops spin as fast as possible, especially for GUI handling (like Save_Channel_Selector)!
Plotting the same data on 21 (!) charts (with a history size of 65536 samples each) in each iteration is also not helping with execution speed! (Don't label a chart as "graph"…) What's the point in displaying 65k samples on a chart of max. 800 pixels width?
You are using way too much code: use loops or polymorphic instructions instead of duplicated code (Spread_Save):
What's the point of this:
Use a simple timestamp indicator instead of two string indicators! You can edit its display properties to have it look like you need…
No need to release the Cursor in each iteration (at desired 1kHz)!
General conclusion:
When you want to read data at 1kHz loop rate (for whatever reason) then you should use a seperate loop just for DAQ.
Other processes (like GUI handling or data display) should NOT run at this speed! Update rate for most monitors is at 60Hz, so you don't need to update your charts more often…
06-22-2020 04:38 PM
Wow...there is a lot of work to do... I guess I need to study consumir/producer loops.
That solution as the alternative of cases structures is crazy!! I am impressed, I feel like a noob.
I need to study indeed.
Oh thank you!! GerdW