LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read key (variant) - OpenG

Can anyone help with this? I've already posted it to the OpenG forums and Jim Kring thinks it's probably a LV bug. Can anyone confirm?

 

 

The problem occurs when I set the data type to VISA session - LabVIEW crashes just before the read key (variant) vi runs.
I'm using LV 7.1, and I've attached an example to show what I mean.

 

Any ideas what's going on? And if someone could try it in a later version of LabVIEW that would be really interesting too.

 

Thanks & regards,

Jon

Download All
0 Kudos
Message 1 of 6
(3,569 Views)

Hi Jon,

 

I'm using LV7.1 and your example runs fine for me (after adding an addition "strip path")...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,557 Views)

 Hi Jon,

 

I've tried out the code also, and I can aggree with GerdW.

 

Essentially you need to strip out the path again (as shown in Image) as the path is effectively <directory>\Variant config test.llb\Variant config test.vi.

So firstly you strip out the name of the vi, and this leaves you with  <directory>\Variant config test.llb so it's necessary to strip out the Variant config test.llb part of the path also.

 

extrastrippath.JPG

 

Hope this helps,

 

StevenH

Message 3 of 6
(3,524 Views)

Guys - thanks for checking it out and discovering my little mistake.

 

However, now that I've fixed it, and actually put some data in the text file, you can now actually see the problem I was seeing!

 

Woudl you mind trying it again? Sorry for the mistake!

 

Jon.

Download All
0 Kudos
Message 4 of 6
(3,515 Views)

Hi Jon,

 

So I ran the new code again in LabVIEW 7.1.1, and all worked fine! Couldn't get the VI to crash unfortunately.

 

Could I suggest that you try debugging theRead Key (Variant) SubVI if that's where it crashes.

 

Open up the SubVIs front panel by double-clicking on it, go to File»VI Properties, then select Execution from the Category context menu. From here uncheck the Reentrant Execution checkbox, then select OK.

 

From here go to the Block Diagram and turn on Highlight Execution. This way you will be able to isolate where exactly the problem is occuring.

 

Please post back and let me know how you get on.

 

Best Regards,

Steve

0 Kudos
Message 5 of 6
(3,494 Views)

OK,I feel a bit on an idiot because I got the filename wrong in the VI.

 

Anyway, I tried it in 8.5 (I only have 7.1 at home) and I can see exactly where the problem is. In 8.5 it gives an error rather than a  complete crash. 

 

I've attached a much simplified version.  I get Error 116:

 

"Error 116 occurred at Flattened String To Variant in Variant config test2.vi

Possible reason(s):

LabVIEW:  Unflatten or byte stream read operation failed due to corrupt, unexpected, or truncated data.

 

 

Any idea what's going on? 

 

Jon.

 

Download All
0 Kudos
Message 6 of 6
(3,490 Views)