LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using ActiveX variant BTY_string conversion problem

All,

I am using LV5.1f1 with a self written activeX libray. I am using a variant
object type (B-string) to communicate with the library. On the LV side, I
convert an array of 6 U16/u8 byte to string with the u8 string conversion
icon.

It is said, that Lv automatically converts all input objects going to the
invoke node of the ActiveX object. This is not true, as the string result
on the library side is wrong in one of the 5 bytes.

Can anybody help ?? Pleeease
0 Kudos
Message 1 of 2
(2,679 Views)
> I am using LV5.1f1 with a self written activeX libray. I am using a variant
> object type (B-string) to communicate with the library. On the LV side, I
> convert an array of 6 U16/u8 byte to string with the u8 string conversion
> icon.
>
> It is said, that Lv automatically converts all input objects going to the
> invoke node of the ActiveX object. This is not true, as the string result
> on the library side is wrong in one of the 5 bytes.

The automatic part refers to the fact that LV maps things like arrays to
Safe Arrays and LV strings to Variant strings. It cannot however know
what formatting you expect within a string, and that seems to be your
problem. When you are converting the LV array to a string, are you using
a Format to String node where you specify nu
meric formatting options, or
are you simply casting them to a binary representation of the string. It
sounds like you are casting to a binary string. If so, you will probably
find that the dual byte fields have their bytes swapped since LV always puts
these binary string representations into big-endian format. You are probably
better off just wiring the array straight into the ActiveX property or Invoke
node without any type of casting or converting. If your ActiveX server is
using strings to pass binary information and expects it to be in little-endian
order, then you can use the Swap Bytes node that is in the Advanced functions
I believe.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,679 Views)