LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

LabView Analog Input and Analog Output synchronization

Hello,

I am developing a VI to test the capacitor of a transimpedance amplifier so what I am trying to do is generate current and measure respective output voltage and calculate gain.
The problem I am having is the read block is giving same voltage no matter what current input is, I think the problem is regarding the synchronization.

 

image.png

0 Kudos
Message 1 of 10
(171 Views)

Hi eleceng,

 


@eleceng77 wrote:

The problem I am having is the read block is giving same voltage no matter what current input is, I think the problem is regarding the synchronization.


Which synchronization are you talking about?

  • All you do is enforcing dataflow by using error wires, but just parts of the code.
  • You start the AI task before writing the AO/DO tasks…
  • You start the DO/AO task in parallel (NO dataflow dependency!) to preparing/starting the AI task…

Did you examine the example VIs coming with LabVIEW/DAQmx? There are example VIs explaining how to sync AO and AI tasks!

 

Btw. do you really need 3 error in wires and 3 error out wires, even though you already chain the DAQmx stop functions using the error wire?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(150 Views)

A TIA works with a feedback resistor  and a charge amplifier has a feedback capacitor. 

(OK, both usually have a R and a C in the feedback, however one is the effective one in the frequency range of interest šŸ˜‰ )

 

Both build a virtual ground at the input. (Well, nearly an input impedance of 0 Ohm, for real world charge amplifier I measured values from 10 to 1k Ohm (real part) and since the real world is complex ( šŸ˜‰ ) also some C or L ... )

 

If you want to characterise the transferfunction of the amplifier, you usually use a voltage source and a known (high value)   resistor to create a known current  or a known capacitor to create a known charge , both proportional the input voltage.  You can use a capacitor with a TIA (or a resistor for a charge amp) and use the dU/dt but you have to make shure that your voltage source (DAC) produce known dU/dt , what often is a step function (stair way instead of a ramp)  šŸ˜‰

 

I would recomment to read two voltages (simultanious! if you have a multiplexed ADC DAQ there will be a phase shift). 

If you want to read the output of your DAC, it is not a good idea to use the same clock edge. Due to small jitter in the DAC and ADC you might sometimes read the old or the new DAC value. Since the clock is known, the delay can be corrected.

 

Greetings from Germany
Henrik

LV since v3.1

ā€œgroundā€ is a convenient fantasy

'˙˙˙˙uıɐʃɐ lɐıp puɐ °06 ĒuoÉ„d ɹnoŹŽ uɹnʇ ĒsÉĒld 'ŹŽÉ¹Éuıƃɐɯı sı pĒlɐıp ĒŹŒÉÉ„ noŹŽ É¹ĒqÉÆnu ĒÉ„Ź‡'


0 Kudos
Message 3 of 10
(132 Views)

I am new to labview. What I thought was if I start the write block first and then read block with the help of error lines then it would work fine.
I really thought every created task requires its own error line so I used three error lines for three task created.

I tested this vi on hardware and it was showing only 5.4 V no matter what the current value was.

 

Basic flow is:
generate current using NI-9266 at the input terminal of TIA. which has settling time of 3 s, so I am sampling the read block 5000 samples with 1250 sampling rate so it will sample till 4 s. For reading the voltage I am using Ni-9205. When I checked using multimeter the current was genrating fine from 1 mA to 5 mA with step of 1 mA. So where is the problem ? 

PS: You mentioned that I am starting AI tast before AO/DO , how so ? Doesn't task starts only when both task in and error in lines reach the block ?

 

0 Kudos
Message 4 of 10
(95 Views)

Hi eleceng,

 


@eleceng77 wrote:

You mentioned that I am starting AI tast before AO/DO , how so ? Doesn't task starts only when both task in and error in lines reach the block ?


The DAQmx tasks is started when you call the DAQmxStart function.

DAQmxRead only reads the samples…

 


@eleceng77 wrote:

I tested this vi on hardware and it was showing only 5.4 V no matter what the current value was.


Did you correctly wire the AI module?

Did you verify the wiring by using a known voltage source (and maybe testpanels in MAX)?

 


@eleceng77 wrote:

Basic flow is:
generate current using NI-9266 at the input terminal of TIA. which has settling time of 3 s, so I am sampling the read block 5000 samples with 1250 sampling rate so it will sample till 4 s. For reading the voltage I am using Ni-9205. When I checked using multimeter the current was genrating fine from 1 mA to 5 mA with step of 1 mA. So where is the problem ?


Why don't you change to a more simpler approach: set the AO value, wait for 3s, then read one sample from AI!?

(Set the AI task to use "no timing", just "on demand"…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(79 Views)


Yes, i have already tried using test panels the TIA is working fine and connections are correct.
I must use Timing block, as I need to collect multiple samples.

I tried one by one now it seems problem is in read block as it is showing constant 5.4 V output 

0 Kudos
Message 6 of 10
(60 Views)

Hi eleceng,

 


@eleceng77 wrote:

I tried one by one now it seems problem is in read block as it is showing constant 5.4 V output 

The problem is not in the DAQmxRead function: it is either the way you configured the AI channel or how you wired the AI module…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(58 Views)

How should I configured it ? Please can you help ?

0 Kudos
Message 8 of 10
(55 Views)

Hi eleceng,

 


@eleceng77 wrote:

How should I configured it ? Please can you help ?


You don't provide code, just an image of a part of your code.

And the init stage is missing in that image…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(49 Views)

It worked. The issue was I did not configure the Create Virtual Channel correctly. The terminal configuration was default differential, I just changed it to RSE and everything worked as expected.

PS: Thank you for taking time to help me.

0 Kudos
Message 10 of 10
(27 Views)