Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

How to perform bit-wise digital input / output in LabVIEW with a...

Expand / Collapse
 

How to perform bit-wise digital input / output in LabVIEW with a USB-2408 or USB-2416


The USB-2408 series, as with the USB-2416 series, has a somewhat unique (to MCC) digital I/O architecture.   Each bit in the 8-bit port can be used as an input or output, and the software does not need to set the direction of the bit before using it.  



Overall, using ULx to access a subset of bits in a port can be a tad tricky.  An example has been developed (see attached) using NI LabVIEW 2009 and ULX 2.0.   The example is named:  "Write any two DO bits individually WHILE reading any DI bits individually  USB-2408.vi".  The example uses an individual task per bit.   It demonstrates 2 input bits and 2 output bits, but the user can expand the idea to be a total of 8 bits.

Alternatively, ULx does not need to be used for DIO, in favor of calling the DOT.NET layer of the UL directly, namely MCCDAQ.DLL (located in the folder where InstaCal is installed into).  This calls the same functions that C# and VB.NET would call.   An example of this is also attached, named "USB-2408 DIO DOT NET bitwise example.vi"   This example was created in NI LabVIEW 8.6 without and ULx.  Since this approach is not task based, it may be a bit less cumbersome.  



These two examples were tested on a USB-2408, but should work without changes on a USB-2416

 



Rate this Article:
Tags:

Attachments



Add Your Comments


For comments email TechSupport@mccdaq.com.

Details
Article ID: 50354

Last Modified:5/14/2012 9:23:36 AM

Article has been viewed 13,070 times.

Options