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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Type of argument expression 'FileGlobals.HardwareInfo' is incompatible with parameter 'HardwareInfo'. Expected Container, found Container.

Hi all.

 

I have a subsequence with a parameter (container) called HardwareInfo. In my calling sequence I've created a Custom Data Type to match the structure of the HardwareInfo container exactly and want to pass this into the subsequence parameter. This seems like it should be no problem, however when I run the sequence I get the following error:

Type of argument expression 'FileGlobals.HardwareInfo' is incompatible with parameter 'HardwareInfo'. Expected Container, found Container.
----------------------------------------
Error Code: -17313; Could not accept the parameter passed in.

 

Anyone know what I'm doing wrong? I created the Custom Data Type by starting with a container (empty) and then pasting into that exactly what is contained within the parameter of the subsequence. If I just copy/paste the container from the subsequence into the calling sequence and pass it in then it works fine, but the custom data type of the exact same structure doesn't work. My reason for creating a custom data type in the calling sequence is that I want to eventually have an array of type HardwareInfo that I can loop through and pass into the subsequence. When I do that I get the same error, so I've simplified the issue for now and gotten rid of the array, but the main problem is still the same.

 

Thoughts?

0 Kudos
Message 1 of 4
(2,626 Views)

Hi,

 

From what I understand, one variable is a Custom Data Type, the other one is manually created (not a type), right ?

Have you tried to set both the parameter variable and the value passed to be the same Custom Data Type ?

 

If I remember well, Parameters variable are set by default to check types. To remove this behavior, or you use the same data type, or you right-click on your parameter varaible (Parameters.MyVariable) and you uncheck 'Check Type'.

It should then work well.

 

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 4
(2,593 Views)

Hi CyGa,

Correct - They are identical containers, but one is a custom data type and one is not. The subsequence being called is not created by me. It may be an option to update the subsequence to use the custom data type, but this also would mean updating it everywhere else it is used. It seems making the subsequence use the custom data type shouldn't be needed if they are both the same as far as their structure and contents. I'd also prefer to keep the type checking enabled as this would throw an error (properly) if something in the structure actually didn't match.

 

Perhaps I'm simply expecting that if a container is passed in that has the same structure then it should pass the check, but TestStand is considering it to be different simply because it's a typedef? That doesn't make sense to me, but maybe that's just the way it is? IMHO the separate functionality in my sequence that needs a typedef shouldn't require everything else that I want to pass data to also be a typedef.  😕

0 Kudos
Message 3 of 4
(2,591 Views)

Hi,

 

If I remember well, then yes your problem comes from the fact TS is checking the type def.

The subsequence should have the 'check type' unchecked if shared. Or, the custom data type should be shared.

But in any case, if the containers mismatch you'll also have an error.

What you can try is fill each single value of the container by single variables (and not trying to only map the container head).

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 4
(2,588 Views)