05-16-2018 04:32 PM
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.
05-17-2018 03:00 PM
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.
05-17-2018 03:15 PM
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. 😕
05-17-2018 03:27 PM
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).