12-18-2025 03:41 AM - edited 12-18-2025 04:17 AM
Hi to all
I have a strange behavior with a LabVIEW Module which I use in a Subsequnce and use an Object Reference for Value passing.
I have created an exmaple to demonstrate the behavior.
I have the "MainSequence" in which I call three times the Subsequence "GetRandomNumber":
As Paramter I use an ObjectRefrence:
In the "GetRandomNumber" Subsequence I call a LabVIEW Module and assign its Output (a Variant) to the ObjectReference:
The strange behavior is that I get three times the same RandomNumber in the ObjectReference. It seems something strange with the ObjectReference.
I have alos added a direct call of the LabVIEW Module and assign its Output to the ObjectReference:
With the direct call of the LabVIWE Module I get three Times a different Value in the ObjectReference
What I'm doing wrong?
12-18-2025 06:30 AM
Disclaimer: I haven't looked at the code you have attached
Just for the sake of completeness, there is a random function in TS also, so unless you need something very fancy here 😉
What you are describing sounds odd! Do you get the expected (three different) results, if you set the ObjectReference to Nothing in between the sequence calls?
01-14-2026 12:25 AM
Hey Oli, thanks for your reply
I just use the Random function to ilustrate my Problem.
I already tried to set ObjectReference to Nothing in between the sequence calls but without a effect.
Does somebody has an Idea what I'm doing wrong?
Best regards
01-14-2026 01:28 AM
OK, I took a look at your code and I can confirm the behaviour as described.
The Parameter of the SubSequence is updated within the SubSequence, confirmed using single-stepping and checking the variables pane.
Nevertheless, the Local (in the caller) assigned to the SubSequence-Parameter is only updated for the very first call.
Since I haven't seen this issue with other data types than variants, my gut feeling is, that this has to do something with the variant itself.
It smells like a bug to me.... I'd recommend contacting NI Support! They should be able to work with the information you have collected