LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a .NET ReadOnlySpan

Solved!
Go to solution

I tried to call a dummy property of System.Memory (and wire the output to connector pane to be absolutely sure it was not removed by the compilation) at the beginning of the diagram but it fails in the same location after.

0 Kudos
Message 21 of 29
(651 Views)

@smi38 wrote:

I tried to call a dummy property of System.Memory (and wire the output to connector pane to be absolutely sure it was not removed by the compilation) at the beginning of the diagram but it fails in the same location after.


I think it's the ReadOnlySpan that is missing.

 

ReadOnlySpan is a construct that needs System.Runtime.dll.

0 Kudos
Message 22 of 29
(643 Views)

Does that mean I have to reference System.Runtime.dll in some way ?

I'll try that tomorrow.

What is strange is that it works perfectly fine in source code, I don't get why it fails in PPL.

0 Kudos
Message 23 of 29
(623 Views)

@smi38 wrote:

Does that mean I have to reference System.Runtime.dll in some way ?

I'll try that tomorrow.

What is strange is that it works perfectly fine in source code, I don't get why it fails in PPL.


I'm not sure, but this is what I suspect.

 

The PPL runs like a dll. A dll has it's own environment (execution context), so it doesn't accidentally mix resources with the run time (the development environment is the run time when developing).

 

In sourse code, there's no separation, so the PPL source has all resources of the rest of the source. Either the LV runtime loads system.runtime.dll, or some other code (VI) made it load. 

 

Normally (with normal .net nodes) this isn't a problem, because the runtime context loads the assemblies it needs. However, we're trying to access the assembly dynamically, and that fails because it's not in memory.

 

Can you use the PPL in the source? Or is that what you've been doing? I'd suspect that doesn't work either, because the PPL can't access the system.runtime.dll dynamically.

 

It's not the creation of the exe, it's the creation of the PPL that causes this.

0 Kudos
Message 24 of 29
(612 Views)

Thanks for your kind help.

I'm using the PPL in the development environment.

I still don't have used it with the runtime yet.

I tried to force loading of system.runtime by calling a property of one of its class (type to string or something like that), wiring it on the connector pane, and closing the reference after my readonlyspan use : it fails too in PPL.

I guess it's a generic issue, maybe it's possible to mimic it with other "similar" types.

0 Kudos
Message 25 of 29
(603 Views)

To be sure, you could check if the string is different in the PPL. Not sure how or why, but a One Button Dialog or string output would prove it's the same.

 

I'll try this myself in a dll (I stay away from PPLs as I only read about the problems the create 😋 and I don't need them atm).

0 Kudos
Message 26 of 29
(597 Views)

I'll try to get the type string in PPL.

 

I'm a PPL user for 2 reasons :

-I'm a TestStand user, and PPL solve a lot of issues between TS and LV

-I live LV plugins architecture 

 

 

 

0 Kudos
Message 27 of 29
(590 Views)

Hi, 

I tried the popup in the PPL : the type is build correctly.

If I wire another popup on the outputed ref with a ToString property it's empty.

I'm stucked at this point 😞

 

0 Kudos
Message 28 of 29
(574 Views)

Can you post a minimal example demonstrating the problem?

 

I haven't touched ppls in a while (that's why I'd done it with a dll, not as an alternative).

0 Kudos
Message 29 of 29
(566 Views)