08-26-2021 06:21 AM
@VinnyAstro wrote:
I do want to get into DQMH at some point.
But 1. I feel that learning my way up (and understanding more basic functions) is better at first; 2. I still need to learn OOP first and I'd like to do it properly and not rush it, and for now I don't have time 🙂
You aren't learning basic functions here. The various uses of "Open VI ref" are a very complex subject, and this conversation has already referenced advanced topics like dynamically reloading PPLs and using thread execution systems. Very basic LVOOP, as you would need to use "Messenger Library" or DQMH, is a lot simpler than that.
08-26-2021 06:28 AM
@VinnyAstro wrote:
@drjdpowell a écrit :If you do want to do Async Calls, note that it is very common for people to get confused by the 0x40 "clone pool" option on "Open VI ref". People think that is what is needed for doing multiple references to multiple clones, when really it is a special single-reference-for-multiple-clones use case.
Sorry, I actually don't get your explanation here, could you reformulate that?
Not really. But, if you stopped using the 0x40 option, then the references would behave how you intuitively think they should: references to individual clones that you can put in an array.
08-26-2021 06:54 AM
@rwunderl wrote:
Now I have to come up with a new way to reinitialize the supply after an arc without bringing the rest of the machine down (don't want to turn off the other 3 supplies and cause hours of downtime). So I try a bug fix by deploying only the PPL for the supply in question and reload only that module.
A side note: but I have been moving towards separate EXEs, with messaging between them, to deal with complex projects where one doesn't want to have to stop/start all hardware together. Then one can stop one EXE and leave the others running.
08-26-2021 07:26 AM - edited 08-26-2021 07:27 AM
Vinny,
You're probably getting confused by x40 (it's basically legacy)
Make yourself a really simple VI that launches just 5 clones dynamically and set them up as UIs. with random data generation.
you'll probably find (like I did 12 years ago) that although x40 is what you thought you wanted, you've misunderstood it and you actually want to setup the VI as pre-allocated clone or shared clone and to call as x80 or x100. (x40 I haven't found a use case for yet if you've correctly setup clone settings in the execution system - they didn't exist a long time ago in LabVIEW)
James
(awaiting the slap down from drjdpowell 😜 if I've got this wrong)
08-26-2021 08:00 AM - edited 08-26-2021 08:06 AM
@James_W wrote:You're probably getting confused by x40 (it's basically legacy)
Oh, 0x40 not "legacy"; both "Messenger Library" and "Actor Framework", among others, use Fire-and-Forget with the 0x40 option. There are good reasons that they do so**. But it is a specialist thing that is not used in the more common stuff people generally are doing, where one wants, say, 5 references pointing to 5 clones. Mistakenly using 0x40 in such a case is a a common problem. I think it is because the documentation on that option is poorly written, and sounds like it is needed for reentrant calls.
** higher performance; not being blocked by "root loop"
08-27-2021 04:32 AM
@James_W a écrit :
Vinny,
You're probably getting confused by x40 (it's basically legacy)
Make yourself a really simple VI that launches just 5 clones dynamically and set them up as UIs. with random data generation.
you'll probably find (like I did 12 years ago) that although x40 is what you thought you wanted, you've misunderstood it and you actually want to setup the VI as pre-allocated clone or shared clone and to call as x80 or x100. (x40 I haven't found a use case for yet if you've correctly setup clone settings in the execution system - they didn't exist a long time ago in LabVIEW)
James
(awaiting the slap down from drjdpowell 😜 if I've got this wrong)
Aaaahh I see
Yeah I though that (for some reason given that 0x40 exists) if you call dynamically, then the execution mode setup in the VI properties are not relevant and you have to use 0x40 if you want to set it up as a clone.
I won't use it then 🙂
08-27-2021 05:51 AM
I've played a bit and it kinda works as I would like to 🙂 VIs attached in a zip file.
There is just one result that I don't quite get.
As every motors will be connected via CAN, they will have a specific Node ID. For that I'm checking the Clone Name which is Target.vi:970001 to 970005 (which I will derive later in something more suitable.)
BUT if ever I use a Strictly typed Static VI ref, it starts at 2 and not 1... Why is that?
(using the strictly typed allows to not have to manually re-update the type specifier on the Open ref function when changing my inputs/outputs)
08-27-2021 10:59 AM - edited 08-27-2021 10:59 AM
@VinnyAstro wrote:
BUT if ever I use a Strictly typed Static VI ref, it starts at 2 and not 1... Why is that?
Dropping a strict reference to a Preallocate Reentrant VI on the block diagram preallocates a clone for that reference (which you can use with regular Call-by-Reference). That is clone number 1 (which you aren't actually using, but could). So when you create new clones to do async calls, they start from 2.
A non-strict reference can't be called, and no clone is preallocated.
08-27-2021 11:14 AM
Ahh good to know!
But does it mean that it should be another ref to close as well then ? Or is it just pre-allocated but not ran and there is then no need to close it?
08-27-2021 11:24 AM
@VinnyAstro wrote:
Ahh good to know!
But does it mean that it should be another ref to close as well then ? Or is it just pre-allocated but not ran and there is then no need to close it?
It's a static reference, rather than a dynamic one, so Close will do nothing and is unneeded.