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.
07-25-2012 07:11 AM
@Ravens Fan wrote:
Follow Yamaeda's link for how to implement an action engine. You will basically need 2 actions. Load and Get Data.
Your image of the Index Array is much better. Here is another tip that will help. Since it looks like you have all the indices from 0 to 7 used, if you rearrange all of your indicators in order, you can get by just wiring the 0 constant at the very top output like you have now which defines the 0th column. Eliminate all of the other constants. All of the outputs below that will be the 1st, 2nd, 3rd, .... 7th columns by default automatically. It's a way of saving time of having to duplicate all of those extra constants and changing them manually to sequenctional numbers.
I am studying on action engine. I will take your advice for the next time on index array. Did you know how to save XY-graph without resetting?
07-25-2012 03:27 PM
To retain all previous data on your graph, you could create a feedback loop that takes your current data and passes it to your build array function through a feedback node (see attached image for example). To retain only x number of previous data plots, you could use shift registers.
07-26-2012 03:24 AM
@MarcusB wrote:
To retain all previous data on your graph, you could create a feedback loop that takes your current data and passes it to your build array function through a feedback node (see attached image for example). To retain only x number of previous data plots, you could use shift registers.
I tried your suggestion but it press all data on graph and that's not what I want. I want to see only the last graph on the XY-graph but when I want to see the previous graphs I desire to see them via scrolling the x scroll right lower side.
07-26-2012 09:23 AM
The x scroll bar you see below your XY-graph is for scrolling across the x axis only. To see previous graphs, you would need to retain all previous data inside an array and use a numeric control to index through your previous data to control what is displayed. See the attached image for an example of how to do this.
07-31-2012 05:56 AM
@Yamaeda wrote:
Ah, now it starts to make sense. In In the sub-vi, possibly in several places, you read a file (why?) which'll cause 6*X file reads, and i guess you have a open/close connected to that also. If you want to read a file in a loop, try to make sure you only read it once, and use that data in all calculations. Keep file opening/closing outside the loop.
/Y
I changed the whole VI and it reads only once from txt files at the beginning of the for loop and this approach make it really faster. It seems works for me for now. But still so I need to adapt this VI t action engine? I attached the modified VI. I am open to all suggestion on it.
07-31-2012 07:23 AM
Instead of indexing the arrays inside of the FOR loop, use autoindexing tunnels. That will also remove the need to wire the N of the loop.
You might also want to consider using clusters to group your data. 1 wire is a lot easier to handle than 9. That will clean up your code quite a bit.
07-31-2012 01:57 PM
Crossrulz has a good point (which has been mentioned earlier). It also seems like you're using the same sub-vi 6 times with the only difference being the 2 single values. Make an array of those values and put the sub-vi in a loop instead. It'll clean stuff up alot. 🙂
AE isn't obligatory, if it works now all is well.
/Y