From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to read what the analog out task is set to when starting a vi?

Hey Fancy Folk,

 

TLDR; When starting up a VI, can I query an analog out card to get what its set to?

 

Background:

I have a main VI to run a durability test on a piece of hardware.  I am using a secondary VI which sets the brake to the desired torque before running the main VI. I set the torque via an analog out voltage going to the brake's power supply which generates the desired torque.  Digressing, these two VIs are separate and the secondary does not interface with the main nor does the main call the secondary VI at any point.

 

We are using LV 2015 and MAX 15.0 on the durability tower.

 

Question:

When I start my main VI, can I query my analog out card to get what the voltage is set to?  Ideally, I'd prefer for it to be already scaled, but I'm 99% sure I can also get my scale used for the brake torque task programmatically and scale accordingly. 

 

Thanks,

Matt

Attention new LV users, NI has transitioned from being able to purchase LV out right to a subscription based model. Just a warning because LV now has a yearly subscription associated with it.
0 Kudos
Message 1 of 6
(1,136 Views)

Hi Matt,

 


@Matt_AM wrote:

I have a main VI to run a durability test on a piece of hardware.  I am using a secondary VI which sets the brake to the desired torque before running the main VI. … Digressing, these two VIs are separate and the secondary does not interface with the main nor does the main call the secondary VI at any point.

 

When I start my main VI, can I query my analog out card to get what the voltage is set to?


Well, IMHO it would make more sense to call that "secondary VI" from your main VI…

 

To answer your question:

  1. I didn't find a suitable DAQmx channel property to read back the AO voltage. You may look for this option longer than just 30s like me…
  2. You may connect an AI with your AO to read the actual voltage…
  3. Or you just call that 2nd VI from your 1st VI…
Best regards,
GerdW


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

@GerdW wrote:

To answer your question:

  1. I didn't find a suitable DAQmx channel property to read back the AO voltage. You may look for this option longer than just 30s like me…
  2. You may connect an AI with your AO to read the actual voltage…
  3. Or you just call that 2nd VI from your 1st VI…

I would need to verify, but I think you can just do a DAQmx Read on an AO.  I'm fairly certain I have done it for DIO (or maybe that was just on an FPGA board?).  Time to play!

 

EDIT: Nope.  This does not work for Analog Outputs.  It does work for the DIO though.  I verified with a simulated USB-6212.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(1,123 Views)

I second what GerdW already said.

 

Big Picture:

1. An overall app that depends on a variable braking force/torque should have a means for *setting* that brake to an intended value.

2. Since this only covers the *input* to the brake, one would usually also *measure* the actual braking resistance with a force/torque transducer.

 

I'm pretty sure there's no property node that can be queried to discover the present value of the AO voltage.  If you're using a dedicated AO-only device, you'll need to physically wire to an AI device.   If you're using a multifunction device, there's a trick for using an AI task to measure AO without physical wiring.  Here's one place I described it before. 

    Note that normal AI rules apply -- if you've got other AI measurements going on in an AI task, this special channel needs to be included in the task.  You won't be allowed access to the A/D converter from 2 different AI tasks at the same time.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 6
(1,121 Views)

@GerdW and @Kevin_Price,

 

I agree 100% that I should be setting the brake with the main program. I've brought the issue up to the project lead, but he has been adamant that he wants it to be a secondary vi that we run before running the main vi.  He wants us to set the brakes then verify them with a torque wrench that the brakes are set properly.  We also have a load cell to verify the torque set by the brake...   And I created a scale to set the brakes based on slowing ramping the voltage and using a torque wrench to create a proper scale for voltage out to torque...  But that's a whole different can of worms. 

 

@Kevin_Price,

 

I like the idea of routing the analog out to an analog in via internal card linking.  I'll have to take a look at my card later tonight to see if I have the ability to do that.  I do have a PXI chassis and I could route the analog out task to a trigger line and have an analog in read from that trigger line. 

 

@crossrulz,

 

Bummer to hear.  I figured it wouldn't have been as simple as setting the AO to an AI.  Maybe if it was on one of the Analog PFI lines, but I'm pretty sure those lines when switching from output to input reset the voltage on them to 0 before starting to read.  

Attention new LV users, NI has transitioned from being able to purchase LV out right to a subscription based model. Just a warning because LV now has a yearly subscription associated with it.
0 Kudos
Message 5 of 6
(1,109 Views)

FYI, PXI trigger lines are only for digital signals (typically timing-related like clocks and trigger pulses), not analog.  You won't be able to route an analog signal from AO device to AI device over the PXI backplane, you'll need external wiring.

 

Just letting you know before you waste time pursuing it.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 6
(1,092 Views)