04-01-2015 11:40 AM
Hey LabVIEW gurus,
Solved! Go to Solution.
04-01-2015 12:21 PM
First of all, you reallly should learn to make some subVIs. They will clean up your diagram a lot.
Secondly, your CRC calculation is incorrect. The inner loop should only iterate 8 times (once per bit in the array element, which is a U8). And you should use Array Subset to reduce the elements you are performing the calculation over.
Thirdly, whatever you do not want to be performed with an invalid CRC should be inside of the FALSE case of your case structure.
04-01-2015 12:38 PM
Thank you crossrulz. I understand my loop error, and used Delete From Array to get rid of the 2 unwanted bytes. I left the FALSE case intentionally blank because I do not know how to tell LabVIEW to throw away data containing a transmission error and retrieve the next packet. I cannot read zeros in place of bad data. I'm sure there is a simple way to do this in LabVIEW - any ideas?
04-01-2015 12:57 PM - edited 04-01-2015 12:58 PM
Well, I would also recommend moving your file writing to be inside of the loop, specifically inside of the TRUE case (I might have told you wrong before). If the CRC comes out to 0, you do all of the processing, else do nothing. Then next iteration. By moving the File IO to inside of the loop, you are avoiding building up huge arrays (ie lots of memory).
04-01-2015 01:04 PM
Understood. I was trying to think of ways to do all the processing within the TRUE case structure, but couldn't figure it out because I put the file IO outside the loop. Should have reconsidered that decision. Thanks!