From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-26-2020 07:46 AM
Hello,
i have this idea:
1. A VI contains only a while-loop with a evenstructure inside (z_loop.vi).
2. The evenstructure is executinig code depending of the value of a global variable (z_global.vi)
3. The value of the global variable is set via z_setData.vi
4. Everything is compiled as a .Net InteropAssembly dll
5. Then i want to use the dll to execute the "z_loop" in c# as new thread so it is running parallel
6. I execute "z_setData" to perform different events in already running z_loop
The question is now:
1. Are the global variables working in a compiled assembly?
2. Currently i get an exception in C# when trying to execute "z_global" "System.BadImageFormatException: Could not load file or assembly 'InteropAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Es wurde versucht, eine Datei mit einem falschen Format zu laden.
is there a problem with DotNet? Labview and C# are on the same computer.
3. Is there an easier way to something like this?
Thanks
best regards
08-17-2020 03:20 PM
Hello OnlyOne,
Could you please describe what is final goal?
Do you mean LabVIEW here? 1. Are the global variables working in a compiled assembly?
08-18-2020 03:51 AM
Hi VA.KI,
Yes i mean the labview global variable which is the file "z_global.vi".
Then final goal is to bring data into the compiled labview vi.
The idea was to do this with a global variable.
Then i would not need any interface parameter and could do everything over a global variable
BR
TM
08-18-2020 06:48 AM
Hi 1,
@OnlyOne wrote:
Hello,
i have this idea:
1. A VI contains only a while-loop with a evenstructure inside (z_loop.vi).
2. The evenstructure is executinig code depending of the value of a global variable (z_global.vi)
Wrong.
Writing the value of the global to the local "Changed" indicator using a "Value" property node does NOT create an event, and so the "Value change" event case will not execute!
@OnlyOne wrote:
1. Are the global variables working in a compiled assembly?
I guess so, as all 3 VIs (including the global.vi) are compiled into the executable.
@OnlyOne wrote:
3. Is there an easier way to something like this?
When you already start a parallel running thread I would use network communication to send commands to this thread: no event structure, no globals, no locals. Just waiting for some messages - with the advantage of being able to send those messages from all other executables (LabVIEW, C#, whatever) running on your computer…
08-18-2020 07:07 AM
Hi GerdW,
in the timeout section of the event the content of the global is written to the local variable.
The event "value Change" is working fine in labview direct if i change the global using the Vi z_SetData.vi.
I dont understand why it is not running at your side.
The problem is how can i send data to a already running VI, so i used the global. I dont want to send data to the thread.
Here is got stuck with the errormessage in the first posting.
TM
08-18-2020 07:27 AM
Hi 1,
@OnlyOne wrote:
in the timeout section of the event the content of the global is written to the local variable.
The event "value Change" is working fine in labview direct if i change the global using the Vi z_SetData.vi.
I dont understand why it is not running at your side.
You don't write to a local variable, you write to a "Value" property node.
This "value" property node DOES NOT create an event - this is basic LabVIEW knowledge…
@OnlyOne wrote:
The problem is how can i send data to a already running VI, so i used the global. I dont want to send data to the thread.
So you want to send data to another VI, but then you don't want to send data to this other VI (because it now runs in a different "thread")?
08-18-2020 07:57 AM
Ok, this is then also another problem. Thanks.
But my first problem is that i cannot execute the created ".Net Interop Assembly" DLL in C# as the mentioned error appears.