10-17-2016 10:29 AM
Read the File as an array of strings.
Get the length of the array
Use Array Subset with length set to 5 and the intial position as the length of the array minus 5.
Did you look at Altenbach's code yet? Here is is saved as LV13.
10-17-2016 10:30 AM - edited 10-17-2016 10:30 AM
Duplicated the post.
10-17-2016 11:25 AM
Raven,
Thanks for fixing Altenbach's code. Works good by itself, but messes up everything when I put it in my code, due to the WHILE loop....
Regarding your suggestion, how do I get the length of an array?
Thanks,
SM-
10-17-2016 12:05 PM
Raven,
So I attempted doing it your method. It only recorded message #'s 3-7 even though the last message that was stored on the logger that records all of the messages was message # 150... Any reason why this is, or is there something I am doing wrong (see attached screenshot)?
Thanks,
SM
10-17-2016 12:43 PM
So I figured out why it was only storing messages 3-7. If I can just figure out how to get the length of the array I think it will work... Can anyone point me in the right direction to get the length of an array?
Thanks,
SM
10-17-2016 12:43 PM
@Sman29 wrote:I am using LV 2013, could you repost that code with a LV 2013 so that I can see it?
Try this.
10-17-2016 12:46 PM
Hi Alten,
Thanks for the reply. Raven already posted your VI as 2013 a few posts ago. It works good by itself, but unfortunately I cannot add any extra WHILE loops to my code or else it doesn't work right. Again as previously mentioned, I didn't inititially write this code, I'm just trying to modify it and it's very very fragile...
So right now I am attempting to do it using Ravens method, but I am not sure how to get the length of the array?
Thanks,
SM
10-17-2016 12:49 PM
@Sman29 wrote:
Thanks for fixing Altenbach's code. Works good by itself, but messes up everything when I put it in my code, due to the WHILE loop....
You can't just drop that code inside your own code, you need to understand it and the apply the same principles.
It shows two things:
Do you fully understand my code?
To intergrate the ideas into your existing program, you would eliminate my while loop and place the shift registers into your own outer while loop.
Can you attach the code where it "messes everything up" so we can get a better understanding what you are doing.
10-17-2016 12:56 PM
@Sman29 wrote:So I figured out why it was only storing messages 3-7. If I can just figure out how to get the length of the array I think it will work... Can anyone point me in the right direction to get the length of an array?
Thanks,SM
Go to the Array palette. There is a function called Array Size. Your one set of code won't work because you have a race condition between the size indicator (which is using the Array Size functon you can't find.), and the local variable. As well as a race condition between writing to a file and reading from it. You have no control over whether the reads or writes happen first.
Have you taken LabVIEW tutorials?
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
I would also recommend taking some time to browse around the palettes while you have Context Help turned on to familiarize yourself with the varioius functions.
10-17-2016 01:04 PM
"You can't just drop that code inside your own code, you need to understand it and the apply the same principles.
It shows two things:
Do you fully understand my code?"
I have to say, no I do not fully understand your code.. I'm still an amateur at LV...
"To intergrate the ideas into your existing program, you would eliminate my while loop and place the shift registers into your own outer while loop."
I can't really do it that way because the data coming into my WHILE loop is a cluster, and it gets split into the arrays in a case structure...
"Can you attach the code where it "messes everything up" so we can get a better understanding what you are doing."
Unfortunately I cannot post my code for a couple reasons, mainly proprietary... Attached is a screen shot of kind of where I am at right now though.
Thanks,
SM