Displaying Max/Min values with time for analog signals.
I am sampling analog inputs. I simply want to display the max and min values with the time they occurred. This seems simple but I am new to LabView and can't find a Vi to do this.
Here's the code. When you run the demo program, you'll see three traces: Green is the max so far, Red is the min so far, and White is the current signal value.
As the input value cycles, you'll see the two limit values track its extremes. If you have any questions about how it works, just holler.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Attachments:
min-max_plotter.vi 82 KB
min-max_tester.vi 37 KB
Similar Messages
-
Hi,
I am trying to find out the latest delivery date(EINDT) for each purchasing document (EBELN) through graphical way.
The view contains other fields apart from the above mentioned two fields.
When only the two fields (EBELN, EINDT) are there, then in semantics, I can select 'Max' as aggregation to get the maximum value for each document.
If I do like this, then I need to join more than 3 views and also so many joins in calculation view. Taking so much time for data preview.
Hence , please help me in getting the solution while the view contains other fields also.
Thanks in advance.
Thanks,
JyothirmayiHi Sreehari/Vinoth,
Thank you for your replies.
if only two fields are then I can get the max/min values of one field corresponding to other field.
But more than two fields are there with different values, then let me know how to find out the max/min value of a particular filed corresponding to the 2nd field with other fields also should be in the output.
I hope you understood my issue.Please revert in case of questions.
Thanks & Regards,
Jyothirmayi -
I get home after buying my ipad mini play with it for a bit then try to sync my songs, movies and photos on and it syncs fine. I then look back at the ipad and seem to find on the top right saying " not charging ". I read other forms and people also struggeling with the same problem. My computer dose'nt have enough power. There must be another way for me to get to charge my ipad mini from my computer. It works fine charging it in an outlet. any ideas??!
The quickest way (and really the only way) to charge your iPad is with the included 10W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
How to Calibrate Your Mac, iPhone, or iPad Battery
http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
Also, if you have a 3rd generation iPad, look at
Apple: iPad Battery Nothing to Get Charged Up About
http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
New iPad Takes Much Longer to Charge Than iPad 2
http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
Extend iPad Battery Life (Look at pjl123 comment)
https://discussions.apple.com/thread/3921324?tstart=30
New iPad Slow to Recharge, Barely Charges During Use
http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
Tips About Charging for New iPad 3
http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
How to Save and Prolong the battery life of your new ipad
https://discussions.apple.com/thread/4480944?tstart=0
Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
iPhone, iPod, Using the iPad Charger
http://support.apple.com/kb/HT4327
Install and use Battery Doctor HD
http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
Cheers, Tom -
How should i do?when i use the sc2345 for analog signal acquired!
please help me!
I have to use the sc2345+NI6221 for analog signal acquired. but i don't have a analog input module such as SCC-AIXX.
So I want to pass the signal to the DAQ device. how should i do to connect the wire on the sc2345?
how can I use the sc2345 for a pass connector?
Thank you very much and look forward to your reply...
Solved!
Go to Solution.What kind of signal do you want to acquire?
If it does not need any conditioning, then, you can connect the signal to 6221 with a terminal block such as SCB-68.
Best regards,
NISH AE Haiping.Fei -
Is there an easy way to make JSpinner wrap around at max/min values?
I have several pages with a couple dozen JSpinners to set various values - mostly numeric, but some are not.
I would like to make them wrap around when either the max or min values are reached.
Is there an easy way to do this?
I was hoping for something like an "enableWraparound" property, but I haven't found such an animal.
I suspect I could add value change listeners to all the components and do it by brute force,
but there are too many spinners scattered around to make that an option I would like to take.
Any suggestions?
Thanks.Ok, it looks like custom spinner models are the way to go.
Hopefully, I can create a couple that are generic enough to meet my requirements without too much pain.
It looks like the ones I have already created will be easy enough to modify.
Thanks for the feedback. -
Multidimensional NSArray: How to find min value with valueForKeyPath ?
Hi,
I've setup a multidimensional NSArray with columns and rows. The data is read from a file and are float values.
I can easily access the data like this:
NSLog(@"Row[0][0] %f", [[[rows objectAtIndex:0] objectAtIndex:0] doubleValue] );
NSLog(@"Row[0][1] %f", [[[rows objectAtIndex:1] objectAtIndex:0] doubleValue] );
NSLog(@"Row[0][2] %f", [[[rows objectAtIndex:2] objectAtIndex:0] doubleValue] );
etc.
However I don't know how to get the min/max values for a column in a 2 dimensional NSArray.
With a simple NSArray it's easy to retrieve the min/max value:
NSArray *array = [NSArray arrayWithObjects:[NSNumber numberWithInt:16], [NSNumber numberWithInt:4], [NSNumber numberWithInt:128], nil);
NSLog(“Min value : %@", [array valueForKeyPath:@"@min.intValue"]);
Now, does someone know how to retrieve min/max values with valueForKeyPath: ?
Any help is greatly appreciated.
Cheers,
Gilles#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSMutableArray * array = [[NSMutableArray alloc]init];
NSMutableArray * another = [[NSMutableArray alloc]init];
NSNumber * num1 = [NSNumber numberWithFloat:1.1];
NSNumber * num2 = [NSNumber numberWithFloat:1.2];
NSNumber * num3 = [NSNumber numberWithFloat:1.3];
[another addObject:num1];
[another addObject:num2];
[another addObject:num3];
[array addObject:another];
NSLog(@"%@",[[array objectAtIndex:0] valueForKeyPath:@"@min.floatValue"]);
[another release];
[array release];
[pool drain];
return 0;
Maybe I'm not 100% clear on the question your asking, but doesn't the above code get the min(or max if you wanted) value for the second array -
How to Display MAX, MIN and AVG in ALV
Hello Friends,
Can some one help me with MAX, MIN and AVG in ALV..
I am displaying a screen with ALV.. it displays 3 columns..
below every column i have done .. summatation with the help of
FIELDCATALOG-DO_SUM = 'X'.
is there any way in which i can find out MAX, MIN and AVG of each column ?
Thanking you in Anticipation.
Best Regards,
Jitesh PNO at the bottom of the screen ..
Just below the summation.
column 1 column2 column3
10 20 30
11 21 30
12 22 30
Sum 33 63 90
Max 12 22 30
min 10 20 30
AVG 11 21 30 -
I have Table test with columns
name value values_date
A 40 01/08/2010
A 10 02/08/2010
A 10 03/08/2010
A 10 04/08/2010
A 20 03/08/2010
A 50 02/08/2010
A 50 03/08/2010
A 50 04/08/2010
B 100 01/08/2010
B 10 02/08/2010
B 20 03/08/2010
B 10 01/08/2010
B 100 11/08/2010
B 100 12/08/2010
B 100 13/08/2010
insert into test values('A','40','1/8/2010');
insert into test values('A','10','2/8/2010');
insert into test values('A','10','3/8/2010');
insert into test values('A','10','4/8/2010');
insert into test values('A','20','3/8/2010');
insert into test values('A','50','2/8/2010');
insert into test values('A','50','3/8/2010');
insert into test values('A','50','4/8/2010');
insert into test values('B','100','1/8/2010');
insert into test values('B','10','2/8/2010');
insert into test values('B','20','3/8/2010');
insert into test values('B','10','1/8/2010');
insert into test values('B','100','11/8/2010');
insert into test values('B','100','12/8/2010');
insert into test values('B','100','13/08/2010');
I want OP like
name min_value min_value_date max_value max_value_date
A 10 02/08/2010 50 04/08/2010
B 10 01/08/2010 100 13/08/2010Santosh.Minupurey wrote:
Hi.....
try dis,
SQL> SELECT A.NAME,A.VALUE,MIN(A.V_DATE),B.VALUE,MAX(B.V_DATE)FROM TEST A,TEST B WHERE
2 (A.NAME,A.VALUE) IN (SELECT NAME,MIN(VALUE) FROM TEST GROUP BY NAME) AND
3 (A.NAME,B.VALUE) IN (SELECT NAME,MAX(VALUE) FROM TEST GROUP BY NAME) GROUP BY A.NAME,A.VALUE,B.VALUE;
NAME VALUE MIN(A.V_DATE) VALUE MAX(B.V_DATE)
A 10 2/8/2010 50 4/8/2010
B 10 1/8/2010 100 13/08/2010Regards,
Santosh.MinupureyHere is another way using the FIRST and LAST functions
SQL>select name,
2 min(value) min_value,
3 min(v_date) keep (dense_rank first order by value) min_value_date,
4 max(value) max_value,
5 max(v_date) keep (dense_rank last order by value) max_value_date
6 from test
7 group by name;
N MIN_VALUE MIN_VALUE_D MAX_VALUE MAX_VALUE_D
A 10 02-AUG-2010 50 04-AUG-2010
B 10 01-AUG-2010 100 13-AUG-2010For more info, check http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/analysis.htm#i1007059 -
Oracle 10g database
I have 2 rows in table
at_id
emp_id
at_date
time_in
time_out
status
00041
14/06/2013
0925
02
25
00041
14/06/2013
1400
02
I want to select Min(time_in) value with all column.
if I write this query all row shows:-
select at_id,emp_id,at_date,min(time_in) timein,time_out,status from t
group by at_id,emp_id,at_date,time_out,status;
I need
at_id
emp_id
at_date
time_in
time_out
status
00041
14/06/2013
0925
02You could try analytics as well:
with xx as ( select at_id,emp_id,at_date,time_in,time_out,status,
row_number() over (partition by at_id, emp_id, at_date, status
order by time_in desc nulls last ) rnum
from t)
Select at_id, emp_id, at_date, time_in, time_out, status
from xx
where rnum = 1; -
I want to display one column values with multiple symbols
i am created one report.
my column name is offshore & on shore i want display 3 values with % symbol, then i want show 4 th value as $ 2000,
but it was allowing only one format $ or % but i need to display symbols with my values.Try the following :
give a name to the following formula like @getvalue
Numbervar x;
if
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("ANI"), CurrentSummaryIndex) = 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Offshore Other"), CurrentSummaryIndex) = 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Syntel"), CurrentSummaryIndex)= 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Employee"), CurrentSummaryIndex) = 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Contractor"), CurrentSummaryIndex) = 0 and
//(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Mgt consult"), CurrentSummaryIndex) = 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Clerical"), CurrentSummaryIndex) = 0 and
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Other"), CurrentSummaryIndex) = 0
then
x:=0
else
x:=(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("ANI"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Offshore Other"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Syntel"), CurrentSummaryIndex))
(GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("ANI"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Offshore Other"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Syntel"), CurrentSummaryIndex)+
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Employee"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Contractor"), CurrentSummaryIndex) +
//GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Mgt consult"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Clerical"), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("Other"), CurrentSummaryIndex)
) * 100
Now create a new formula and check the value of the above formula :
if {@getvalue} > 50 Then
"$"&{@getvalue}
else
{@getvalue}&"%"
Hope this will resove the issue.
Thanks,
Sastry -
Hi all
create table temptable(MSISDN int,topupvalue float,topupdate date)I want to fetch msisdn,max(topupvalue),topupdate,min(topupvalue),topupdate from temptable
insert into temptable values (13212324,12.00,'11-JAN-2012');
insert into temptable values (13212324,5.00,'10-JAN-2012');
insert into temptable values (13212324,6.00,'8-JAN-2012');
insert into temptable values (13212324,7.00,'1-JAN-2012');
insert into temptable values (13212324,1.00,'16-JAN-2012');
insert into temptable values (13212325,11.00,'11-JAN-2012');
insert into temptable values (13212325,35.00,'10-JAN-2012');
insert into temptable values (13212325,56.00,'8-JAN-2012');
insert into temptable values (13212325,77.00,'1-JAN-2012');
insert into temptable values (13212325,81.00,'16-JAN-2012');I want to get msisdn it's max topup value and corresponding topupdate ,min topup value and it's corresponding topupdatetry this [not tested]
select
msisdn,
max(max_topupvalue) max_topupvalue,
max(max_topupvalue) max_topupvalue,
max(min_topupvalue) min_topupvalue,
max(min_topupdate) min_topupdate
from
select
msisdn,
maxtv max_topupvalue,
case when topupvalue=maxtv then topupdate else null end max_topupdate,
mintv min_topupvalue,
case when topupvalue=mintv then topupdate else null end min_topupdate
from
select
msisdn,
topupvalue,
max(topupvalue) over (partition by msisdn) maxtv,
topupdate,
min(topupvalue) over (partition by msisdn) mintv
from
temptable
group by msisdn -
Find the abs(max/min) value error.
Hi, SAP experts
Now I want to find the Abs(max) and Abs(min), (you know, for the displacement, if we want to find the max and min, we have to consider it both "+" and "-"), I use the code:
local numbervar i;
local currencyVar min;
local currencyVar max;
For i := 1 to GetNumRows-1 do
If i = 1 then
min := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
max := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
else
If Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex)) <= Abs(min) then
min := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
If Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex)) >= Abs(max) then
max := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
if CurrentFieldValue In [max, min] then
crBold
else
crRegular
But it seems not correct, why?Hi Hu,
See if this works:
local numbervar i;
local currencyVar min;
local currencyVar max;
For i := 1 to GetNumRows-1 do
If i = 1 then
min := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
max := GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex);
else
If Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex)) <= Abs(min) then
min := Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex));
If Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex)) >= Abs(max) then
max := Abs(GridValueAt(i, CurrentColumnIndex, CurrentSummaryIndex));
if Abs(CurrentFieldValue) In [max, min] then
crBold
else
crRegular
-Abhilash -
Hello,
I am relatively new to LabVIEW. I am working with a device which sends out an analog signal (4-20mA) that is time coded with 6 pulses. I need to program LabVIEW to read the values of the 6 pulses, or really 5 because the first pulse is an identifier, see the attached pdf file.
The signal starts with a 20mA signal for 2 sec; this is the identifier signal. There is a pause for 2 sec and then the first of five signals, which are transmitted for 2 sec each with a 2 sec pause. At the end of the sixth signal there is a 30 sec pause (4mA). The identifier pulse will always be 20mA but the five other signals can vary in amplitude. I need assistance in reading these five signals; from here I can scale the mA value to what I want.
I am working with LabVIEW 8.2 and I am using an ENET 9219 module. I can acquire the signal graph it, display the value etc and I can also trigger off the first pulse, but the rest is proving to be difficult.
Thanks for your help!
Brian
Attachments:
analog signal.pdf 37 KBTo get an idea of what the signal values are take a look at the spreadsheet and the short code to generate the sample data. At the end of the last pause (30Sec) the signal repeats again, starting with the 20mA identifier pulse. This devise is a fluid monitoring sensor for hydraulic oil. The idea is to have this continuously read data and display all 5 signal values. Display does not need to be instant, as with temperature and or pressure readings.
I tried to use the Get Waveform Subset, but experienced an error. I was trying, as a simple test, to see if I could manually trigger the start of the recording when the 20mA pulse came up. When I trigger how do I get the subset to start from 0 on the time line? If I could start from 0 every time I could read from the approporate time (t) to read the value at y.
Thanks.Brian
Attachments:
SampleData.xls 29 KB
short code1.pdf 36 KB -
How to introduce dead time in analog signals?
Hi, I'm new to LabVIEW and I want to introduce a dead time in the analog signals that I have attached in this post. The time difference varies, so I could not introduce a time delay in the signal
for instance, the attached waveform, i want the first signal to be seperated from the second signal. so i got 2 different signal at the end of the day for analysis. during the no signal time no signal is not recorded.
thanks in advance for all the help
Attachments:
Time delay.JPG 37 KBHi skydew,
It is possible to introduce a delay in an analog output. This is best done by specifying a trigger and then beginning the output when that trigger occurs.Below is a link to an example program developed for LabVIEW that waits a specified number of seconds and then triggers analog output to begin.I think this is what you mean as dead time.Take a look at this example and try to build from it for your code. If you have any further questions on this issue, let me know.
Analog Input with Delayed Analog Output
Also see some links below:-
http://forums.ni.com/t5/LabVIEW/Finding-the-time-delay-between-two-signals/td-p/2125100
http://forums.ni.com/t5/LabVIEW/calculating-time-delay-between-two-signals-aquired-from-DAQ/td-p/849...
Thanks as kudos only -
New solution for Limit the value in JSpinner with changable max/min value
I have ever stuck with a problem like that :
1. My application need to get two int value A and B that user input.
I use two JSpinner with Number format model.
named in jSpinnerFrom (A value get from) jSpinnerTo (B value get from)
2. The request is that :
two value can be any Integer, But the value of (B - A) can not more than 1000.
I use changeListener added into the JSpinner, when use set value make (B-A) larger than 1000, I set value back.
But when user press mouse on arrow button, the value will be increase automaticaly, and at last the value can not set back that make (B-A) not larger than 1000.
3. So I get the BasicArrowButton of the jSpinnerFrom and jSPinnerTo,
and add a mouselistener on the arrowbutton. When mouseReleased, then chen the value (B-A), if it is larger than 1000, then set it back the proper value.
Thus I can make the min/max value in the JSpinner be changable, and limit the two input value be in range of 1 - 1000
Post this wish be help for any one has thus familar request.
Good Luck!!Something like this might work
import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
class Spin extends JFrame implements ChangeListener
JSpinner spinner1;
JSpinner spinner2;
JPanel jp;
public Spin()
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(200,75);
setLocation(400,300);
spinner1 = new JSpinner(new SpinnerNumberModel(1000, 1000, 9999, 5));
spinner1.addChangeListener(this);
spinner2 = new JSpinner(new SpinnerNumberModel(0, 0, 1000, 5));
jp = new JPanel();
jp.add(spinner1);
jp.add(spinner2);
getContentPane().add(jp);
public void stateChanged(ChangeEvent ce)
int s1 = ((Integer)spinner1.getValue()).intValue();
jp.remove(spinner2);
spinner2 = new JSpinner(new SpinnerNumberModel(s1-1000, s1-1000, s1, 5));
jp.add(spinner2);
validate();
public static void main(String[] args) {new Spin().setVisible(true);}
}
Maybe you are looking for
-
Unable to download new songs from iTunes
I have iTunes 7.6.2 and when I plug in my iPod I get 'syncing' then 'its ok to disconnect' message and I'm unable to download new songs I just bought. I tried this on 2 computers and the same results. One is running XP Pro SP1 and one is running Vist
-
new tab is not working properly.ie.,i can not open new tabs in firefox.
-
T61 Persistent Graphics Driver Failure
Last November my Lenovo Thinkpad T61 died. I was able to wipe it and reinstall Windows, but it would only work with an external monitor. So it's working fine with an external monitor and I update Windows fully and then it stops working with the exter
-
GET_FILE_NAME ERROR
Hi All We used GET_FILE_NAME to convert the data into XL sheet using Foms6i.But when we migrate this form into Forms 10g Application Server.i.e 9.0.4 Version,it gives an error.In that server GET_FILE_NAME is not supported. we used GET_FILE_NAME like
-
Importance of EK01 in Sales order costing
Hi all, What is the importance of EK01 in sales order costing and what is the diff between Ek01 and EK02. Thanks