LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event handling

Well I find the message displayed when the code is run rather aggressive!
Esp. since we volunteers try to help you, and such a message when we want to look at your debug code is rather annoying.

Ton
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!
Message 21 of 34
(2,150 Views)
Hi Ton,

I can totally understand your statement. Just because the code is annoying, I created a situation similar to the portion of my code I am having a problem in rather than posting the whole code. The situation and problem I am having in my original code is as follows:

I want to write 1 to the serial port at an interval of 5 minutes repeateadly and anlyze the values I acquire on the graph again through the same serial port.

I tried using the for loop and a wait block in the code as suggested by my friend Anna. However, when I do so, after a specied time inputed to the wait block, 1 is written to the serial port for N number of times (for loop input) without creating an subsequent delay of 5 minutes.

In order to give a check I tried the attached code which works fine. I do not know why does the same logic not work in my code.

Regards,

Mozill


0 Kudos
Message 22 of 34
(2,143 Views)
Hi Anna,

I am stuck in a serious problem I am figuring out since last few days. Could you help me please? The problem is as follows:

I am requesting temperature and humidity from my pic controller through rs232 port. So, I have to write 1 (for temperature) and 2 (for humidity) to the serial port. I have four options-
1. requesting current temp.
2. Requesting Current Humidity
3. Requesting temperature for a given time period, and
4. Requesting Humidity for a given time period.

I have set-up the code for that. The first two options are working fine. However, third and forth have a problem. Instead of writing to the serial port after a give time interval, the values are writen one after another without any time lag. For the very first time, the program waits for a given interval; but thenafter, it writes to the serial port without giving any time delay.

The problem I am describing is in the case 2 and 3 of the main case structure. If I can find the problem with the programming in case 2, then case 3 will run fine too.

I am attaching the code for your reference. Thank you for your time.

Regards,

Mozill
0 Kudos
Message 23 of 34
(2,122 Views)

Hi Mozill,

I noticed in your case statements for the repetitive measurements (cases 2 & 3) that you are doing multiple serial writes, but not multiple serial reads.  You need to have a read for every write in your code for it to get the data you'd like.  I hope this helps! 


Regards,
Anna M.
National Instruments
Message 24 of 34
(2,101 Views)
Hi Anna,
 
I am following all your instructions and they are working perfectly fine. However, I would like to know one more thing. My temperature readings as calculated by the formula node are fed into the waveform chart. Now, I need to save this data to the excel sheet. I went over the 'write waveforms to file.vi', but the data coming out of the formula node is not any array. How do I perform my job. Also, I need to save the humidty readings in the same excel file.
 
Any suggestions are appreciated. Thank you for your time.
 
Regards,
Mozill
0 Kudos
Message 25 of 34
(2,063 Views)

Hi Mozill,

It looks as though the data that you'd like to write to an excel file is one-dimensional, in which case, you might not need to use the "Write Waveform to File" vi. You could simply try "Write to Spreadsheet File" vi. This will accept both 1-D and 2-D data but is ideal for recording a long array of data.

If you'd like to write multiple arrays of data to one excel file, you will first need to combine the data into one 2-D array. You can then wire this to the Write to Excel File vi where it will record multiple columns of data.

Cheers,

Emilie Elizabeth

Applications Engineer

0 Kudos
Message 26 of 34
(2,034 Views)
Hi Emilie,

Thanks for a prompt response. I changed my mind. I will rather make two different excel files. One for the humidity and other for the temperature. But I wanna make a 2-D array in the sense that I will log the time as well as the temperature/humidity values. In order to do so, I made the following vi (attachment). But, unfortunately it does not work. I tried probing but I do not see any value at the output of the build array function. I am able to get values plotted on the graph though.

Any suggestions are appreciated. Thank you for your time.

Regards,

Mozill
0 Kudos
Message 27 of 34
(2,029 Views)
Hi Elizabeth,

I made some changes to my program as shown in attachment below. I am able to get the values. I need the time, date, and data to be in three different columns for each iteration. Right I am able to get the output as shown in 'result' file. I want tabs between time, date, and data; but I am not getting that.

Any help is appreciated.
Download All
0 Kudos
Message 28 of 34
(2,014 Views)
Hi Elizabeth,

I made some changes to my program as shown in attachment below. I am able to get the values. I need the time, date, and data to be in three different columns for each iteration. Right I am able to get the output as shown in 'result' file. I want tabs between time, date, and data; but I am not getting that.

Any help is appreciated. Thank you for your time.

Regards,
Mozill


Download All
0 Kudos
Message 29 of 34
(2,014 Views)

Hello Mozill,

You might try simply transposing the 2-D array before you wire it to the Write to Spreadsheet vi.

Cheers,

Emilie Elizabeth

Applications Engineer

0 Kudos
Message 30 of 34
(1,998 Views)