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.
03-27-2014 04:14 PM
I need to write some values that I'm reading by the serial port. But I need to increment the column automatically each new number.
What it is happening is that each new number, the last one turns to zero and I lost the number.
How can I store the last number and receive the number at the next column?
Regards.
Solved! Go to Solution.
03-27-2014 04:18 PM
03-27-2014 04:23 PM
Sorry,
I forgot to send the .vi. Here it is.
03-27-2014 04:29 PM
@Michael_78 wrote:
Through the power of telepathy: stop using locals and start using shift registers. If you post your vi you may get aore sensible answer!
[Opens VI]
Nope, you were wrong no locals
[Looks closer]
...Oh well he also isn't using a shift register for the array so every time you run you will be replacing the values and never keeping a history.
Poster please explain a little more what you need. I can suggest that you should make your arrays to to the shift register so you can keep its history and replace data each iteration instead of replacing data and then never using that data the next time the loop runs.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-27-2014 04:35 PM
No shift register was most likely so surely i get points for that Locals? that was just my wildcard, figured i had good odds but thats why i play with matchsticks
03-27-2014 05:15 PM
I need to keep the hystory of the last number and keep incrementing the column to each new number.
Like:
I receive [1,2,3,4,5], for example.
With my code, I receive: [1] than [0,2], than [0,0,3] than [0,0,0,4] than [0,0,0,0,5]
But I want this: [1,2,3,4,5].
Hope I was clear now.
Regards.
03-27-2014 05:26 PM
Your explaination is still ambiguous but I implemented the code the way you described it which I don't think is the way you actually want it.
If you put in [1] then click Simulate a Read, then enter [0 2], then read, then [0 0 3] then read, and then for 4 and 5 you will have the result you want [1 2 3 4 5] but this relies on always having the array size increase by one, and always starting at size 1, and always having your newest relavent data at the last value in the data you read.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-27-2014 06:15 PM
I appreciate your response, but it wasn't like that.
I will try to explain again, hahaha.
I will receive the numbers by the Serial port, ok?
I need to put these numbers in order in a array, one after the other, but keeping the number that I received before.
With my code I can increment the column, but I can't keep the hystory. At each new number that I receive, the last one turns to zero and I only see the new one.
Will not me that will put the numbers at the array. I will receive all the number by the Serial port, I need to align these number in order one after the other.
Was better now?
03-27-2014 07:00 PM
First, let's clarify that you actually have a question about your VI and not a doubt. You don't have a doubt because you know it doesn't work.
It sounds like all you need is a shift register to maintain the array, and a Build Array in the case structure that will put the incoming data at the end of the array. I think your description is confusing people into thinking you want to do something more complicated than you actually want to do.
03-27-2014 09:50 PM
I'm probably not expressing myself correctly, I'm sorry about that.
But I think you undertood what I'm trying to do. Could you send me a photo about the code that you said?
Regards