05-23-2006 10:55 AM
05-23-2006 12:48 PM
Ok here is the basics:
This is my first ever Attempt at MX. I know nothing about it.
Im using TWO cards, one must use MX, the other Must use Traditional. The two cards are a PCI-6221 (scb-68) which is MX only, and The NI 4351 for PCI, which i am using With the TC-2190. The 4351 can only be used with Traditional.
Now the 4351 claims some variable bitrate, with 2.8S/sec as the minimum rate, i can't seem to get more than 1s/sec in this Vi. Perhaps too much going on? im reading 11 Temps.
In the datasheet for the 4351 board the sample rate is listed as 9.7, 8.8, 2.8 What nuber do i use? I see not explanations for the condidtions of these 3 diffrent numbers.
Am i using the MX correctly? Its my first attempt, i felt a bit odd usig the traditional index array after it. Is that the correct thing to do?
05-23-2006 01:16 PM - edited 05-23-2006 01:16 PM
Message Edited by Dennis Knutson on 05-23-2006 12:20 PM
05-23-2006 02:32 PM
Thank you very much Dennis. I value your responses even more than the ones from NI themselves!
So i will delete the extraneous means in the single sampling area.
About the writing strings, It seems as if i dont i get strange symbols in the output text file?
1.5 S/sec is the fastest value the card will allow as an input.
QUESTION: is it possible two do TWO while loops, one for the faster card, another for the slower card. In the data file the values from the faster card would change every point, but the temperture values would just repeat untill the next value came out of the loop?
Is that something you could show me how to do?
What would be the advantages of using the seperate blocks instead of the DAQ assistant? Remember you are the best programmer there is and i know almost nothing.
Are there any good labview programming books? Labview for dummies?
A slightly updated version of the VI.
05-23-2006 03:11 PM
05-23-2006 03:29 PM
05-23-2006 04:21 PM - edited 05-23-2006 04:21 PM
Message Edited by Vr6Fidelity on 05-23-2006 04:22 PM
05-24-2006 08:32 AM
05-24-2006 10:21 AM
Wow, That is quite different indeed. I owe you years of indentured servitude.
Let me see if i grasp the significance of your changes.
1. You are using MX as your primary driver for tasks such as file operations.
2. You are using For loops for almost everything. I find this interesting as i have never used one of these. I know basically what it is, it is just a cleaner way of having all my index arrays lined up. My question is this: Does this have a performance benefit? I tend to just have multiple Index arrays for the sole purpose of easy access to the data as i need to make front panel graphs and indicators for every channel.
3. Is there a reason you dont like the daq assistant? Using the explicit MX call seems to add a lot of complexity and requires skills and programming knowledge i just dont have in my toolbox yet. For instance How do the Explicit MX calls know what channels to use for each page of the for loop and what scale? It hard to visually see what goes where.
4. The most important question of all. If i were to split my simplistic VI into two loops and i wrote the output array into a local variable sent to the fast loop, the numbers written to the data file would just update as fast as the slow card but would not slow down the fast loop correct?
05-24-2006 10:50 AM
DAQmx has nothing to do with file operations. I simply replaced the DAQ Assistant with the functions that it was using. I'm more comfortable using the functions instead of the assistant and there is a slight performance benefit. I started using DAQ a long time ago and am just used to individual functions. I also like to see how things are configured on the diagram instead of opening the assistant to view or make a change. Every input to the DAQmx Create Channel inside the for loop, is an array. A for loop auto-indexes array inputs. With the first iteration, it uses the first element in each array. The second iteration uses the second element and so on. If you had the same configuration for every channel, you wouldn't need to use a for loop at all. You could also use separate, individual, DAQmx Create Channels chained together.
I'm not sure if there is much of a performance benefit to using a for loop instead of multiple index array functions. There may be but it certainly makes the diagram less "cluttered". If I need to display something, I will use an array or cluster to display everything instead of individual indicators.
If you use two separte while loops and pass the data acquired from the traditional DAQ loop to the DAQmx loop, each loop will run independently. If you choose to put the file write in the fast loop with a local variable, it will request the data from the other loop with every iteration of the fast loop whether there is a new value available or not.