User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » LabView Page 1 [2], Prev  
Chance
Suspended
4725 Posts
user info
edit post

Seriously, be honest, you were afraid of learning something knew because you didn't know if you'd succeed. That and the thought of trying to undue someone elses shit just frustrated and bored the hell out of you. Believe me, I understand.

You never answered the question, did you re-write the system or did you tell your bosses you couldn't do it and they just said fuck it we'll eat the test time hit?

2/21/2011 5:50:00 PM

joe_schmoe
All American
18758 Posts
user info
edit post

Quote :
"trying to undue"

2/22/2011 6:22:30 PM

Chance
Suspended
4725 Posts
user info
edit post

Awww, you're dodging having to admit your failure by pointing out a grammar misteak. How grown up and ultra engineer of you you little tigershark.

2/22/2011 9:00:11 PM

joe_schmoe
All American
18758 Posts
user info
edit post

Quote :
"a grammar misteak"

2/22/2011 10:38:35 PM

Chance
Suspended
4725 Posts
user info
edit post

Quote :
"it was on porpoise"

2/23/2011 6:33:01 AM

dweedle
All American
77386 Posts
user info
edit post

**basically fairly new to labview**

What is the best method for obtaining data from a sensor and creating an alarm based on that data

for instance, i have 2 voltage outputs being read (have that working fine) but i want if those voltage output values do not leave a certain control limit after a set amount of time, an alarm message is generated

is the best method to have the data fed into a spreadsheet file, and have that spreadsheet file recalled by the labview program or does labview have a spreadsheet system built into it?

3/3/2011 2:55:11 PM

ncsubozo
All American
541 Posts
user info
edit post

I don't know if I completely understand your problem. Are you saying if your sampled value stays above X volts for more than Y seconds you want to throw an alarm? If so, off the top of my head I would do something like this...

Quote :
"
Previous_State = FALSE

Sampling Loop
Voltage = sampleVoltage()

If(VOLTAGE > X && Previous_State==FALSE){
Previous_State = TRUE
Start = getTimems
}
If(VOLTAGE > X && Previous_State==TRUE){
TimeDelta = GetTimems - Start
If(timeDelta > Y) Alarm = true
}

if(VOLTAGE < X && Previous_State==TRUE)
Previous_State = FALSE
"


I would use shift registers to pass all of variables between iterations.

3/3/2011 3:27:00 PM

Chance
Suspended
4725 Posts
user info
edit post

^^ Not nearly enough info about your particular setup to say.

1) What hardware are you using now?
2) Is this an application running doing other tasks or is it a single VI dedicated to measuring this sensor and throwing up a flag if it gets data it doesn't like?
3) The data? Is this a separate requirement from the alarm? You can save data in all sort of formats in Labview from .tdms to directly into .xls, etc.

3/3/2011 4:22:46 PM

dweedle
All American
77386 Posts
user info
edit post

ive done the saving data to .xls stuff ... whenever i try to open the file, it gives this warning thing about the format (vague i know, i cant generate one now because im moving the DAQmx to a new computer) but if you click Yes it opens up.

card is a PCI 6221 (37-pin) and ive been using LV 8.5 but this computer was updated w/ 2009


say i have a sensor that provides 2 voltage readings. I'm not concerned about the value of each reading itself, but if the reading stays within a set of limits (say +/- 200 mV), then it will keep track of the time that has accrued while within those limits. If that time reaches X amount of minutes, then an alarm occurs. If the voltage reading escapes those limits, then i want the accrued time to be reset back to zero. Of course I would like to have some error tolerance in there in case of outlier data points that might occur

for (2), the application is displaying the voltage readout data already


sorry, but thanks for the help, let me know if i need to clarify anything else

3/3/2011 4:57:21 PM

ncsubozo
All American
541 Posts
user info
edit post

I've always encountered the error you're talking about and I think it had something to do with the delimiters LabVIEW was using. Like you said though it doesn't actually hurt anything. I don't see any reason to use any kind of file IO for your need though.

What do you mean by error tolerances? Meaning if you're at 100mV (within limit) for 5 minutes, get one data point at 500mV (outside of limit) and then another 5 minutes at 100mV, that your 10 minute alarm would still sound?

If that's the case you would need to keep track of the data points through time and could maybe use one of the smoothing algorithms to prevent outliers from throwing you off...

3/3/2011 5:31:38 PM

dweedle
All American
77386 Posts
user info
edit post

i think the best way to state it is that the tolerance levels are based on the data, rather than having a static "lower limit = 150 mV, upper limit = 450 mV" type of thing

if the voltage shifts to 200 mV and stays within 190-210 mV or so for 2 hours, then the limits would be about 180 and 220 .... but if the voltage shifts to 500 mV for a long time, then the limits change to about 480 and 520

escaping these limits would cause the timer to reset until a steady voltage reading occurs for some time


just the sound of a "smoothing algorithm" sounds about right though for cleaning up the data lol

[Edited on March 3, 2011 at 5:39 PM. Reason : ]

3/3/2011 5:38:48 PM

Chance
Suspended
4725 Posts
user info
edit post

So, are you doing all of this from within DAQmx or are you calling the predefined task from within a VI?

I haven't used DAQmx much because the machine we've got is a bastard child using Measurements Computing shit...but, I'm fairly certain there isn't anything you can set up from the DAQmx side that will do a custom alarm so you'd have to set the task in a loop and collect the data and trigger your own alarm.

3/3/2011 5:44:41 PM

dweedle
All American
77386 Posts
user info
edit post

a VI acquires the voltage data using DAQmx

3/3/2011 6:29:28 PM

dweedle
All American
77386 Posts
user info
edit post

new Q

ive developed a sort of flowchart that i think would let me avoid using a separate spreadsheet.
problem is im not sure how to set a variable that would depend on certain conditions

labview has "local/shared/global" variables but im not sure how they work in terms of assigning value(s) to them

3/7/2011 12:43:18 PM

Chance
Suspended
4725 Posts
user info
edit post

Have you had any sort of labview training or are you hacking your way through this reading help files and googling whenever appropriate?

3/7/2011 7:52:52 PM

dweedle
All American
77386 Posts
user info
edit post

the latter

it's part of my thesis and no one knows anything about it in my inner circle lol

3/7/2011 8:12:02 PM

dweedle
All American
77386 Posts
user info
edit post

i posted this in an NI forum...looked like they responded quick to others' threads but not mine yet

http://forums.ni.com/t5/LabVIEW/How-to-create-a-type-of-alarm-event-based-on-acquired-sensor/td-p/1477332

3/7/2011 8:46:18 PM

Chance
Suspended
4725 Posts
user info
edit post

Ok, I wasn't trying to be a dick, just trying to understand how much you know.

I honestly don't know what you mean by flowchart/spreadsheet and how it is related to labview.

What exactly is it you need to do?

3/7/2011 8:51:29 PM

dweedle
All American
77386 Posts
user info
edit post

here's what i put in that other forum

Quote :
"I'm fairly new to LabVIEW and have successfully created a VI that reads voltage data from sensors. Each sensor outputs 2 voltage values and I treat these values as 2 different DBL values. I'd like to be able to record each voltage value as a base and then compare the subsequent data readings with that base. Once the base is determined, I'd like a sort of 'variable' set as "TIME" to be recorded at the moment the base voltage is recorded.

The alarm should occur (or anything Boolean set to TRUE I guess) once the continuously read voltage remains within certain limits for about 2 hours. I know I can compare the system time w/ the "TIME" that the voltage base value was recorded. If the voltage readings escape those limits, I'd like the voltage base value reset and the TIME set to the corresponding system time again."

3/7/2011 8:58:42 PM

dweedle
All American
77386 Posts
user info
edit post

ill try to illustrate a couple scenarios:

keep in mind that i dont necessarily want the voltages in these specific ranges, but just a range of +/- 20 mV ... in an above post i refer to a "base" voltage reading, in this case that would be 200 mV for V1 and 400 mV for V2, just because the voltage has shifted to those values for an extended amount of time each (> 2 seconds)

Scenario 1
1:00 pm
Sensor readings
Voltage 1: 200 mV
Voltage 2: 400 mV

between 1:00 and 3:00 pm:
Voltage 1 does not deviate from 180-220 mV range
Voltage 2 does not deviate from 380-420 mV range

at 3:00pm I want an alert/alarm/Boolean to change to 'true'


Scenario 2
1:00 pm
Sensor readings
Voltage 1: 200 mV
Voltage 2: 400 mV

at 1:45 pm:
Voltage 1: 2 mV
Voltage 2: 600 mV

Since the voltage has shifted out of the range, i want the new base voltage to equal whatever it changed to out of the range, and also the time spent within the new range (2 +/- 20 mV and 600 +/- 20 mV, respectively for V1 and V2) would be reset, so a new 2-hour counter would begin

3/7/2011 9:58:03 PM

Chance
Suspended
4725 Posts
user info
edit post

Quote :
"ive developed a sort of flowchart that i think would let me avoid using a separate spreadsheet.
problem is im not sure how to set a variable that would depend on certain conditio"


My most recent comment was regarding this flowchart and spreadsheet...that was new to the thread.


Regarding the rest of what you want to do, this isn't exactly a trivial task for someone that has just seen labview for the first time.

On your block diagram you need to drop down 2 while loops. Inside of each while loop you'll have a DAQmx task for 1 sensor. You need to put in a wait in each while loop to set how fast you want it to run. You need a shift register to pass readings from one loop iteration to the next. You need to append each reading of your sensor to the array that you are going to pass via your shift register.

Regarding establishing a new level. You have to decide how frequently you want to check for this. Then, inside your while loops you'll keep a running counter and take this array you are building with each sensor reading and analyze it for your set point and for your deviation. To do that, you can wire the while loop iteration terminal (the little blue 'I') to one terminal of an integer division VI (I don't know its name off the top of my head) and wire a constant to the other terminal. The output of this is a boolean that you'd wire to a Case statement that you'll pass your array through. So, if your while loop is running every 100ms (establish by the wait you dropped down) and you want to check every 2 minutes, you'd wire a 1200 as the constant. In the default (or false) case, do nothing, in the case where it triggers you'd then check your set point. If it deviated, clear your array, find the new set point. If it didn't, you could add +1 to some running counter you have for your 2 hours (which would trigger your boolean at 60 if we are using our 100ms example).

Is there any reason why you can't just start the thing running and come back in X hours and stop it and post process the data yourself? Why is the time for when it establishes a stable point unknown? Or rather, is it knowable over a give period of time?

[Edited on March 8, 2011 at 6:55 AM. Reason : .]

3/8/2011 6:48:53 AM

dweedle
All American
77386 Posts
user info
edit post

this guy on the NI forum posted an example of a while loop of exactly what I need it to do ... now my problem is getting it to work with the other while loop

it involves shift registers, like ncsubozo mentioned

this is what the NI forum guy gave me:



When I place that while loop inside my existing while loop, the VI doesn't work properly and when add the shift register to my existing while loop and have that logic setup above alongside my existing code, it doesnt work

im about to try to use it like two separate while loops and see what happens

3/8/2011 9:13:02 AM

dweedle
All American
77386 Posts
user info
edit post

yep, using 2 while loops beside one another didnt work ... and neither did this:



it would not continuously read the voltage like it does when the inner while loop stands alone

3/8/2011 9:45:18 AM

HUR
All American
17732 Posts
user info
edit post

I love me some Labview. I have Labview 10 complete with a 8-card COMPACTDAQ and 2 single card carriers. If you are mad because you are using labview for industrial applications you are an idiot. I view labview more of as a tool for in-field measurements, simulations, and project development.

You should try using Beckhoff for industrial purposes.

3/8/2011 5:12:46 PM

Chance
Suspended
4725 Posts
user info
edit post

When you say two loops beside each other didn't work, what do you mean? Nothing is displayed for voltage? It doesn't stop? It doesn't start? And so forth.

Quote :
"because you are using labview for industrial applications you are an idiot."

This might be one of the dumber things I've ever heard.

[Edited on March 8, 2011 at 5:16 PM. Reason : .]

3/8/2011 5:14:16 PM

dweedle
All American
77386 Posts
user info
edit post

OK, I've got it working but I forgot to mention one detail that I also needed to check. Based on the example.vi provided by the NI forum guy, I would also like to determine whether the voltage magnitude (abs. value) is greater than 1 V. If it is greater than 1, then I'd like it to react the same way as if the voltage is outside of the limits. I've tried to add this into the shift register, but I'm not sure what to do with the output Boolean.


3/8/2011 5:28:15 PM

Chance
Suspended
4725 Posts
user info
edit post

You may need to take screenshots of all of your code, because I don't think your "base voltage" or your global variable is going to do the "range" like you think its going to do.

It's hard to tell because I can't see it all, but are you establishing a "base voltage" somewhere else? Because that in range and coerce function doesn't appear to me to be set up properly in either of the screenshots (one you have Base voltage and the other you have a global variable).


Also, I'm not quite sure your hour time function is set up right either.

Edit:

Basically, the in range an coerce part is taking whatever the last sample was and using that as its new limits. You have initialized that shift register as 0. So your first iteration will have that and have your range as -100mV +100mV. If your first voltage reading is anywhere in this range, then the boolean coming out of that function will be true and you'll pass a zero out the shift register. If you get a sample outside of your range then the in range part will be false and you'll take the most recent voltage reading as your new set point. I think this is what you want. The question though is, how fast will your voltages change versus how fast does this loop run?

Ok, and now that I looked at it some more, I think the block of code below will work as well. Anytime you establish a new range, the time is used and that is the reference for iterations going forward.

As to your voltage >1V having the same thing as a new set point, you need to wire it through a negate (to convert it to false) and then run this line and the line coming out of the in range coerce through a logical AND. Then run that to your selector. That way if it is less 1 you'll get True (after negating) and if it is in range you'll get True and you'll keep your set point. If either you are out of range or greater than 1, you'll get a new set point.

[Edited on March 8, 2011 at 5:57 PM. Reason : .]

3/8/2011 5:38:47 PM

dweedle
All American
77386 Posts
user info
edit post

yeah, the hour-time part was straight from the guy, when it counts in seconds, it counts a lot faster than what a second is lol

I may screenshoot it via PM to you so it's not floating around on the internet

3/8/2011 5:48:48 PM

Chance
Suspended
4725 Posts
user info
edit post

Check my edit.

Yeah, it counts faster because your code is freerunning. If you set a wait in there at 1 second (the wait is in ms, so put it at 1000), you should see it roughly change at a 1 second rate.

[Edited on March 8, 2011 at 5:59 PM. Reason : .]

3/8/2011 5:58:18 PM

dweedle
All American
77386 Posts
user info
edit post

thanks, since I don't have the DAQ computer at home, I won't be able to check all that out until tomorrow, but for your reference, I'll PM you my whole code sequence (the dimmed out global variables are because the VCL computer can't recognize the DAQ board either)

thanks again

3/8/2011 6:04:24 PM

HUR
All American
17732 Posts
user info
edit post

Quote :
"This might be one of the dumber things I've ever heard."


Please Explain....

I work at a major manufacturing facility and have had talks with numerous engineers with regards to Labview. Labview and its controlling DAQ systems are not a deterministic and is further limited by the operating software of its host computer.

Beckhoff TwinCat can be used to create a stand alone system to control industrial application such as several banks of high temperature furnaces. Sorry as much as I like Labview, I do not trust my life and limb to a PLC using a labview .vi to run a machine moving 1000 lb parts with servo motors or a machine mixing process chemicals.

What is your background? software or microelectronics oriented?

Quote :
"
Laboratory Virtual Instrumentation Engineering Workbench - is a platform and development environment for a visual programming language from National Instruments. The purpose of such programming is automating the usage of processing and measuring equipment in any laboratory setup."


[Edited on March 8, 2011 at 7:40 PM. Reason : l]

[Edited on March 8, 2011 at 7:41 PM. Reason : l]

3/8/2011 7:38:33 PM

dweedle
All American
77386 Posts
user info
edit post

i think ive got it working now (the voltage>1 thing)

we'll see tomorrow

3/8/2011 8:41:36 PM

Chance
Suspended
4725 Posts
user info
edit post

Quote :
"Labview and its controlling DAQ systems are not a deterministic and is further limited by the operating software of its host computer"


I guess your engineers have never heard of Labview Real Time.

Quote :
"Sorry as much as I like Labview, I do not trust my life and limb to a PLC using a labview .vi to run a machine moving 1000 lb parts with servo motors or a machine mixing process chemicals"


Ok...but you didn't say a machine that probably needs a full custom solution or a solution that is more customized than base Labview. You said industrial applications and I'm sure many of them need better performance than basic Labview and Win XP/7 can give.

Interestingly enough, the TwinCat solution seems to me inferior to Real Time based on the little bit I know of both of them.

Quote :
"What is your background? software or microelectronics oriented? "

Both.

3/8/2011 9:37:11 PM

Chance
Suspended
4725 Posts
user info
edit post

double post

[Edited on March 8, 2011 at 9:38 PM. Reason : .]

3/8/2011 9:38:42 PM

dweedle
All American
77386 Posts
user info
edit post

a counter was also counting upwards at a rate 2.777x faster than a second, so i calculated in a fix for that

3/8/2011 9:39:19 PM

HUR
All American
17732 Posts
user info
edit post

Quote :
"I guess your engineers have never heard of Labview Real Time."


Fair Enough, I was solely basing my editorial on the assumption of using a CompactDAQ or similar system using a standard Labview 10 software package.

Quote :
"Both"


Not saying this applies to you but for many who solely write software or deal with "electrical engineering," as applicable in many of the Tech companies, often don't understand the shortfalls of many software applications such as Labview 10 in a manufacturing environment.

I'll admit I was the same way.

3/8/2011 9:48:19 PM

Chance
Suspended
4725 Posts
user info
edit post

Quote :
"of using a CompactDAQ or similar system using a standard Labview 10 software package.
"


It still depends on how deterministic you need it. A modern dual/quad core CPU has a lot of speed and if you need super precise timing events I wouldn't be surprised if NI didn't make an accurate high resolution timing board (not Real Time) that you could then control with base labview for the part of your process that needed it. And, if NI doesn't make it you could always have a custom board made for your needs.

Quote :
"Not saying this applies to you but for many who solely write software or deal with "electrical engineering," as applicable in many of the Tech companies, often don't understand the shortfalls of many software applications such as Labview 10 in a manufacturing environment.
"

And why would they understand the shortfalls if they don't know anything about the language - like our friend joe schmoe? I get your point, for doing some stuff like dweedle is doing in a lab environment Labview is perfect and it doesn't take a ton of knowledge to get that set up. But by a similar token, I don't know why anyone with only a few months or even a year worth of Labview experience would be expected to set up a high performance industrial system.

3/9/2011 6:57:21 AM

dweedle
All American
77386 Posts
user info
edit post

Awesome ... program works now

thanks for the help ncsubozo and Chance

3/9/2011 11:07:46 AM

 Message Boards » Tech Talk » LabView Page 1 [2], Prev  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.