AVEVA Plant SCADA Forum
A support forum for AVEVA Plant SCADA (formerly Citect SCADA). Share new and exciting product information, connect, learn, and collaborate with the ecosystem of Plant SCADA Users. AVEVA Plant SCADA a reliable, flexible and high-performance Supervisory Control and Data Acquisition software solution for industrial process customers. This forum is to connect, share, learn and collaborate new and exciting product information. Feel free to join and share to your Ecosystem of Plant SCADA Users.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-12-01 07:19 AM
I am usuing this code to generate automatic report in CSV format but the csv file is generating 0 or NA values
FUNCTION Report_FS( )
STRING SDate,Stime;
SDate=TagRead("StartDateinput");
Stime=TagRead("Starttimeinput");
TrnExportCSV("c:\TrnData.CSV", StrToDate("SDate")
+StrToTime("Stime"), 60, 60 * 60/2, 1,
"F1_power_kwh_cal", "F2_power_kwh_cal","F3_power_kwh_cal","F7_power_kwh_cal","F8_power_kwh_cal","F9_power_kwh_cal","F10_power_kwh_cal","F11_power_kwh_cal");
End
But when i use Timecurrent() function in place of StrToDate("SDate")
+StrToTime("Stime") this is generating data in CSV file.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-12-02 01:07 PM
Hi @soumitra312
I'd recommend running the Cicode debugger to see what value SDate has, and any error that is generated just after the StrToDate function call, which appears to be the reason the CSV file isn't being generated.
See help on StrToDate here:
https://docs.aveva.com/bundle/plant-scada/page/1192587.html
And cicode debugging here:
https://docs.aveva.com/bundle/plant-scada/page/1130205.html
Let us know how you go.
Kind regards
Olivier
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-12-02 01:37 PM
Thank you very much @olivier_vallee , can you please suggest me and if possible give the cicode for the automatic generation of aveva plant scada 2020 R2 report.where user will enter their desired date time .I have no SQL server,data is stored on cdrive.
If possible give the code or correct me the mistake in the cpde
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-12-08 12:21 PM
Hi @soumitra312,
I think you are very close to finding the solution.
I believe debugging the Cicode is the best path forward.
It is not possible to correct the code without knowing all the details.
If you are stuck, I'd recommend reaching out to AVEVA Technical Support who will be able to assist you further.
Kind regards
Olivier
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.