Citect - Timestamp at TrnExportCSV function

Dariusch

Member
Join Date
Sep 2003
Posts
284
Hi All.

I am have some trouble make this function work when not using the "TimeCurrent()" function.

I have the following code:

FUNCTION DSA_EksportCSV_Sillem1301()

TrnExportCSV("c:\Sillem1301_Test1.csv", TimeCurrent(), 1, 60*60, 1, "Trend_1")

END

This function work ok. But when try to make change the "TimeCurrent()" to string it will make the file but without timestamp or data.
This is what I have tried to make

FUNCTION DSA_EksportCSV_Sillem1301()

TrnExportCSV("c:\Sillem1301_Test1.csv", 19/05/06:20:00, 1, 60*60, 1, "Trend_1")

END

At the end I would change the actual date/time with 2 variables, but to test i just made this above.

Thank you

Dariusch
 
Hello,

the timecurrent function is the time in seconds since somewhere 1970 ...

if you want to specifie a date use the StrToTime() and StrToDate functions to convert the time to the correct format.

hope this helps,

Marsupilami
 
Last edited:
Hi Marsupilami

THANK YOU FOR POINTING THE DIRECTION FOR ME ;)

This is the result:

TrnExportCSV("c:\Sillem1301_Test1.csv",(StrToDate("19-05-06")+StrToTime("19:00:00")), 1, 60*60, 1, "Trend_1")

Thank you again.

Dariusch
 

Similar Topics

Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
68
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
73
I have a running backup of Citect and plc and I want to make a spare PC station so I have installed the win XP and somatic net v6.0 and import the...
Replies
3
Views
121
I am trying to display a variable within a cicode function onto a graphics page. This function queries a SQL database. I can get the value onto a...
Replies
3
Views
281
Looking for some help with the connection issue between Citect 2018 and Top Server v6 for Opto22. I’m setting all this up to communicate with some...
Replies
0
Views
118
Back
Top Bottom