LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append only last 5 messages

Solved!
Go to solution

What do you mean by opening and closing every time?


Thanks,

SM

0 Kudos
Message 21 of 60
(1,157 Views)

The write to spreadsheet vi will open the file, write the data to it and then close it, EVERY time you run it.  In effecient logging you should open the file, perform all of the logging and then close the file.  In this manner you only open and close it once. I displayed this in the example I gave you.



-Matt
0 Kudos
Message 22 of 60
(1,156 Views)

Ok I think I understand. Also adding stuff to the cluster is a no-go. The cluster unfortunately cannot be changed... Where I have the 1D string array going into the delete from array is all I have to go on... I have to take the messages coming from there and do what I need to do... Any other suggestions?

 

Thanks for all the help and patience,

SM

0 Kudos
Message 23 of 60
(1,153 Views)

put a string array shift register on the loop, outside of the cluster. You need to store that data or read from the file and then write to it in that case.



-Matt
0 Kudos
Message 24 of 60
(1,151 Views)

By cluster are you meaning case structure? Or are you referring to the data cluster that is coming inside the case structure?

 

Thanks,
SM

0 Kudos
Message 25 of 60
(1,149 Views)

Back to what y'all were saying earlier about storing all the messages and then when the program is done, delete all but the last 5, how can I do that?


thanks,
SM

0 Kudos
Message 26 of 60
(1,146 Views)

Matt,

 

I tried doing a string array shift register but I couldn't really get it to work... Did you have a more specific idea in mind?

 

Thanks for any help,

SM

0 Kudos
Message 27 of 60
(1,126 Views)

@Sman29 wrote:

 

I tried doing a string array shift register but I couldn't really get it to work... Did you have a more specific idea in mind?

 


Show us what you did and we will try to fix it. (attach the actual VI).

0 Kudos
Message 28 of 60
(1,122 Views)

Alten,

 

As previously mentioned (though embedded in the conversation) I cannot post my actual VI for several reasons, one of which being proprietary... Attached is 3 screenshots of my attempt at a shift register.. The first is my actual code, the last 2 are the errors I am getting...


Thanks for any help,

SM

0 Kudos
Message 29 of 60
(1,115 Views)

feed the array into "reverse 1d array" then "delete from array", keep the length to 5 and index 0,take the "deleted portion"

0 Kudos
Message 30 of 60
(1,103 Views)