Jump to content

vhha1972

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by vhha1972

  1. Hi All, My VI looks something like the one I am attaching. I am acquiring pressure data using a while loop. During data acquisition, I want to run a motorized pressure release valve for a few seconds (1-5 s) and then stop. But I don't want my main program (data acquisition) to stop just yet. That I will stop later through different control/logic. Is this easy to do? I had found a few programs online that stopped the whole system. But I want an independent loop to run within my main loop for a few seconds. Cheers, Saif EX_D.vi Also attached in 2009 version. EX_D.vi
  2. Hi All, I will try to explain my problem a bit more... When I run my VI, my pressure pump starts running, and pressure in the system starts to increase. I want to calculate pressure (P) over time (t) ratio (P/t) at the instant the rising pressure crosses 80mmHg. The attached VI does something close. Only thing is that I want the FIRST P/t value when this condition is met and want to use it further. So, I want that first P/t to be stored somewhere temporarily while the program is still running. Based on the first instant of P/t when the pressure crosses 80mmHg, I want to run a motorized leakage valve for a time period proportional to P/t. So, I have 2 problems: (1) How to hold/latch the P/t value associated with the instant when rising pressure crosses 80mmHg. (2) How to send voltage signal to motorized valve only for a fixed duration (range ~ 1-2 seconds), based on the detected P/t ratio. Thanks! VI Attached. EX_C.vi
  3. For example, when I write data to a lvm file from two channels, I get one time column and two y-value columns. Please see attached image of lvm file. I want access to the latest elements of this file while I am running my program in Labview. Cheers, Saif
  4. Hi Asbo, Thanks so much. I tried your code. The last y-value is OK (updating). But last x-value is stuck at 999 (not moving). Please see attached. Saif EX_B.vi
  5. Hi Asbo, Thanks so much for your response! I tried to do what you suggested (attached). Now I have (at least) two problems: 1. My y-value is no more a scalar? Can I use it as is or I need to convert it into scalar. When I connect an indicator to it, I get i, j, k, etc. If i keep this to zero, I should be OK? 2. The 't0' is just PC time. How do I use this to get t = 0, 1, 2, 3 sec etc.? Any help would be much appreciated. Thanks a lot! Saif EX_A.vi
  6. Hi All, As I am new to Labview, I am asking another (possibly!) simple/naive question! I know how to get latest y-value while running a VI. However, I do not know how to get the associated time stamp (x-value) with the y-value. I need both the x & y values during the execution of my program to do some other things. Please see attached code. I used the Index Array Function. But it only gave me y-value. No time stamp! Cheers, Saif EX_A.vi
  7. Hi Tim, I am doing exactly what you mentioned. I am indeed using 6V and relays. Hi Ton, thanks so much for the code. I will try it out and let you know. Ton, would it be possible to please upload .VI file? Thanks to both of you! Saif
  8. Hi All, I am stuck with a problem. I have a task whereby I am supplying 6V to a pressure sensor. This is supplied inside a while loop using a constant value of 6 -- "one sample on demand." At the same time I have to supply pulse width modulated (PWM) voltage to a pressure release valve. This valve is CLOSES (ON) on 4V and OPENS (OFF) at 0V. I kind of want to flap this valve (OPEN-CLOSE) at a certain rate to achieve a specified leakage in the the system. I used another channel of my DAQ Book and gave it simulated square wave. However, this requires the DAQ to be set at "continuous samples." So, there is a conflict. I tried to supply my 6V to the pressure using "continuous samples" but it failed. Also, I tried to configure the DAQ for simulated signal as "one sample on demand." Again it failed! Please see the VI attached. Is there a simple and consistent way to send the desired voltages to both devices? Thanks a lot! Saif Ex_9.vi
  9. Thanks a lot Shaun -- I really appreciate all your inputs! Will keep learning
  10. Hi Shaun, Thank you so much for all your guidance! What I did was that I wired the STOP button to the motor voltage module (inside a SWITCH statement) that I kept outside the WHILE loop. So, when STOP is true, I send zero voltage to the motor. This EXITS the program as well as STOPS the motor. Please see attached VI. I have two questions: 1. Is this a smart way of doing it? 2. This does not work if the user hits the ABORT button instead of STOP button! So, I went into File --> VI Properties and made the ABORT button invisible when the VI runs. In this situation, the user can only see my STOP button and is forced to use that to exit. Is is this OK? Thanks again! Saif Ex_7b.vi
  11. Hi Shaun and Asbo, Thanks so much for your responses. Shaun, the VI you uploaded works just fine! I used help commands to understand it. The feedback loop combined with AND and OR gate to achieve "latching" is a great idea! Also, the use of selector function for sending command to the motor is simple and straightforward. Can I please ask another question? Suppose a USER hits the stop button during cuff inflation (motor ON). At that point I would like the motor to stop. The program does EXIT, which is fine. But if the motor could also stop, that would be great! Hope this is possible Thanks again for all your help! Saif
  12. I noticed that the output from the boolean direction VI is true only momentarily. So, when it does detect a change, it turns TRUE for a second then turns back to FALSE.
  13. Hi Shaun, Thank you so much for your response! I think I tried what you suggested. But it seems to only work with what I have. Do you mean change the initialization pin to TRUE? When I do that, nothing happens. I am attaching the VI now. I would be very grateful If you could please advise what I might be doing wrong! Cheers, Saif Ex_7a.vi
  14. Hi Shaun and Asbo, Thank you for your replies! I tried what Shaun suggested. Please see pictures. The Boolean cross-over is detected and the motor stops momentarily. But then turns back on. Sorry but I am still a bit new to Labview. How do I utilize that cross-over trigger to keep it off for the rest of the recording? Thanks again! Saif
  15. Hi there, I am trying to implement a blood pressure (BP) monitor in Labview using NI 9239 and NI 9263. At this time, all I want is that the motor (pump) runs until a user-specified pressure is reached in the cuff. When that pressure is reached, the motor should stop but not the Labview program. As the cuff is deflating slowly through a pressure leakage valve, I want to record the pulses during cuff deflation. I used a switch statement. Gave it input from a comparator which compares the real-time pressure with user-set pressure. I put the DAQ Assistant inside this switch. I said to NI 9263, keep supplying my motor relay with rated voltage until the pressure is lower than the user-specified pressure. When this pressure exceed the user-specified pressure, I set the DAQ Assistant voltage to relay as zero, since I want the motor to stop. The above is OK. But when the cuff starts to deflate, again, the pressure becomes lower than the reference (user-defined) pressure. As a result the switch statement switches again and sends voltage to relay to run the motor again. I want something which can start off my supplying the relay with rated voltage to run the motor. As soon as real-time pressure exceeds user-defined pressure for the 1st time, I want the relay voltage to be set to zero, being unaffected by the fact that during cuff deflation, the real-time pressure will fall again below the reference pressure. I don't want the motor to run after it has pumped to a desired pressure, the first time. Thanks a lot! Saif
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.