From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Join Numbers VI, 8-bit, 16-bit, etc.

I am a "LabView beginner" and am tyring to process an array of data acquired into an array of 8-bit elements. I'm using a PCI-DIO-32HS and ports 0 and 1 make up a 16-bit word. I am successfully reading in the data and it is being written to an array of 8-bit values. Element 0 is the LSbyte, 1 is the MSbyte, 2 is the next LSbyte, etc. I then have a loop that uses the "join numbers" vi in Labview. I address element 0 and element 1 with separate vis, and then send the result the join numbers vi to create the 16-bit result (the join numbers vi performs the arithmetic shift for you).

I have a lot of data and this loop takes quite a bit of time. Is there a faster way of doing this? Is there a way to read into into an array with
the 16-bit number already available? I suspect that there may already be a convenient way to avoid this. If not, a function of this type should be added to Labview.

I have looked into the group read vi's, etc., but it seems as if this is the only way to acquire 16-bits of data.
0 Kudos
Message 1 of 4
(3,636 Views)
Hello;

At this time, Labview still doesn't have a function which does that.
I'm attaching a Labview example VI which does that, so you can compare both methods and use the one is faster.
Hope this helps.
Filipe
0 Kudos
Message 2 of 4
(3,636 Views)
I appreciate the help, but for some reason I can't seem to open your Labview vi. I am running 5.1 and this may be the reason. Can you send me a different version of the vi? I get a "resource not found" message. Anyones help would greatly be appreciated.
0 Kudos
Message 3 of 4
(3,636 Views)
Another and probably faster method to convert the U8 array to a U16 array is to use the Type Cast function(Function Palette>>Advanced>>Data Manipulation) in LV. Simply typecast the U8 array to U16 by passing a U16 array constant into the center input of the Type Cast function.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 4 of 4
(3,636 Views)