LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making the digital outputs automatic

0 Kudos
Message 1 of 31
(3,773 Views)
Please use the message body to provide some details on your question. The subject alone has no meaning.
0 Kudos
Message 2 of 31
(3,753 Views)
the problem is that i want to make a program so that instaed of controlling the digital outputs manually I will do this automatically but in a certain sequecne.
if there is any ideas let me know
Also i am wondering how i can control the number of peices of data written to a xml file so instead of haveing a 1000s of values then i will only have 32 for example
thanks
Mike
0 Kudos
Message 3 of 31
(3,751 Views)

I assume that you mean the digital outputs of an NI DAQ board. What you want to do is pretty simple. One place to start is with the shipping examples. One for digital output is called Write Digital Channel. You can replace the while loop with a for loop and move the Data to Write Boolean array to outside the loop. You can then make the 1D Boolean array a 2D array. With each iteration of the loop, the DAQmx Write will send the pattern you specify. The Boolean array can be edited for the patterns you want and then you can use Edit>Make Current Values Default and save the VI. Or, on the diagram, you can right click on the indicator and select Change to Constant. Your diagram would look something like the one below.

I'm not sure what you mean by controlling how many pieces of data to write to a file. Where is the data coming from and what functions are you using to write? Attaching any code you've written will help someone understand the issue.

You might also want to look at the Learning LabVIEW resources available at http://www.ni.com/academic/lv_training/how_learn_lv.htm. Your first question indicates that you need an introduction to some of the basics

Message Edited by Dennis Knutson on 06-17-2007 12:08 PM

Message Edited by Dennis Knutson on 06-17-2007 12:09 PM

Message 4 of 31
(3,749 Views)
Thanks Dennis!

Mike, the solution that Dennis provided only works with certain NI devices.  Could you tell us what hardware, software, and a operating system you're working with?  Specifically I'd like to know:
  • Development environment (LabVIEW, CVI, MS Visual Studio, etc.)
  • Driver (NI-DAQmx, NI-DAQ, etc.)
  • Device (USB-6009, PCI-6259, PXI-6221, etc.)
  • Operating System (Windows XP, Windows Vista x86, SuSE Linux, etc.)
I also recommend that you read through the Getting Started with NI-DAQmx tutorial portal.  The Basic Programming with NI-DAQmx section will probably be most useful to your application.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 5 of 31
(3,708 Views)
hello the device that i am using is the USB6008, the operateing system is the windows XP, the software is 8.2
is there a way i can make this work withthe USB 6008 so that the outputs will come one automatically and in a certain sequence?

Thanks
Mike
0 Kudos
Message 6 of 31
(3,707 Views)
Hi Mike -

Unfortunately, the USB-6008's digital I/O and analog output lines cannot be correlated to a clock.  This means that you can't make the hardware write the values automatically (using a clock).  Instead, you'll have to write a program that uses DAQmx to write each value to the line individually.  This is called software-timed digital output.

The tutorial I linked above will give you the information needed to write the program.  You can also probably search the forums (especially the Multifunction DAQ forum) for "6008" and find some code that other people have already written.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 7 of 31
(3,695 Views)
Hi David

just so i am understanding you correctly you are saying that there is no way to turn the Digital outputs on and off automatically and in a certian sequence with the USB 6008 DAQ board. Is not correct?
If so then could you help me with another problem that being is i do have to do this manually can i set the write to measurement file block so that when there is a change instead of having 1000s of peices of data i can only have 32 for example

Thanks
Mike
0 Kudos
Message 8 of 31
(3,693 Views)

It is not correct to say that you cannot control the digital lines automatically. I don't have a USB-6008 but I don't see any reason why you can't use the example I posted. It is setup for on-demand digital output which is all that your device is capable of. You don't have very precise timing of the output but you can certainly specify a series of patterns. There would be very little sense to have a programming language such as LabVIEW if you had to manually do very basic tasks like you describe.

You don't modify or setup the Write to LabVIEW Measurement file. You modify the data that you pass to it. You don't mention what is acquiring the data, or how how it's being acquired, the data type being acquired, and you didn't post any code. There are several ways to get a subset of data. One is called Array Subset. The other obvious question is that if you don't want 1000's of pieces of data, why are you aquiring that much in the first place instead of just 32.

0 Kudos
Message 9 of 31
(3,684 Views)
hey there
Okay here is the breakdown of the project that i am useing the DAQ board for.
I am to controll 6 different FETs each either controlling a relay or resisotr to create a load for a solar panel.
I am doing this from the digital outputs on the DAQ board.
On the analog side I am reading the 2 voltages one ot repersent the actual votlage of the panel and another the surrent of the panel.
For the logging of the Data i am using the Write to measurement File from labview and th signal that is beinging filed is from the DAQ assistant where i set two channels again both for a voltage.
now the problem is that as i stated before I want to have this so that when run is pressed the outputs will come on and off in a certian sequence that i make.
also i want to make sure that the data that is beings stored is will be when ever there is a change in either voltages.
I have also tryed the code that was given by you dennis and  I saw nothing. maybe i was doing something wrong
I would still like to keep gettting the help this is very helpful for myslef for i am just learning this program on my own

Thank you
Mike
0 Kudos
Message 10 of 31
(3,674 Views)