04-21-2020 08:43 AM
Hi Everyone,
My compiled code seems to be using only one core when it is compiled, the other cores don't seem to have a notice change when running to code. I have read a lot about the possible reasons for this and have already done a few things to ensure that it's not something simple. I have done the following:
So, some possible thoughts as to why this is occuring is the following:
If there is something I am missing that is causing this behavior than I would love to hear back from someone!
Cheers,
Nik
Solved! Go to Solution.
04-21-2020 08:50 AM
If your code is using property nodes they must execute in the UI thread, which forces the execution of all your VIs into a single thread. A single thread only needs a single core.
Without more information, I'd imagine that's the issue you're seeing.
04-21-2020 09:36 AM
Thanks for the reply! That's what I thought the issue was going to be. Would you know any way that I could asynchronously call property nodes so that it would free up CPU time for my SubVIs while not altering the architecture too much?
04-21-2020 09:50 AM - edited 04-21-2020 09:51 AM
You can call a property node any way you like, but the actual code execution OF the property node will ALWAYS be in the UI Thread AFAIK.
There are other methods where you can share values between FP controls and indicators by reference which does NOT require the UI Thread.
https://zone.ni.com/reference/en-XX/help/371361R-01/glang/set_ctrl_val_by_index/
I thik it's called "Set Value by Index" or something. It's similar to how a local variable works. Changing that aspect might be your best bet.
04-21-2020 05:51 PM
Hi Nik,
As Intaris mentioned - "Get Control Values by Index" and "Set Control Values by Index" are much
more efficient than property nodes.
Your ref to ref code using Get/Set by index:
Note: You must supply the vi server reference to the source and destination controls/indicators
(if they are not in the vi where this code resides) in addition to their Control Indexes.