LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event handling

Hi Anna,

I tried the way you suggested me. However, I get the run-time error as attached in the 'error.jpeg' file. I am attaching the code. I am also attaching the error I am getting. When I run the code, I  press the 'PORT SETTING' control to allow me to choose from a given baud and com settings. Thenafter, when I press the 'request' control for the third time, I get the error message which I have attached in the file named 'error'. I dont get this error if I run the same code without using the event structure. Thank you Anna very much.
Download All
0 Kudos
Message 11 of 34
(1,976 Views)
Hi Anna,
I did get rid of the error by adjusting the panel size in the vi properties.  Thank you.
0 Kudos
Message 12 of 34
(1,965 Views)
Hi Anna,
 

                How are you? I need to clarify some doubts as follows:
  1.  The vi I am working on continuously reads and writes the data to the port. However, if I use the event structure, I dont think the vi will work when I will be dealing with the event case related to the request of temperature or humidity. When I am dealing with the temperature or humidity case, I need the updated value of the temperature which shows up in the console read bar. So, I am thinking  to just stick with the vi w/o using the event structure. I am scared that the vi would get overloaded if I dont use the event structure. What do you suggest?
  2. I  will also will adding one more option for the usb camera. I will be watching the images on the front end. No processing done. But the it will be hookup on a different usb port. So my question is, can I combine whatever vi I make for the camera with the original vi? If yes, could you suggest any tips.
Thank you very much Anna for your time. I am attaching the VIs for your reference.


Download All
0 Kudos
Message 13 of 34
(1,940 Views)
Hi Anna,


Sorry I forget to mention about really important thing. I need your help with it. I want to request temperature and humidity at regular intervals. In other words, when I press button 'request current temperature', 1 will be written to the serial port only once. When I press 'Request temperature of past hour', 1 will be written to the serial port 20 times at an interval of 5 minutes, and the temperature data will be displayed on the graph w/o pressing the switch 20 times. Similarly, goes with the 'request temperature for one day'. The same thing should also happen with the humidity request. Any idea is appreciated.  Thank you Anna for your time.

Message Edited by Mozill on 02-05-2007 10:29 AM

Message Edited by Mozill on 02-05-2007 10:30 AM

0 Kudos
Message 14 of 34
(1,933 Views)

Hi Mozill,

In regards to your second question, you should be able to add in webcam code with no real problem - just make sure that you consider data flow and that your webcam code is evaluated when you would like it to be done (Using a State-machine, sequence structure or simultaneously executing while loops)

I'm not sure that I fully understand what your concern was in your first question.  Is it that once you're evaluating an event you must wait before the next event is registered?  If for whatever reason you do not want to use event structures, you may consider using a state-machine programming structure.  You can find more information about this structure here: http://zone.ni.com/devzone/cda/tut/p/id/3024  This will allow you to go into different states & subsequently run different code, depending on which state the user chooses to enter.

Concerning your last post, you can definitely program these functions you described to record temperature, for example, every five minutes for one hour or for one day.  You can just put the serial program into a for-loop with a 5 minute wait block.  Again, if you want to run things simultaneously, you will need to plan for this in advance (ie. read one temp. data point and then one humidity data point and then wait five minutes.)

Hope this helps!


Regards,
Anna M.
National Instruments
Message 15 of 34
(1,918 Views)
Hi Anna,

Just wanna know something about graph. The temperature/Humidity value which I get in the graph keeps on changing. Now, I want that the graph remembers the last value rather than jumping to zero before the next value is updated. Is there a way to solve this memory problem?

Thank you for your time.


0 Kudos
Message 16 of 34
(1,904 Views)
Hi Mozill,

Unless your device is returning zeros, your graph should not be graphing zeros.  If your device is outputting unwanted zeros, you can add some sort of logic to your code to only graph the meaningful values (ie. don't graph a value if it's equal to zero).  Or, you can look at your instrument communication section and make sure you're only doing a serial read when there is meaningful data to be graphed.  Hopefully this helps!

Regards,
Anna M.
National Instruments
Message 17 of 34
(1,886 Views)
Hi Anna,


I tried using the wait block in the for loop as shown in the attached file. I found that no matter how many time I want to run the loop, the timer will occur continuously at the input interval. I found that when I use the technic I have implemented in the attached vi ,(shows the prompt message just for testing purpose; my actual code consists of write to serial function)  after a given time interval, value is written to the serial port without any time delay. I want that the value is written to the serial port at a given time interval. In my case, the value is written to the serial port one after another for N times w/o any time delay.


Thank you.

Mozill
0 Kudos
Message 18 of 34
(1,872 Views)
Mozil,

this is very aggresive code, and should be removed!
This way people will not want to help you!

Smiley Mad Smiley Indifferent
Smiley Indifferent
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 19 of 34
(1,866 Views)
Hi TonP,

Which code shoud be removed and what is aggresive? I did not understand your reply. Will you please elaborate if I did any mistake. Any response is appreciated.

Thank you for your time.


Regards,


Mozill
0 Kudos
Message 20 of 34
(1,862 Views)