Programming Help


k.nikola

Recommended Posts

I am trying to develop some applications with DAQFactory, but I am running into some problems for which I can not find the solution in the manual. Can You help me or direct me as to where I can find some instructions.

It concerns the following:

- I can not set the datetime format, mostly on the graph, on Macedonian, even though the Windows OS is set on macedonian support (cyrilic)?

- How can I make custom changes on the Time Axis on the 2D graph?

- The PrintPage function/command does not work. It always prints a blank page. The same goes for PrintPreview, which sometimes displays a blank page, but sometimes it displays the graph with scattered letters and mis-scaled controls (buttons...etc.).

- Is there a way that I can use the PrintGraph function without prompting the user dialog?

- How can I import the CSV files into DAQFactory, both with their logged times and values? When I read the csv file into a virtual channel I manage to parse the value, but I can not do the same for the Date. I try parsing the time value into Private.x.Time and then add the x value (AddValue(Private.x)) to the V channel, but the time column of the channel fills with the current system time...

Can You send me some examples for these issues because I can not access most of the sample links from this forum where some of these issues are addressed?

Thank You in advance,

Regards,

Nikola

Link to comment
Share on other sites

- I can not set the datetime format, mostly on the graph, on Macedonian, even though the Windows OS is set on macedonian support (cyrilic)?

Unfortunately the graph is fixed. This is an issue we'll resolve in R6. To get around it now, cover over the date display and put a variable value component with the date formatted the way you want using the formatdatetime() function.

- How can I make custom changes on the Time Axis on the 2D graph?

You can't. R6 will fix this.

- The PrintPage function/command does not work. It always prints a blank page. The same goes for PrintPreview, which sometimes displays a blank page, but sometimes it displays the graph with scattered letters and mis-scaled controls (buttons...etc.).

This is an issue with some printers that we have not been able to resolve with the current display components. We will be replacing the problematic components in R6 and thus resolve this issue.

- Is there a way that I can use the PrintGraph function without prompting the user dialog?

No.

- How can I import the CSV files into DAQFactory, both with their logged times and values? When I read the csv file into a virtual channel I manage to parse the value, but I can not do the same for the Date. I try parsing the time value into Private.x.Time and then add the x value (AddValue(Private.x)) to the V channel, but the time column of the channel fills with the current system time..

You have the right idea, but I think you are using AddValue wrong. You want V.mychannel.addvalue(private.x) or just V.mychannel.addvalue(x)

Link to comment
Share on other sites

Following the previous post:

This is the code snippet that I use

Private hFile = File.Open("c:\MyData_08_12_12.csv",1,0,0,1)
V.test.ClearHistory()
private x
Private.strIn = File.Read(hFile)
while (1)
  strIn = File.Read(hFile)
  if (strIn == "")
	break
  endif
  x.Time = StrToDouble(Parse(strIn,0,";"))
  x = StrToDouble(Parse(strIn,1,";"))
  V.test.AddValue(Private.x)
endwhile
File.Close(hFile)

But again, the Time column of the virutal "test" channel fills up with the current system time...?

What am I doing wrong?

And I would like to ask for an oppinion for a situation.

The situation is this:

I need to acquire data from 4 channels, from 8 to 12 hours a day, and show those channels in graphs, two channels each. Every day it's its own unity, and I need to archive the data for each day, with the added option to archive the data on user demand. The process is slow, it is enough to read the data once each minute. The issue here is reliability and so my question is what should I use:

1. Save with History (possibly automating it with Sequences? System.SaveDocument()?)

2. Channel Persistance?

3. Logging?

The data should be retrievable and presentable in graphs for each day on user demand, hence forth my previous code issue.

And finally, you mentioned that there is an issue with some printers and current display components. Could You tell me which printers are safe and reliable to use in this case?

Link to comment
Share on other sites

You need to assign the variable before assigning the time:

x =

then

x.time =

This is because when you do x= it pulls the time from the right side.

As for your second question: use Channel Persistance to maintain the data over time for graphing, then use logging for permanent archiving. Do not use Save with History. Its really pretty much a useless feature now that we have channel persistance.

Link to comment
Share on other sites

Archived

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