Jump to content
Sign in to follow this  

Concat two INT16 to single int32

Recommended Posts

I wold like how to make two interger in single variable , with pointer index ?

Example int 1 (bin) = 1010010101010101
int 2 ( bin) = 111111111111111111
start index for 2° int    16 position
result : 111111111111111_ 1010010101010101

In VisiLogic have block for this ( vector fill) . But in unilogic not found this. You can help me.

Regards ,

Share this post

Link to post
Share on other sites

UniStream doesn't have pre-defined arrays so the functions are necessarily different.

You're showing that you want Int 2 in the upper bytes and Int 1 in the lower bytes.

I would do this old school with combination of a bit shifter on int 2 into a long buffer register and then add int 1.


Int_1 - INT16

Int_2 - INT 16

Result -  UINT32



Joe T.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this