LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Reading Cluster from disk

Solved!
Go to solution

 A code developed in LV2009 was opened in LV2012 and saved.

 

A new problem has cropped up - I have a set of user entered values which are saved to disk as a cluster ( Strict Type Def )

 

But I get a error when I try to read the cluster. I have attached the code and error screen shots. A simple code but for no apparent reason throws a fault. I have tried reading and writing to  the cluster external to the project and so there is no problem with that. I have tried TypeDef, StrictTypeDef with no luck ( I know these have nothing to dowith my problem but still have to try something ?)

 

Please help .. I have even replaced the Open / Read / Close functions iwth the ones from LV2012 palette.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
Download All
0 Kudos
Message 1 of 4
(3,058 Views)

Are you sure that the file is a binary file? Is there anyother piece of code which access that file?

 

I guess the error occurs at the open file itself and not the binary file read.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 4
(3,036 Views)
Solution
Accepted by topic author MogaRaghu

@Raghunathan wrote:

I have attached the code and error screen shots. 


No, you have only attached a severly cropped picture that is almost useless for debugging. We cannot tell where the wires come from or what is inside the other cases.

 

One place where errors can occur is if you build paths using string operations. You should use "build path" exclusively.

 

One very obvious problem is the fact that you seem to have a path to a folder instead of a path to an actual file. Note that the input to "list folder" is a folder, but you re-use the exact same path trying to open it as a file. This should have never worked. I assume that your random and misguided attempts at fixing someting broke things even more.

 

Do you still have the original 2009 code? Can you attach it a simplified version of of? Also include your datafile.

 

Most likely you need to use another build path by combining the existing path with the string from "NewVal" as filename before reading the file. Just guessing, of course.

0 Kudos
Message 3 of 4
(3,022 Views)

1. I must have written : I have attached the screen shots of Code and Error message. But the way I worded it originally gave an impression I have attached code. Sorry about that. ( Anyway I cannot attach code as such- its pretty large and unneccessary in the current context )

 

2. You wrote : One very obvious problem is the fact that you seem to have a path to a folder instead of a path to an actual file.    Yes that was the bug - once i gave the file the name from NewVal, things got sorted out. When a marathon coding session ensues, oversight is unavoidable I guess.

 

3. You also wrote : I assume that your random and misguided attempts at fixing someting broke things even more. That one hurt. Very unusual coming from a person of your stature. I am a mechanical engineer by profession and LV coding is not my primary line and I can't be expected to have the depth as you have in the subject. The very reason we turn to experts for help.

 

4. Attaching the screen shot of the code that worked.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 4 of 4
(3,002 Views)