05-31-2018 07:42 AM
Hello all,
I am working within pre-expressions trying to pull certain text from VI calls. I had an issue where I couldn't correctly return values when using a variable.
Example:
Step.TS.SData.ViCall.Parms["Remote IP"].ArgVal returning Locals.IP
Rather than
Step.TS.SData.ViCall.Parms["Remote IP"].ArgVal returning 192.168.0.1
This was fixed thanks to a very kind user name CyGa. He told me to user the evaluate function. So now most of my code works. However, I am having another road block that I have been scratching my head at for more than a few hours now.
When I try to pull information from an array input of a VI, I get an unformatted string of numbers
Example:
Str(Evaluate(Step.TS.SData.ViCall.Parms["TxData"].ArgVal)) Returns 225
Rather than
Str(Evaluate(Step.TS.SData.ViCall.Parms["TxData"].ArgVal)) Returning {0x2, 0x25} (It used to return this when using just Step.TS.SData.ViCall.Parms["TxData"].ArgVal, but only when not using a variable as an input)
Does anyone know of a way to get test stand to return a formatted string like the second string of the second example? Is there a way to convert an array of Numbers into a single formatted string? Or do I need to do some form of inline loop to parse out what I expect the input bytes to be?
I would like the post expression I am creating to execute quickly so it doesn't cause timing issues with my tests. If that is not possible, it is ok because only certain tests have timing issues and those can be worked around with a different sequence call. I am sorry if I am asking for the moon, I honestly don't know what test stand is capable of.
Thanks,
Brady James
Solved! Go to Solution.
05-31-2018 09:24 AM
Try this:
Str(Step.TS.SData.ViCall.Parms["TxData"].ArgVal, "%g, ")
05-31-2018 09:27 AM
Forgot the Evaluate:
Str(Evaluate(Step.TS.SData.ViCall.Parms["TxData"].ArgVal), "%g, ")
New line between numbers:
Str(Evaluate(Step.TS.SData.ViCall.Parms["TxData"].ArgVal), "%g\n")
05-31-2018 09:34 AM
Thank you very much! My team and I were planning on using a very complicated recursive logic in line for loop to do this. But this is much easier! Thank you very much!