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: 

1 input 2 output functionality?

Hi all,

 

Trying to determine if there is a select type function where instead of switching between 2 input options for the 1 output, I can have a singular input but 2 output options?

 

I'm trying to read data from a potentiometer. If the potentiometer value is above a certain limit, take a simulated signal and send it to a DAQ Express output subvi that'll send that signal on channel ao0. If the value is below that limit, send signal to ao1. 

 

That's essentially what I'm trying to accomplish. I've been successful with the first bit with comparing the potentiometer value, but can't figure out a way to do the second bit!

0 Kudos
Message 1 of 12
(2,981 Views)

Hi all,

 

Trying to determine if there is a select type function where instead of switching between 2 input options for the 1 output, I can have a singular input but 2 output options?

 

I'm trying to read data from a potentiometer. If the potentiometer value is above a certain limit, take a simulated signal and send it to a DAQ Express output subvi that'll send that signal on channel ao0. If the value is below that limit, send signal to ao1. 

 

That's essentially what I'm trying to accomplish. I've been successful with the first bit with comparing the potentiometer value, but can't figure out a way to do the second bit!

0 Kudos
Message 2 of 12
(2,950 Views)

A case structure.

 

Is this a current generation LabVIEW question or an NXG LabVIEW question?  You have both tags marked on your question.

 

Why don't you attach your code so we can see where you are at now and can suggest how to go to the next step?

0 Kudos
Message 3 of 12
(2,962 Views)

My mistake, think this is just a Labview question.

 

Here is my latest VI, I took your suggestion for case structure and came up with this. image.png

This seems to be working well, but I get the following error when my case switches from True to False or vice versa: 

"The specified resource is reserved. The operation could not be completed as specified."

 

I'm presuming I need to stop the execution of one case and THEN begin the other when doing the switching? Can you guide me further in the right direction, thanks.
 

0 Kudos
Message 4 of 12
(2,948 Views)

When you attach a picture rather than a VI , we can't inspect the hidden things. like the details that are hidden in an expressVI.

 

Do you need a "Simulate Signal" for a DC value?

 

You can't start two different tasks that talk to the same device.  That is why you have a reserved message.  You didn't give the actual error number, but my guess is that it was -50103?

 

Create one task that has both outputs.  When True, write a 5 to port A and 0 to Port B.  When False, do the opposite.  The actual Express VI will be outside the case structure.  The only thing inside will be the values.

 

Better yet, learn how to use the actual DAQmx VI's and get rid of the Express VI's.

 

0 Kudos
Message 5 of 12
(2,941 Views)

I see you are the same person as the other thread I've replied into.

 

https://forums.ni.com/t5/LabVIEW/DC-motor-directional-control/m-p/3860976#M1093890

 

It seems like you have the same end goal of driving a motor, but you've confused the issuer further by now talking about 2 different outputs.

 

Please try to solve one problem before complicating it with another.

0 Kudos
Message 6 of 12
(2,940 Views)

Hi,

 

You're correct, my end goal is to drive the motor forward/reverse depending on the delta value from my desired potentiometer reading and the set potentiometer reading that I'd control through LabView. 

 

The reason I've 2 threads open is because I'm trying to solve this problem best I know how. The 2 output technique seemed intuitive to me, which is why I wanted to test it out. Are you suggesting there is a simpler method to do it? If yes, can you guide me in that direction. 

0 Kudos
Message 7 of 12
(2,935 Views)

Why would 2 outputs be more intuitive?

 

Are you saying you are using two different analog outputs to the same motor?  If so, what do you expect the voltage at the motor to be if it sees 0V and 5V at the same time?

 

I'd suggest stop going down this path, and continue with your original message thread.

0 Kudos
Message 8 of 12
(2,931 Views)

Because my intention is to use a compare function as my input (T or F), and based on that I supply PWM with varying DC from AO0 or AO1. This will ensure that I get either forward or reverse rotation. The DC% will help me decide whether to go forward or reverse.

 

If you're suggesting that this method is not a good path to go down, could you please provide me with an alternative? I've been looking around and trying many options and I'm now out of ideas, hence my reason for posting here.

0 Kudos
Message 9 of 12
(2,926 Views)

If you are doing a comparison, that implies 2 inputs, that doesn't mean 2 outputs.

 

You should be figuring out how to spin the motor in forward and reverse using a single output, what your original thread was about.  Once you can reliably spin the motor using a simple VI, then you worry about complicating.

0 Kudos
Message 10 of 12
(2,921 Views)