From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

How to get feed back signal in LabVIEW

Solved!
Go to solution

Hi prasad,

 

what is the expected result of this (very Rube-Goldberg-style) code part:

check.png

More Rube-Goldberg:

b := MAX(X, MIN(X, Y))
Y > X -> b := X
Y < X -> b := X
Y = X -> b := X
->
a := X * 0.48672

So the whole code snippet can be replaced by a simple multiplication of X with 0.486726…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 22
(1,017 Views)

I have attached the pic of MATLAB simulation and expected result at point (a) of your previous pic. Expected result is as per Screenshot (34) and the point (a) is described as  (voltage required to drive the FAP in Screenshot 33). and I have used only one loop here as per Screenshot(35)  

0 Kudos
Message 12 of 22
(1,011 Views)

Hi prasad,

 

I have attached the pic of MATLAB simulation

All I see are images of some SIMULINK sheets…

 

and expected result at point (a) of your previous pic.

The code snippet in my image does NOT output a waveform, it outputs a scalar value.

I don't know how you want to compare the SIMULINK waveform with the code snippet from my previous message…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 22
(997 Views)

I replaced the constants as per your suggestion but i am getting of square wave now i have attached the VI. The expected result should be sinusoidal wave for this VI. 

Download All
0 Kudos
Message 14 of 22
(993 Views)

Dear Friends,

I Have designed a model in LabVIEW. The LabVIEW program is giving some error(giving a step signal)  after i add my feedback (shift register) signal to the summation (compound arithmetic) block. i tired with inverting the summation (compound arithmetic) block at the feed back signal input, which was also not working. Please help in getting a sinusoidal waveform as the output signal. 

0 Kudos
Message 15 of 22
(952 Views)

Hi prasad,

 

is there any reason to start a new thread for the very same problem???

 

The LabVIEW program is giving some error(giving a step signal) after i add my feedback (shift register) signal to the summation (compound arithmetic) block.

I still cannot follow your problem description:

check.png

Why don't you move constants out of the loop? Why do I have to show the same code improvements again and again?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 22
(939 Views)

Dear Sir,

            I respect your suggestions and you are spending time on this. But my concern is the code is  actually not doing any operation (subtraction)  from the summation block.(which might be true) I have recreated the code as per the suggestions by you. Here what i found is  the amplitude of the waveform before entering the feedback ( which is the result point) is at approximately -350( I attached VI).  The amplitude of the waveform after the multiplication and before subtracting from the summation block is approximately -500. and after subtracting the result is still -350 where as in Matlab i get +1000 as the amplitude of the waveform. I checked the constants which are fine in both MATLAB as well as LabVIEW. I apologise for creating a new topic since i was concern about the amplitude and the signal operation. 

 

Thank You 

 

0 Kudos
Message 17 of 22
(919 Views)
Solution
Accepted by prasad145

Hi prasad,

 

I just moved the reciprocal and negate function to a different (but IMHO more logical) place:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 18 of 22
(900 Views)

If you have a compound arithmetic node set for addition, and you want to subtract one of the inputs, then right click on that input and pick invert.  (If you want to negate the output, then select the output and pick invert.)

 

If you have a compound arithmetic node set for multiplication, and you want to divide one of the inputs, then right click on that input and pick invert.  (If you want to take the reciprocal of the output, then select the output and pick invert.)

 

If you have a compound arithmetic node set for a boolean operation (AND,OR, XOR) and you want to NOT one of the inputs, then right click on that input and pick invert.  (If you want to NOT the output, then select the output and pick invert.)

Message 19 of 22
(881 Views)

@RavensFan wrote:

If you have a compound arithmetic node...


Good tips!  I've switched over almost entirely to using the compound arithmetic node in place of the dedicated primitives.  The ability to invert individual inputs or the output as a whole can save a lot of diagram clutter.  If the value I want to subtract comes from a wire up higher in my diagram, no problem.  I can invert that particular input and avoid the possible ambiguity of crossed wires!

 

Another big advantage is that it's expandable to support more than 2 inputs.  It's even nice as a more compact version of a boolean NOT when shrunk to single-input size.  Same for the arithmetic (1/x) and (-x) operations.

 

 

-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).
Message 20 of 22
(869 Views)