cancel
Showing results for 
Search instead for 
Did you mean: 

replace data in existing spreadsheet

gdah
Member

replace data in existing spreadsheet

Message contains an attachment
hi...

I have one main program that running a subvi. The main program will read data from spreadsheet (Error.csv) and send the data to the subvi. The subvi will stop running after the STOP indicator is TRUE. Then I need to replace the existing data in Error.csv with the new data that come out from the subvi.I have some problem to replace the data in the same file. Please help me..
9 REPLIES 9
MikeS81
Proven Zealot

Re: replace data in existing spreadsheet

Hi gdah,

i´m not sure what you make in your while loop, but you should use shift registers to have the newest values.

Hope it helps.
Mike

GerdW
Knight of NI

Re: replace data in existing spreadsheet

Message contains an attachment
Hi gdah,

you should already have heard: Use LESS/NO locals and LESS/NO sequence structures!!!

I changed one of your subvis, hope this helps to illustrate the above sentenceSmiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
gdah
Member

Re: replace data in existing spreadsheet

hi..
did u check my program??ok..never mind...let just ignore the subvi. my main problem is i want to replace the existing data with the new data in the existing spreadsheet file. I have try to read the file , and after a few process, replace old data with new. but unfortunately, it did not work.please assist me...
GerdW
Knight of NI

Re: replace data in existing spreadsheet

Hi gdah,

we already assited you: USE shift registers instead of locals!

"it did not work" is not really helpful to describe a problem. What did not work? Is the part processing the data not working (because of lacking shift registersSmiley Very Happy) or is the part of writing to file not working?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
muks
Proven Zealot

Re: replace data in existing spreadsheet


and after a few process, replace old data with new. but unfortunately, it did not work


What do mean by a few process.Can you be bit more precise?
GerdW
Knight of NI

Re: replace data in existing spreadsheet

Message contains an attachment
Hi gdah,

well, you still don't tell us more about your problem than "I have some problem to replace the data in the same file." and "it did not work".

And yes, I checked your vi and did it for a 2nd time. Now I attached the whole hierarchy with changes and comments. As you didn't specify the problem I only made changes to remove local variables and stacked sequences without (hopefully) changing your processing...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
gdah
Member

Re: replace data in existing spreadsheet

i noticed that i have deleted the local arrayB in my original program. I have run your program. It not works. The purpose of putting local is i need to update the arrayB according to the value at Array. For example, if the arrayB have 4rows and 2 columns, x and y =TRUE, that row will be deleted, and the array will remain 3rows. but if in your program, even there is a deleted row of data, the array will  remain 4 rows.

i hope u will understand what i try to say.

GerdW
Knight of NI

Re: replace data in existing spreadsheet

Hi gdah,

ok, I have changed your algorithm by replacing the local.
But you still don't explain what's the problem for your original post...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
gdah
Member

Re: replace data in existing spreadsheet

hi GerdW..

Thanks a  lot..I are really help me to solve this problem. I have try your 2nd program. And it's working..I have learnt a new stuff from you..thanks again..appreciate averythingSmiley Wink