NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant DataType for ActiveX/COM (HyperAccess) Adapter

Solved!
Go to solution

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    

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Download All
0 Kudos
Message 1 of 6
(4,541 Views)

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?

0 Kudos
Message 2 of 6
(4,521 Views)

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

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 6
(4,503 Views)

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

0 Kudos
Message 4 of 6
(4,493 Views)

Hi Doug,

 

Sounds bad!

 

Never mind. If there is an issue in your desgin,

we have to wait a few minutes Smiley Very Happy

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 6
(4,488 Views)
Solution
Accepted by topic author j_dodek

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

Message 6 of 6
(4,483 Views)