Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx task won't work in LabVIEW, but works fine in NI-MAX

Using the following:

LabVIEW 7.1 FDS
PXI-6052E (multifunction DAQ), in a PXI-1042 chassis
NI-MAX 3.1

I am currently having some problems with my DAQ application.

I have ten different inputs into my 6052 DAQ card. Five of them are differential signals, and five of them are Referenced Single Ended (RSE). I have used NI-MAX 3.1 to create 2 NI-DAQmx tasks. One task for the differential inputs, and the other for the RSE inputs.They are connected as thus:

Task: Analog Input AC
ai0 & ai8 - Differential Input 1
ai1 & ai9 - Differential Input 1
ai2 & ai10 - Differential Input 1
ai3 & ai11 - Differential Input 1
ai4 & ai12 - Differential Input 1
Note: N sample task

Task: Analog Input DC
ai5
- RSE Input 1
ai6 - RSE Input 1
ai7 - RSE Input 1
ai13 - RSE Input 1
ai14 - RSE Input 1
Note: Single sample task (On demand)

1) Firstly, is the DAQ card able to handle both Diff and RSE at the same time?

2) When I run the tasks in NI-MAX, they appear to work fine. However when I call the tasks in LabVIEW 7.1, the RSE task does not return the same values. So I am not sure as to whether I have called the tasks in the correct manner, or if it is even possible to do this. I get a 0 for the ai5, ai6, and ai7 inputs, and fine values for ai13 and ai14, which leads me to think that the DAQ card thinks it is in differential mode, and is therefore giving me dud data on ai5,6,7. I have attached the VI in question.

Can anyone shed some light on what I might be doing wrong? This is my first go at a DAQ application.

Best Regards
Chris Farmer
Electronic Systems Engineer
CPE Systems (NI Alliance Member)
Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 1 of 10
(6,180 Views)
Hello Chris,

There shouldn�t be a problem mixing RSE and differential channels together into one task.

My recommendation would be to include all of these channels into one task and just discard the data from the task that you don�t require (the extra samples from the RSE channels). I�ve written an example for you that shows how you might read these channels in a loop.

I hope this helps! Let me know if this example works better for you.

Ken S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 10
(6,175 Views)
Hi Ken,

Thanks for your prompt response.

The problem with having all of the channels in one task, is that they therefore are governed by the one sampling rate. Because I would have 10 different channels, it reduces the maximum sampling rate for each channel significantly.

So by having only five inputs to read in one task, I can get greater performance out of the DAQ card.

Regards
CF

PS I'll experiment with your example when I get a chance to use the hardware.
Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 3 of 10
(6,175 Views)
Hi Chris,

I understand why you might want to keep these channels in two different tasks.

Can you give me some more information on how you have your tasks and your external signals set-up? For instance, what is your scan rate for your differential channel task? How many samples are you reading in that task? How are your external signals connected, and especially how are they grounded? What are your input voltage ranges? What test voltages are you using to test the RSE channels?

Ken S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 10
(6,176 Views)
I Don't know if this issue has ever been resolved but I have the same problem.

1.
- Create a DAQ-Mx task in NI-Max with different analog channels
- Configure the inputs of the channels as NRSE or RSE
- Try the test panel in NI-Max
- Everything works fine

2.
- Create a small LV app with this NI-Max defined task (DAQ-Mx)
- Try the app.
- Signals behave as they are connected in differential mode
- Try again in NI-MAx. Channels measure OK

3.
- Read the channel configurations (through property nodes) of the DAQ-Mx in LV
- See that they are indeed configured as Differential and not as configured in the NI-Max


Is this behaviour by design or is this a known bug ?
Did anybody else experience this ?
0 Kudos
Message 5 of 10
(6,042 Views)
Hello Johan,

When you use the channel you in LabVIEW, you will need to explicitly specify RSE. LabVIEW settings overwrite the settings put in MAX. So if you want the settings you put in Max, then you can put a task constant on the block diagram, select the specific task, right click on the border of the constant and select Generate Code -> Configuration. This will create channels with MAX configurations and set the timing as well.
You can then verify that the mode is in fact RSE or Differential by double clicking on the configuration subvi and checking its block diagram.
Message 6 of 10
(6,018 Views)
Is this behaviour by design ?

What is the point of defining channels (and or tasks) in NI-MAX when the configurations are overwritten in Labview ?

My aim was to get rid of all the configurations in Labview and leave this to NI-Max.


best regards
Johan
Message 7 of 10
(6,004 Views)
I can't speak for NI but I would hope it was by design. I want my programs to be in charge of data acquisition - not someone who might open MAX and change things around by accident or otherwise.
0 Kudos
Message 8 of 10
(5,988 Views)
Hi Johan,

I defined a DAQmx task in MAX with two global channels (one differential, one RSE), and used the program attached to read the configuration. Using NI-DAQ 7.4, I was able to read the configuration defined in MAX (differential and RSE). Are you using any accessory with your DAQ device?

Thanks,
Lesley Y.
0 Kudos
Message 9 of 10
(5,963 Views)

Hi Ken,

I am new to LabView and I found your example code very helpful. I have a very similar problem in which I need to modify an existing code to read differential and RSE simultaneously. I followed your example, however my code doesn't work after the modifications.  I attached the original code and my  version as a jpeg.

I would very much appreciate your help.

Thanks

Ahmet

 

0 Kudos
Message 10 of 10
(4,872 Views)