Citect Trend

Cic

Member
Join Date
Sep 2020
Location
Portugal
Posts
2
Hi everyone,

I'm new at programming using citect and I'm trying to do a simple programm in cicode where i have a device that resgisters values every two minutes and at midnight sends all the values and timestamps to a SQL table. I'm trying to retrive those values and times and display them on a trend but i can't seem to figure out how to create the trend.

This is the code that I'm using to pass the values from SQL to a Trend Tag and create a new trend.

TrnSetTable("Dados",StrToDate("27/03/2020")+StrToTime("12:23:00"),120,i,TrendTable,0);
TrnGetTable("Dados",StrToDate("27/03/2020")+StrToTime("12:23:00"),120,i,TrendTableRead[0],0);
TrnNew(20,"trn002","Dados","Teste_SQL");

All the values I get from the SQL are sucefully being writen in the TrendTable array, and I'm using the TrnGetTable function to see if the data is being transfered from the TrendTable array to the Trend Tag, which is not even though both functions are returning the correct value of samples written.

Also the TrnNew function returns 0 but doesn't seem to do anything which leeds me to think that there is something missing in the code, maybe I need to use other functions?

I have been searching everywhere and can't seem to find an answer and I'm getting kind of desperate can someone please help?

Thank you.
 
why not use citect trend tags and store the data in citect data logs, then you can plot the trend tags?



You can still record the same data in the SQL.


I would avoid citect and cicode if you can.
 
I retrive the data from SQL to citect and then store it on the trend tags.
But I managed to find what as wrong, it was the date form it should be "-" instead of "/" in
the date.

Have another problem though the data is correct when I check it in the trend files with the Trend Reader but in the trends and process analyst the data is 1 hour ahead. Does this have anything to do with time zones? And if so how do I fix it?

Thank you.
 

Similar Topics

I am using VijeoCitect v7.5 on Desktop having Windows-7 OS. While viewing trends, it is observed that trend is not appearing continuous and value...
Replies
1
Views
552
Recently we lost our recorded data from all our popup trend screens. The values are still shown just not the pen lines. Any help would be greatly...
Replies
5
Views
2,394
Hi, I have a CITECT system that records data into a .dbf file and would like to create a trend from the data and print it. Can anyone help? Thanks
Replies
19
Views
3,017
Hello I am using citect 7.40 and in this i want to popup an specific trend using Trendpopup() by clicking on a button. when i used this function...
Replies
3
Views
2,033
Hi, I'm fairly new to Citect Scada and am currently working on a little fun project that goes alone nicely with my PLC program. When I have a...
Replies
1
Views
2,436
Back
Top Bottom