Is it possible to get a symbol data type using the ActiveX API?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to get a symbol data type using the ActiveX API?

Jump to solution
1,026 Views
lucabarbiero
Contributor IV

Hi,

The ActiveX API provides a method GetSymbolInfo, which returns address and size for an input symbol name.

But I also need the data type, and I don't see any API feature to get this info.

I am using TSA tables in my embedded application, so I would expect the data type information to be available to the host.

Do you confirm this feature is missing?

 

Regards,

Luca

 
 

 

 

0 Kudos
1 Solution
994 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Luca,

you should be able to use GetSymbolInfo on the array symbol to retrieve its byte-wise size. Then you can use GetSymbolInfo on the array[0] symbol to retrieve a size of one element. Dividing the two should give you a count.

Regards,
Michal

View solution in original post

0 Kudos
4 Replies
997 Views
lucabarbiero
Contributor IV

Hi Michal,

If I may add to the backlog, it would be good to also get the length info for arrays through the API. When I generate FreeMASTER variables from an array symbol using the Windows app, it knows the length of arrays and it can generate as many variables as the number of array elements.

Just getting the length info and the start address via API would enable me to script something similar.

 

Regards,

Luca

0 Kudos
995 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Luca,

you should be able to use GetSymbolInfo on the array symbol to retrieve its byte-wise size. Then you can use GetSymbolInfo on the array[0] symbol to retrieve a size of one element. Dividing the two should give you a count.

Regards,
Michal

0 Kudos
989 Views
lucabarbiero
Contributor IV

Ok understood, that is the trick. Thanks!

0 Kudos
1,022 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Luca,

I confirm this is not possible with the current version, the GetSymbolInfo only returns address and size of the symbol or it evaluates a complex expression similarly as the Variable definition dialog does. Note that this evaluation may access multiple symbols (e.g. there can be a mix of symbol names and multiple  sizeof(x) and valueof(z) operators). This is why it is not just one symbol whose name we would return.

But I agree that in most of the cases, you are just interested in a simple symbol name lookup and in this case, returning the type name is a good idea. Added to backlog for 3.2.2 (also for GetAddressInfo).

Thanks,
Michal