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
2/22/2011 6:22:30 PM
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
2/22/2011 10:38:35 PM
2/23/2011 6:33:01 AM
**basically fairly new to labview**What is the best method for obtaining data from a sensor and creating an alarm based on that datafor 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 generatedis 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
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...
3/3/2011 3:27:00 PM
^^ 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
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/ 2009say 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 occurfor (2), the application is displaying the voltage readout data alreadysorry, but thanks for the help, let me know if i need to clarify anything else
3/3/2011 4:57:21 PM
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
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 thingif 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 520escaping these limits would cause the timer to reset until a steady voltage reading occurs for some timejust 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
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
a VI acquires the voltage data using DAQmx
3/3/2011 6:29:28 PM
new Qive 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 conditionslabview 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
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
the latterit's part of my thesis and no one knows anything about it in my inner circle lol
3/7/2011 8:12:02 PM
i posted this in an NI forum...looked like they responded quick to others' threads but not mine yethttp://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
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
here's what i put in that other forum
3/7/2011 8:58:42 PM
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 11:00 pmSensor readingsVoltage 1: 200 mVVoltage 2: 400 mVbetween 1:00 and 3:00 pm:Voltage 1 does not deviate from 180-220 mV rangeVoltage 2 does not deviate from 380-420 mV rangeat 3:00pm I want an alert/alarm/Boolean to change to 'true'Scenario 21:00 pmSensor readingsVoltage 1: 200 mVVoltage 2: 400 mVat 1:45 pm:Voltage 1: 2 mVVoltage 2: 600 mVSince 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
3/8/2011 6:48:53 AM
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 mentionedthis 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 workim about to try to use it like two separate while loops and see what happens
3/8/2011 9:13:02 AM
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
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
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.
3/8/2011 5:14:16 PM
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
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
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 lolI may screenshoot it via PM to you so it's not floating around on the internet]
3/8/2011 5:48:48 PM
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
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
3/8/2011 7:38:33 PM
i think ive got it working now (the voltage>1 thing)we'll see tomorrow
3/8/2011 8:41:36 PM
3/8/2011 9:37:11 PM
double post[Edited on March 8, 2011 at 9:38 PM. Reason : .]
3/8/2011 9:38:42 PM
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
3/8/2011 9:48:19 PM
3/9/2011 6:57:21 AM
Awesome ... program works nowthanks for the help ncsubozo and Chance
3/9/2011 11:07:46 AM