03-20-2007 02:20 AM
03-21-2007 01:51 PM
03-21-2007 04:39 PM
Hello Abhinav,
Thank you for your reply.
I have read about DAQmx VIs now and believe I am on the right track. Thanks for the link...very helpful.
If I use the DAQmx VIs to control some of the digital outputs of the 6251s PFI lines, then hopefully I will be able to achieve rates of say 1khz, or perhaps a little slower...100khz minimum....in uncorrelated mode eg. as static writes from LV. Do you think this will be possible ?
Also, will I be able to achieve this whilst running ELVIS in NORMAL mode at the same time, as these PFI lines are unused by ELVIS ?
I will give this a try, and would appreciate any opinions on whether this is the way to go, or there is some better way which I have overlooked.
Thanks for any help,
Carlo
03-22-2007 01:52 PM
Hello Carlo.
In order to understand your application better, could you tell me what specific task you are trying to perform with these 3 digital lines? We may be able to utilize other functionality of the ELVIS depending on your application. For example, if you need to generate a pulse train, you could utilize the counters that are available on the bottom right hand side of the ELVIS board.
Since you cannot use correlated DIO, the update rate of the digital output lines will be dependent on the speed of your computer since updates will be software based. However, you should be able to do this at a fairly quick rate. Also, keep in mind that if you just wish to output a high or low, you can use the digital output lines located in the top right hand side of the ELVIS to do this.
Also, let us know how those tests go that you talked about in your last post. We would love to help you if you run into specific issues with this.
Brian F
Applications Engineer
National Instruments
03-22-2007 08:03 PM
Hello Brian,
Thanks for your reply. I must say Im impressed by the very supportive nature of this forum. As a newbie to LV & ELVIS, its encouraging to see a forum with so much help....and no flaming.
After reading many posts & tutorials, Im making some progress, but am hoping to avail myself of the expertise of this forum to take the optimum path and save some time setting up this interface.
Whilst running ELVIS in NORMAL mode (so that I can use ELVIS vi's like scope, func.gen etc), I also need to control a MCU board plugged into the ELVIS breadboard via 3 digital output lines.(no inputs needed).
These 3 lines implement a simple serial comms interface from my LV program to the MCU on ELVIS ie: enable, clock, data. I need the clock rate to be at least 200Hz.
Im using a USB-6251 (and LV8.2) and I believe I can use port2 lines which have P2.3,P2,2, P2.4, P2.5, P2.6 avail as dig outs.These lines also show up on the ELVIS protoboard at 'counters' and "Prog.Func.I/O" so I can grab them there.
I used DAQ assistant to create an earlier version of my attached VI, but Im finding it slow going to understand tasks,virtual channels etc despite having read the many info's online.
Ultimately, I need a VI which reads a knob value, U8, and outputs a brief serial stream based on that knob value to the MCU.
Im planning to bit-bash the comms using a Mathscript vi, (which Im familiar with from using MATLAB ) .ie: knob data > mathscript vi > 3 dig lines.
I imagine this app is dead simple, but the learning curve is rather steep, so any hints (or proto vi's) would be a great help.
Thanks,
Carlo
03-23-2007 01:27 PM
Hello Carlo.
It sounds like you have the right idea. Reading tutorials online and going through some example programs are great ways to learn about the power of LabVIEW. However, at this point, I think the most learning is going to be done by diving right in and trying to get something to work. You can take baby steps in getting something 'simple' to work before moving to a more complex application. I would recommend the method of divide and conquer for this application. Find something easy to do, and verify that it works. Then tackle the next little part of the application and get that working. Before you know it, you will be finished! Doing this type of programming will be great for learning as well as successful development of your application. I think you will be surprised at how easy it is to program in LabVIEW once you do this.
With that said, one of my favorite DAQmx tutorials is located here. This website has a lot of information that may prove useful for your endeavors:
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
http://zone.ni.com/devzone/cda/tut/p/id/2835
Good luck and if you have some troubles after diving in, we would be happy to help you out!
Brian F
Applications Engineer
National Instruments
05-06-2007 09:21 PM
Hello Brian & other viewers,
I have made some good progress, have it working basically and would appreciate any tips on optimisation please.
This code aims to send the values from the 8 knobs & 1 switch group as a serial stream to a DAQmx box. It takes 900 msec to complete one complete poll of all 9 devices. This is a little too slow. Profiling shows that half time spent writing to DAQmx, and half spent in my VI.
Q1) Can the knob polling be amended so that values are only sent when there is a value change ie: no knob change= no writes to DAQmx. As one knob moved, then data from that knob sent continously to DAQmx...until knob stops being changed...This would make it fast enough as I'ld be updating the DAQ about 9 time per second. Ive tried using "event" block with value change...but couldnt get it working ...any hints ?
Q2) is it faster to manipulate numbers rather than boolean arrays to construct my bit frames ? This could speed things up.Perhaps theres better ways to construct my data frames ?
Q3) How can I remove the dialog box which sets up the channel for DAQmx, and have it permanently address only port2, lines 4,5 & 6. of the DAQ box? The dialog is a remnant from the setup example.
Thanks for any help you can give,
Carlo
05-07-2007 12:58 PM
05-07-2007 05:51 PM
05-08-2007 12:12 PM