Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6008 digital output signal

Solved!
Go to solution

Hello, 

 

I have to say that this DAQ assistant looks like a really great part of the software.  Unfortunately, I am developing on a Mac, and therefore do not have access to it.  I have a USB-6008 and I want to be able to independently switch the various digital output pins on and off, and I'm a little confused by all the various input types and nomenclature used.  What, for example, is the designation of a channel vs. a sample mean in the designation "Digital U8 1Chan 1Samp?"  

 

The documentation points me towards linking an 8-bit unsigned integer sample to send to the mxBase write module, but I can't find that anywhere in the palette.   This is amazingly difficult for doing the equivalent of turning a light switch on and off...

 

--Justin.

0 Kudos
Message 11 of 21
(5,087 Views)

When you specify U8, you can control 8 lines at once. This is the typical size of a DAQ port. So, it will accept any number between 0x00 and 0xFF to create a digital output. If you were to select Boolean 1Chan 1Samp, you would control a single line by using either a Boolean True/False. The type is selected with the polymorphic selector below the function.

 

Have you looked at the DAQmx Getting Started tutorial? With the limited digital I/O capabilties of the 6008, the DAQ Assistant is not needed, imho. You only need a create channel and a write/read.

0 Kudos
Message 12 of 21
(5,082 Views)

I've looked at the getting started tutorial, the problem is that there is a discrepancy between what is available with DAQmx and DAQmx Base, as applied on the mac.  I have a stepper motor controller and pulse generator, so the general function I'm trying to get is to make P0.0 high to select clockwise motion, then make P0.1 high to enable fast motion, then P0.2 needs to go high to turn the motor on.  P1.0 andP1.1 are connected to limit switches.  When one of those gets tripped, P0.2 should go low, disabling motor motion, then P0.1 goes low to enable single step motion.  The system then needs to issue single steps (P0.2 pulsing high then low briefly.)  until it hits the other limit switch, recording the number of pulses out on the X axis with the analog input on the Y axis.

 

Before you start telling me that I can't generate pulses for stepper control with the 6008, I don't need to- the way the controller is configured, if P0.1 is low, if P0.2 goes from low to high it will make the motor go exactly one step, no matter how long P0.2 is high for.  It won't move the motor again until P0.2 goes low then high, so timing is absolutely not a critical factor here.

 

The application is that this motor controls a diffraction grating in a monochromator, allowing light to be scanned across a photomultiplier tube one wavelength at a time.  When the intensity data is combined with the number of steps into the sequence it is (I will have to calibrate for wavelengths...) then I will get a complete spectrum of the light entering the monochromator.  

 

I'm starting to build this in blocks- the first one being "Can I get this motor moving until it hits a limit switch."

 

Thanks,

 

Justin.

0 Kudos
Message 13 of 21
(5,071 Views)

Im not aware of any basic differences between base and full DAQmx with somrthing as simple as a static digital write. You can assign a task to each digital line and use the Boolean 1Line/1Samp fot each logic state. Wire them up in sequnce using the error in/error out cluster. General idea shown below.

 

0 Kudos
Message 14 of 21
(5,069 Views)

What you have makes perfect sense to me, but I don't have some of those options available.  When I plug in the module for digital output, (DAQmxBaseWrite.vi) I get these options listed in the pull-down menu (Indents indicate sub-option structure):

 

Analog

Multiple Channels

Single Sample 

1D DBL

Multiple Samples

2D DBL

Digital

Single Channel

Single Sample

U8 (port format)

U32 (port format)

Multiple Channel

Single Sample

1D U8 (port format)

1D U32 (port format)

Multiple Samples

2D U32 (port format)

 

In your diagram, you have just a "Digital Output" line with a device/port/line  input going to the device.  I don't seem to have that option.  According to the DAQmx documentation, you can configure the 6008 so that the ports are addressed as a port (i.e. write an integer to the port using all 8 pins) or configure them to act as single input/output signals.  I don't have the capacity with DAQmx Base to do that, although I can see where I can configure the port mode, I don't see where it can be configured to use individual lines.  So, when I try to configure what you have in your diagram, I don't have the "Digital Boolean" option for the DAQmx digital write blocks, so I can't hook up the "True" to it- it gives me an error saying that that is not the right signal to put in to that module.

 

I've tried looking at the help files and tutorials, but they all seem to be written for DAQmx, not DAQmx Base, which this is.  It's kind of frustrating that something I could do manually with a couple of toggle switches is getting so complicated... 🙂

 

--Justin.

 

0 Kudos
Message 15 of 21
(5,064 Views)

Sorry. Use the U8 single channel single sample. Write a 0 or 1. Can't you select Dev1/Port0/Iine 0? What exactly have you tried and what errors do you get?

0 Kudos
Message 16 of 21
(5,052 Views)

First of all, thanks for taking the time with me on this one.  I really appreciate your helping me out.

 

Now I have the setup configured, with a couple of LEDs on the output pins so I can see what's going on.  I can't seem to get to a point where it communicates with the 6008 box.  I can't select Dev1/Port0/line0 anywhere- in fact, I can't select anything specific to the hardware instance plugged into the computer.  The demo software works fine, so I can talk with the 6008, but I can't seem to pull it up.  When I link the I/O block (Purple in your diagram) to the mxBase Create Channel box, there is no selection capability- I have to type it in freehand.  

 

I finally got it to a point where it will let me run the program, and it bombs out with error -200428 saying that the value passed to the Task/Channels in control is invalid, the value must refer to a valid task.  I'm not sure where the task value comes from- isn't the first block setting up the task with a task name and everything?

 

--Justin.

0 Kudos
Message 17 of 21
(5,036 Views)

Hi Justin,

 

I am attaching a link that addresses the error you are getting.  Let me know if this corrects the issue. 

 

http://digital.ni.com/public.nsf/allkb/7705D38D59EF562886256F79007E4B5A?OpenDocument

 

Justin Petry

Justin
National Instruments
Product Support Engineer - Conditioned Measurements
0 Kudos
Message 18 of 21
(5,017 Views)

Dennis,

  I am trying to do the same thing on Lab view 2012.  The Boolean symbols have changed.  Can you walk me through how to create a digital output of 5V.

Thank you,

John Charest

 

0 Kudos
Message 19 of 21
(3,729 Views)
The Boolean symbols have not really changed. When you create a Boolean control, on the block diagram you can right click and choose to View as Icon or not.

Please attach your code or provide the name of the example you are running.
0 Kudos
Message 20 of 21
(3,727 Views)