Cannot export Trend data to DBF or CSV, file not created.

ongzy

Member
Join Date
Dec 2010
Location
Selangor
Posts
100
SCADA - Citect Version 7.20

As stated above. I've written a function as cicode startup function.

TrnExportDBF("c:\KV11_F11.dbf", TimeCurrent(), 15, 31, 1, "KV11_F11")

Is the dbf file auto-generated? Cause I can't find any.
 
Last edited:
Ok, it will auto-generate. Just tried it with a button trigger function. But can't the function be read as soon as I start Citect?
 
In addition, some data are missing. Why???
n/a are shown on some of the rows. Whereas the data is constantly 5000.
 
In addition, some data are missing. Why???
n/a are shown on some of the rows. Whereas the data is constantly 5000.

What rate did you set your trend file at ? If you have set your trend file to store data at say 30 seconds. And in your trend CSV/dbf file you are asking for the samples that are not spaced at 30 seconds then it may be that Citect just doesn't have a sample for that time. How do the times that have n/a compare to your trend rate as defined in the trend ?
 
What rate did you set your trend file at ? If you have set your trend file to store data at say 30 seconds. And in your trend CSV/dbf file you are asking for the samples that are not spaced at 30 seconds then it may be that Citect just doesn't have a sample for that time. How do the times that have n/a compare to your trend rate as defined in the trend ?

Hmm, I dunno but I've set it to read the latest data, it should work fine. Now it's ok, I dunno what happen previously that I get n/a value. Weird thing is it happened in the middle of the report.
 
If your function doesn't run when Citect starts you can always ues "Sleep()" to delay it for a short time to make sure that all of citect's process's have started before attempting to export trend data

Hmm, ok. My boss just suggested that we use event to trigger the extract report function. Yet to try that out.

Now I wonder if the function can be used as a runtime function.
 
It would be much simpler to use an event and have it trigger at the time interval you decide, if you put a "sleep()" in your function you may get an error message about unable to block foreground task or similar. if that is the case then create a new task see on-line help about how to use "taskNew()" .
 
It would be much simpler to use an event and have it trigger at the time interval you decide, if you put a "sleep()" in your function you may get an error message about unable to block foreground task or similar. if that is the case then create a new task see on-line help about how to use "taskNew()" .

Very much appreciated, thank you. :)
 
It would be much simpler to use an event and have it trigger at the time interval you decide, if you put a "sleep()" in your function you may get an error message about unable to block foreground task or similar. if that is the case then create a new task see on-line help about how to use "taskNew()" .

Looks like it doesn't work with runtime?

By using an event to trigger the function, nothing works. I tried to configure an alarm & trigger the function, only last line worked =.= which is reset the "report_trigger" back to 0. No dbf file created :(

But when I configure a touch button to call the function, it works perfectly fine, hmm.. :mad:



============================================================
FUNCTION
Report_KWH()
STRING sTag1 = "KV11_F2"
STRING sTag2 = "KV11_F4"
TrnExportDBF("c:\KWH_Report_1.dbf", TimeCurrent(), 60, DateDay(TimeCurrent()), 1, sTAG1, sTAG2)
Report_Trigger=0;
END
============================================================
 
I've just tried tasknew() function at startup. It works fine to create the dbf file for the first time but it doesn't continuously extract the trend data to replace the data in dbf.

So, I wrote a recurring function :rolleyes:
And yes, it works, at least.

==============================================================
FUNCTION
Report_KWH()
//TrnExportDBF(Filename, Time, Period, Length, Mode, sTag1 ... sTag8, iDisplayMode1 ... iDisplayMode 8)
STRING sTag1 = "KV11_F2"
STRING sTag2 = "KV11_F4"

TrnExportDBF("c:\KWH_Report_1.dbf", TimeCurrent(), 60, DateDay(TimeCurrent()), 1, sTAG1, sTAG2)

Report_Trigger=0;
Sleep(5)
Report_KWH()
END

==============================================================
 
Last edited:

Similar Topics

Hello everyone, I am currently working on a project that uses a Rockwell L33ER controller and the FTV Studio V13 as Supervisory computer...
Replies
0
Views
137
Hello Friends I have a backup that I am trying t open in mi PC (RSLogix 17.01) and I get this message. I have read many posts and done many...
Replies
1
Views
181
Hi, Im trying to open an old old Siemens WinCC project. It doesnt have to run i just want to look at the project in WinCC explorer. Its...
Replies
2
Views
699
Hello. I cannot change the SendClock settings for a PROFINET IO device. I need to slow down the CODESYS PROFINET IO controller. What am I doing...
Replies
0
Views
209
Hi, I received the following project from a customer on a QuickPanel Proface 6" that I need to swap to a Siemens Panel. However, I cannot seem to...
Replies
3
Views
350
Back
Top Bottom