Graphing Data Not On A Time Base


CamEra

Recommended Posts

Hi,

 

I am looking at using Daqfactory for a data display system with out any instruments attached (I have several systems running DaqFactory and have been a users for several years). The data will come via a file on our ftp server (updated every hour). The data is from a lake buoy system which has temperature sensors spread from the surface to 150 metres depth. I would like to plot the temperature on the X axis and the depth on the Y axis. Ideally I would like the Y Axis to go from 0 at the top to 150 at the bottom (reverse to normal). I don't think DaqFactory can handle this - happy to be proved wrong though. An option here is to make the depths negative so the scale goes from -150 to 0.

 

My aim was to set up two channels with a history of 15 - the number of sensors in the chain, one for temperature and the other for depth. As a new data file is read the data in these two channels would be replaced and therefore graphed. Would this work?

 

As well as this there are other sensors on the surface each being logged every minute, e.g. there is a full weather station giving wind speed, direction, air temperature, humidity, barometric pressure etc. The data file will contain the time each measurement is taken. I would like to read this data file and as each line is read (file is updated each hour and has 60 lines of data, one for every minute) I would like to add it to the appropriate channel e.g. Wind_Speed along with the actual time the data was taken (from the line in the file not from the system clock). Is this possible? Or do I have to use a variable or array?

 

Regards

 

George

Link to comment
Share on other sites

You are right, DAQFactory can't flip the Y axis, at least not simply.  What I've seen people do, mostly in drilling type applications, is to go negative, then turn off the labels on the Y axis and manually add labels.

 

As for channels, it will work, but you have to be careful to keep everything aligned, that you don't update one channel and forget to update the corresponding other one.

 

With the other sensors, again, it will work.  In both cases use MyChannel.AddValue() to stick the new value into the channel.  To add a time stamp, use insert time.  For example, if you your file is csv, and your time is the first column, and reading is in the second, you might do:

 

private string datain = file.read(handle)

Wind_Speed.addValue(insertTime(parse(datain, 1, ","), parse(datain, 0, ","), 0))

 

Usually you will put the parses separately, especially with time, if you are reading multiple values per line.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.