06-27-2009 03:55 AM
Hi,
Have to automate an VT100 Terminal emulation. For this task my favourite choise is
HyperAccess (Thanks Dennis Knutson who recommend it in several LV-Threads) .
It provides an OLE-Interface. So i am able to use it with the TS ActiveX Apadater.
Unfortunately in some API-functions it will use the data type "variant".
And the most times it will expect a long/VT_I4 (4 Byte).
As i know TS stores every number as double (8 Byte).
Is there a way to cast the values in the ActiveX Adapter
or is it posible to create user DataTypes that provied this feature ?
because, I dont want to write a wrapper-Dll that handles this casts.
Greetings
juergen
Solved! Go to Solution.
06-28-2009 09:41 AM
I'm not sure I even used a timeout value. I'll see if I still have a copy of the old sequence I used. What happens if you just pass a TS numeric?
06-29-2009 04:28 AM
Hi Dennis,
Thanks for your response.
On "haWaitForPrompt" i am receiving -2 which means bad parameter.
the function only works if i let the optionals value empty. But
a default timeout of 100(000) (milli)seconds is to long for me.
Just five seconds are enough for my task.
It is the same bad behaviour if you enter the values in the step module settings
or if you are using a TS numeric variable.
greetings
juergen
06-29-2009 09:53 AM
There is not currenly a way, with the Automation Adapter, to specify what data type to coerce a value to for VARIANTs. If the COM server requires a specific data type different from the default ones for TestStand variables, you will have to write a wrapper function or vi to convert and pass the parameters.
-Doug
06-29-2009 11:17 AM
06-29-2009 12:12 PM
I've recorded this issue as something to look into for a future version of TestStand. As a side note, some COM servers are more tolerant of the data type passed in in a variant than others. It is pretty easy to take a variant and convert it to the type you are expecting using the VariantChangeType function of the Windows SDK and some servers will do this to be more flexible about the data types that can be passed in. That said, it would still be nice if the automation adapter had a way to choose the data type for numeric values passed as variants and that is good feedback.
Thanks,
-Doug