SHIV121

citect scada report generation

16 posts in this topic

Hi everyone...im new on citect scada. I dont know how to generate report in citect scada. Only report generation is remaining in my project. Is anyone known about this. Plz help me

Share this post


Link to post
Share on other sites
I havent used the reporting function but I have generated reports using cicode and writing variable to excel files if this would help

Share this post


Link to post
Share on other sites
Hi. cHud...thank you for reply.. I want to know how to generate reports using cicode & save variables in excel.

Share this post


Link to post
Share on other sites
I also struggled for a long time to get this right....but in the end it is very easy. Heres an example of cicode I used. 1st thing is to create a template in excel and save it. The file copy will make a copy of the template and save it as the newfilename. In this case it is a integer generated in our plc Exec function will open the excel file. You must copy the whole path of excel's exe file into this function. Next you write the values in the rows and columns you specify in the ddewrite function. And the last DDE functions just closes the file. I dont mind sharing this at all as schneider sent me on a wild goose chase before I found out it was very simple FUNCTION Write();STRING NewFileName;NewFileName =IntToStr(Recipe1_Batch_Number);FileCopy("C:\Template.xlsx","C:\Reports\"+NewFileName+".xlsx",0); Exec("C:\Program Files\Microsoft Office 15\root\office15\EXCEL.EXE C:\Reports\"+NewFileName+".xlsx",6); DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R2C1",ING1_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R3C1",ING2_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R4C1",ING3_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R5C1",ING4_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R6C1",ING5_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R7C1",ING6_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R8C1",ING7_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R9C1",ING8_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R10C1",ING9_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R11C1",ING10_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R12C1",ING11_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R13C1",ING12_NAME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R15C1",Handout1_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R16C1",Handout2_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R17C1",Handout3_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R18C1",Handout4_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R19C1",Handout5_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R20C1",Handout6_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R21C1",Handout7_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R22C1",Handout8_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R23C1",Handout9_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R24C1",Handout10_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R2C2",Recipe1_INGREDIENT1_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R3C2",Recipe1_INGREDIENT2_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R4C2",Recipe1_INGREDIENT3_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R5C2",Recipe1_INGREDIENT4_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R6C2",Recipe1_INGREDIENT5_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R7C2",Recipe1_INGREDIENT6_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R8C2",Recipe1_INGREDIENT7_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R9C2",Recipe1_INGREDIENT8_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R10C2",Recipe1_INGREDIENT9_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R11C2",Recipe1_INGREDIENT10_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R12C2",Recipe1_INGREDIENT11_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R13C2",Recipe1_INGREDIENT12_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R15C2",Recipe1_HANDOUT1_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R16C2",Recipe1_HANDOUT2_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R17C2",Recipe1_HANDOUT3_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R18C2",Recipe1_HANDOUT4_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R19C2",Recipe1_HANDOUT5_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R20C2",Recipe1_HANDOUT6_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R21C2",Recipe1_HANDOUT7_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R22C2",Recipe1_HANDOUT8_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R23C2",Recipe1_HANDOUT9_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R24C2",Recipe1_HANDOUT10_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R25C2",Recipe1_MOL_MIX_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R27C2",Recipe1_SP_TOTAL);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R28C2",Recipe1_MIXING_TIME);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R29C2",Recipe1_MC31_SPEED_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R30C2",Recipe1_MC33_SPEED_SP);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R2C3",Recipe1_INGREDIENT1_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R3C3",Recipe1_INGREDIENT2_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R4C3",Recipe1_INGREDIENT3_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R5C3",Recipe1_INGREDIENT4_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R6C3",Recipe1_INGREDIENT5_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R7C3",Recipe1_INGREDIENT6_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R8C3",Recipe1_INGREDIENT7_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R9C3",Recipe1_INGREDIENT8_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R10C3",Recipe1_INGREDIENT9_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R11C3",Recipe1_INGREDIENT10_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R12C3",Recipe1_INGREDIENT11_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R13C3",Recipe1_INGREDIENT12_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R15C3",Recipe1_HANDOUT1_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R16C3",Recipe1_HANDOUT2_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R17C3",Recipe1_HANDOUT3_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R18C3",Recipe1_HANDOUT4_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R19C3",Recipe1_HANDOUT5_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R20C3",Recipe1_HANDOUT6_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R21C3",Recipe1_HANDOUT7_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R22C3",Recipe1_HANDOUT8_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R23C3",Recipe1_HANDOUT9_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R24C3",Recipe1_HANDOUT10_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R25C3",Recipe1_MOL_MIX_PV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R27C3",Recipe1_PV_TOTAL);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R2C4",Recipe1_INGREDIENT1_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R3C4",Recipe1_INGREDIENT2_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R4C4",Recipe1_INGREDIENT3_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R5C4",Recipe1_INGREDIENT4_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R6C4",Recipe1_INGREDIENT5_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R7C4",Recipe1_INGREDIENT6_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R8C4",Recipe1_INGREDIENT7_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R9C4",Recipe1_INGREDIENT8_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R10C4",Recipe1_INGREDIENT9_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R11C4",Recipe1_INGREDIENT10_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R12C4",Recipe1_INGREDIENT11_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R13C4",Recipe1_INGREDIENT12_DEV);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R15C4",Recipe1_DEV_HAND1);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R16C4",Recipe1_DEV_HAND2);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R17C4",Recipe1_DEV_HAND3);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R18C4",Recipe1_DEV_HAND4);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R19C4",Recipe1_DEV_HAND5);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R20C4",Recipe1_DEV_HAND6);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R21C4",Recipe1_DEV_HAND7);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R22C4",Recipe1_DEV_HAND8);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R23C4",Recipe1_DEV_HAND9);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R24C4",Recipe1_DEV_HAND10);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R25C4",Recipe1_DEV_MOL_TO_MIXER);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R27C4",Recipe1_DEV_TOTAL);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R31C2",RECIPE_NUMBER);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R32C2",Recipe_Name);DDEWrite("Excel","C:\Reports\"+NewFileName+".xlsx","R33C2",Recipe1_BATCH_NUMBER); DDEExec("EXCEL.EXE","[Close(1)]"); DDEExec("EXCEL.EXE", "[Quit]"); END

Share this post


Link to post
Share on other sites
very very thank you for your reply... as per your massege. First i created two integer tags then i write the cicode as u told. Now i want to see the values of that two tags in the excel file but didnt get it.what i have to do for that. I attached the cicode which i created and graph screen, please check it,,, i think something is wrong..

Share this post


Link to post
Share on other sites
Ok first of all in in your ddewrite functions where you put "temp001" look at my example. This must be the row and column number. Secondly are you calling the function "write" in the scada somewhere? With a button or an event? This code doesnt permanently write the data across. It must be triggered and then will write the data. If you want to permanently have the real value of the tags displaying in an excel file other codes needs to be used. Did you create a excel file called Template.xlsx and is the file situated in the directory that you put in the code? Edited by cHud

Share this post


Link to post
Share on other sites
Hieee.....very thankful to you, its working.. .... Is this possible to see that excel sheet on scada screen page continously. Or i have to create the design like rows and columns on the scada screen.

Share this post


Link to post
Share on other sites
Like I said if you want to create a report like for batches or something that needs a new file then do what I did. If however you want just one excel file with continuous values then you have to paste a specific link in each cell of an excel file. (I'm not 100% sure about the syntax of this link, but if I remember I searched quite a bit on google for citect and excel and found the syntax on a forum). Why would you want to display tags on an excel spreadsheet in citect if you have the tags values already in citect. You can just display them on a page like you did. Otherwise you are going to have to use active x in citect to display the spreadsheet. Look in the help for this

Share this post


Link to post
Share on other sites
....OK.... Very thankful for your valuable support.

Share this post


Link to post
Share on other sites
The CICODES given by you is works perfectly. But in my report there are only 5 process tags are used which are logged in excel sheet. In my report there is one digital tag which generates pulse every after 10 minutes when cycle is started. when first pulse is received the process tag values are logged in first row with five columns. After 10 minutes when 2nd cycle start it again receives the same pulse but at this time the values must be logged in 2nd row with 5 column and continuously up to the end of the day i.e at 11.59.00 & it is saved. At 12.00.00 the similarly values are logged in another excel sheet and process will be continued similarly. VERY THANKFUL TO YOU FOR YOUR HELP AND SUPPORT.

Share this post


Link to post
Share on other sites
hi....i was tried various loops in cicode for it but still its not working...I don't know what's the issue... pls help me if anyone knows about it.

Share this post


Link to post
Share on other sites
Do you have a PLC in this system?  

Share this post


Link to post
Share on other sites
Yes...I have a messung plc in that system. Which generates the pulse after every 10 min.  Im using that pulse to log the data in first row, Again after 10 mins when it generates same pulse the values are logged in 2nd row  then after again 10 mins it gives pulse and data logged in 3rd row. Similarly Continues up to the end of the day and at 11.59.00 it gets saved. On 12.00.00 AM new excel logs data similarly 

Share this post


Link to post
Share on other sites
You could have 2 internal words(control of these words can be done in plc or cicode). One that increments at 12:00 every day and one that increments everytime you receive send the pulse So if you compare the 1st internal word since the last time you wrote to the file and it is the same then you know to compare the second words value to know in which row to write the value to.  If the 1st internal word is different to the last time you wrote to the file you know to create a new file and write new value to 1st word and zero the 2nd word to start the process again. Hope you understand this. There are lots of different ways to do this. This is just the quickest way I could think of now  

Share this post


Link to post
Share on other sites

Dear thanks to both of cHUD and SHIV121.To have read your conversation I got an idea that how I can make it.SHIV121 could you share your SCADA project file which you tested successfully.Because I confused that beloved cHUD mentioned  in his comments regarding "temp001" and "write" points.I didn't understand clearly.

My mail is  jahir01717@gmail.com 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now