LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from a file on realtime basis with time stamp

Hi CC,
I was able to understand the functioning of the VI (multisensors.vi). Also I would like to focus on 'new value' which takes the value from the boolean(Active Sensor).

a) I am just wondering you didnt connect the output of the boolean to 'new value' n it worked? How? I know 'new value' takes the boolean state of each sensor for case statement.

b) What is the 'new value'? There are varies options available for 'new vlaue'. What does they stand for? I know

c) Also, for each sensor I need to show the state 'Under Temp' or 'Over Temp' as they read temp. value from file. How do I accomplish this for each sensor? My GUI should show the state for each state either 'Under Temp.' or 'Over Temp.' I know I need to read values from the array and then compare each individual value of temperature for each sensor (I have included the comparision module in my VI, plz have a look at it). But I am unable to retrieve temp. value for each sensor from the array.

d)Also, what's the increment decrement button on the front panel near 'Active Sensor'. I dont understand its functionality.. I have not used it and my VI works fine without it.

e) I need to have a history scroll bar for my Graph. Is there any way out for that so that it shows history for specified time interval using a slider (User can set the time interval). Can we fix the number of points on the graph for X axis. I know we can use scroll bar, but is there any other alternative for this?

f) I dont know where did the 'file read icon', 'array icon' went off in the block diagram inside the case structure. I just modified your multisenors.vi file. Any idea?

g) Also my plot legend has stacked up n looks odd. Any suggestions for this?

h) Lastly, I feel my VI is working erractically sometimes. Do you think so? Is this the correct approach for the type of project I have. Plz comment!!

I am attaching the modified VI and the sample data file. Plz ignore the values in the log file. I know they are non-realistic. But thats just for reference!!!

Thanks very much for all your help!!

I feel my VI is working erractically sometimes. Do you think so?
Ratnesh

(FYI: In my project, a third party software logs in the temperature readings for different sensors with time stamp in a file. {this time stamp can be in any format} Could you please suggest me the best and most feasible format for time stamp, I am confused over this.Also in which format do you think it would be the best to display the timestamp on x-aixs. My requirement does not say anything about this. I am suppose to read those temperature value from the file and display it on the graph. I believe I misused the word 'REAL TIME'. I understand this is an offline process. Is there any alternative approach for this whole process. I dont want to read from hardware port. Plz suggest.)
0 Kudos
Message 11 of 16
(942 Views)
Hi CC
Please use this file. Ignore the previous file. This has the functions for 'Under Temp' and 'Over Temp' concept.

Thanks,

Ratnesh
0 Kudos
Message 12 of 16
(939 Views)
Lot of questions !
Some answers :
a & b/ You should read the Help about the functions of the event structure. You will learn that it is used to react to specific events (mouse moves, value changes...). Here, I have used it to detect any change in the boolean array. That more efficient than being obliged to read periodically the array to see if something has been changed.

c/ I see that you tried to get the temperature values out of the loop. There are several mistakes there that demonstrate that you have not spent enough time/efforts with loops and arrays. Go through the examples shipped with LV, and read carefully the manuals. Basically, the temperatures should be compared with the reference temperature when they are read from the file, INSIDE the loop. As it is, you were trying to compare the values only after the stop button has been pressed...
Second mistake, in the index array function, you wired the line index, instead of the column index.

d/ Have you tried the button ? What is its effect ? How would you handle a situation where you have say 200 buttons ? Got it now ?

e/ the easiest way for the user to scroll through the data is probably to use the zoom tools provided by NI. Right-click the graph and make the graph palette visible. Then select the appropriate zoom tool. Of course, you may also play with the property nodes to fix the X scale. Just a comment : if you disable the autoscale property of the X scale, and if you change the axe min and max value, the scroll bar will appear. Is that something that you knew about ?

f/ no problem with the icons here.

g/ what do you mean by "looks odd" ? You could make the legend background transparent, to get something more conventional...

h/ what do you mean by "erratic" ?


In my applications, I usually store the time in several formats. In the first column, I usually put the date, then the time in the second column, then the time (seconds)elapsed since the beginning of the experiment, then the same info, but as decimal hours. If you can have only a single column for the time, use an unit which corresponds to the duration of your acquisition, decimal minutes, or decimal hours for instance. That will make data manipulation and display much easier.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 13 of 16
(927 Views)
Hi CC,
Thanks once again for answering the Q's

c) This was the mistake I realized but only after I posted you the file(2nd time!!!) And wrong connection in the index array was just by mistake. I am going to be more careful now on.. Thats for pointing that out!!

d) I am able to understand the functionality of the button to some extent now. I partially understand what you are trying to say..

e)I was pretty much aware of this option. I have been trying to try out various possible Permutations and combinations of the options available to have a better understanding of LV. But I am just wondering if we can mention the number of points as in chart history anywhere in the options. Also I checked out different examples supplied with LV. I have found out an example where they make use of buffer and there we can vary the 'chart history length' according to our needs(attached VI for this:Variable-Time Chart XY.vi). Do you think its wise to use this in my project just for history? Also if yes, I am not very sure about how this works. I also tried reading different materials for this but not of much use. If you could please brief this.

g) By odd I mean it stacked up one on another and this increases the overall area of my front panle to scroll. Is there any way out for placing the legend for each plot side by side. I tried out various options but no use.

h)I guess my VI works fine. thanks


New Q's

a) I am unable to define a fixed area for my Front panel.. The scroll bar just scrolls endlessly in both directions (vert. n horiz.) I tried using options under File->VI Properties but it didnt help me fixing my area for front panel. ( I mean fixed screen size for my VI for final display)

b) I am unable to display a 'Under Temp and 'Over Temp' for each sensor. I am unable to figure out how to go about this. Do I use an array of BOOLEAN (both 'Under TEmp' n 'Over TEmp' for all sensors as I did in Sensor selection button) If yes, how do I go about using it. I tired that also but wasnt able to get any success. I want to display 'Under TEmp' n 'Over TEmp' for EACH sensor when ever there temp. value over rides or under goes the defined temp range( Lower and Upper limit; ) Each sensor will have their own range pre defined range using the front panel control. Please help me in this. I tried endlessly today to achieve this without any success.

c) Also I need to delay reading each value of temp. for each senosr by certain time. I used delay function but it only delays reading values from one sensor to other sensor. I need to delay it for each value for each sensor.

d) Lastly, I am planning to use number of minutes evolved (from a reference time) when that particular value of temp. was taken. Do you think this should be wise and good. I am going to convert this to standard time format (HH:MM:SS) format n display it on X- axis.


Thanks very much for all your kind help and time. I really appreciate it.
Happy New Year!! Have a bash!!
Ratnesh

Sorry for lotz of Q's again.
0 Kudos
Message 14 of 16
(916 Views)
Hi,
I am trying to build a temperature logger. I am unable to scale the X-axis properly. I used all the possible options in the formatting menu for XY graph. I used enabling autoscale, disabling autoscale, mentioning max and min. values ,offset, multiplier,etc but nothing helps!! Also as seen from the probes values I read the data correctly but on X- axis values are not being displayed correctly. Anybody can explain me why? I would appreciate it greatly. Please find my sample data file, my VI attached. and screenshots for Front PAnel and Block diagram

Thanks in advance,

Ratnesh
0 Kudos
Message 15 of 16
(911 Views)
Right click on the graph and select X Scale>Formatting. Select Absolute Time in the list under Time (X Axis) and see if that's what you want to display.
0 Kudos
Message 16 of 16
(906 Views)