Wonderware intouch log function

RobinH

Member
Join Date
Jun 2012
Location
Trondheim
Posts
54
Hi,

1. I want to print all analog values automatic each day (dot matrix printer). I would like to be able to chose what time each day to do this every day. Have anyone done this before? Any tips?

2. Same as 1. but I would like to choose which analog points to print. Is this possible?

Best regards
 
Would be pretty simple...

Create a Condition Script that fires once a day using the $Hour tag == time of day you want it to occur...The script itself would print a range of INDIRECT Analog Tags.

Step 2 would be to create a range of memory string tags that you enter the NAMES of the tags you want to print. The first script above would form the Indirect Tags from these names and know what to print.
 
Thank you for your answer robertmee,

I cannot seem to find a command for printing.
Should I save the values to a file first and then use FilePrint() or does it exist any other ways of doing it?

Best regards
 
Build file in this sequence:
This script is based on a Data Change Script using this time based tag.."DataIntervalCount".
It is also setup to only save selected data.

IF V10-CycleAutoMode1 ==1 THEN
V10-RunData01 = $DateString;
V10-RunData02 = $TimeString;
V10-RunData03 = Text(V10-FceMicronsPrimary, "0.0" );
V10-RunData04 = V10-FceHighVac.Comment;
V10-RunData05 = Text(V10-ChamberPressurePSIA, "00.0" );
V10-RunData06 = Text(V10-Setpoint, "0000.0" );
V10-RunData07 = Text(V10-ControlTC, "0000.0" );
V10-RunData08 = Text(V10-WTc01, "0000.0" );
V10-RunData09 = Text(V10-WTc02, "0000.0" );
V10-RunData10 = Text(V10-WTc03, "0000.0" );
V10-RunData11 = Text(V10-WTc04, "0000.0" );
V10-RunData12 = Text(V10-WTc05, "0000.0" );
V10-RunData13 = Text(V10-WTc06, "0000.0" );
V10-RunData14 = Text(V10-WTc07, "0000.0" );
V10-RunData15 = Text(V10-WTc08, "0000.0" );
V10-RunData16 = Text(V10-WTc09, "0000.0" );
V10-RunData17 = Text(V10-WTc10, "0000.0" );
V10-RunData18 = Text(V10-WTc11, "0000.0" );
V10-RunData19 = Text(V10-WTc12, "0000.0" );

V10-Runs_NextLine01 = V10-RunData01;

V10-Runs_NextLine01 = V10-RunData02;

IF V10-Log1_Torr == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData03;
ENDIF;

IF V10-Log1_Microns == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData04;
ENDIF;

IF V10-Log1_PSIG == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData05;
ENDIF;

IF V10-Log1_SP == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData06;
ENDIF;

IF V10-Log1_Control == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData07;
ENDIF;

IF V10-Log1_WkTc01 == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData08;
ENDIF;

IF V10-Log1_WkTc02 == 1 THEN
V10-Runs_NextLine01 = V10-Runs_NextLine01 + "," + V10-RunData09;
ENDIF;

V10-Runs_NextLine02 = " ";

IF V10-Log1_WkTc03 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine01 + "," + V10-RunData10;
ENDIF;

IF V10-Log1_WkTc04 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData11;
ENDIF;

IF V10-Log1_WkTc05 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData12;
ENDIF;

IF V10-Log1_WkTc06 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData13;
ENDIF;

IF V10-Log1_WkTc07 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData14;
ENDIF;

IF V10-Log1_WkTc08 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData15;
ENDIF;

IF V10-Log1_WkTc09 == 1 THEN
V10-Runs_NextLine02 = V10-Runs_NextLine02 + "," + V10-RunData16;
ENDIF;

V10-Runs_NextLine03 = " ";

IF V10-Log1_WkTc10 == 1 THEN
V10-Runs_NextLine03 = V10-Runs_NextLine02 + "," + V10-RunData17;
ENDIF;

IF V10-Log1_WkTc11 == 1 THEN
V10-Runs_NextLine03 = V10-Runs_NextLine03 + "," + V10-RunData18;
ENDIF;

IF V10-Log1_WkTc12 == 1 THEN
V10-Runs_NextLine03 = V10-Runs_NextLine03 + "," + V10-RunData19;
ENDIF;


FileWriteMessage( FcePathRuns + V10-LoadedRunNoText + "RD" + ".csv", -1,
V10-Runs_NextLine01, 0);

FileWriteMessage( FcePathRuns + V10-LoadedRunNoText + "RD" + ".csv", -1,
V10-Runs_NextLine02, 0);

FileWriteMessage( FcePathRuns + V10-LoadedRunNoText + "RD" + ".csv", -1,
V10-Runs_NextLine03 ,1 );


ENDIF;



Is Microsoft Excel on the PC?
If you use the Active X spreedsheet viewer, it has a print function.
And prints the csv in excel format.
 
Here is Header info for above script..


{Run Header build Info}

V10-Runs_Header = "Date";

V10-Runs_Header = "Time";

IF V10-Log1_Torr == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Microns";
ENDIF;

IF V10-Log1_Microns == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Torr";
ENDIF;

IF V10-Log1_PSIG == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",PSIA";
ENDIF;

IF V10-Log1_SP == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",SP";
ENDIF;

IF V10-Log1_Control == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Control";
ENDIF;

IF V10-Log1_WkTc01 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc01";
ENDIF;

IF V10-Log1_WkTc02 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc02";
ENDIF;

IF V10-Log1_WkTc03 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc03";
ENDIF;

IF V10-Log1_WkTc04 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc04";
ENDIF;

IF V10-Log1_WkTc05 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc05";
ENDIF;

IF V10-Log1_WkTc06 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc06";
ENDIF;

IF V10-Log1_WkTc07 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc07";
ENDIF;

IF V10-Log1_WkTc08 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc08";
ENDIF;

IF V10-Log1_WkTc09 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc09";
ENDIF;

IF V10-Log1_WkTc10 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc10";
ENDIF;

IF V10-Log1_WkTc11 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc11";
ENDIF;

IF V10-Log1_WkTc12 == 1 THEN
V10-Runs_Header = V10-Runs_Header + ",Tc12";
ENDIF;


Here is an "On True" Condition script for writing header to file. In my example I use "On True" of the tag "V10-CycleAutoMode1".

FileWriteMessage
( FcePathRuns + V10-LoadedRunNoText + "RD" + ".csv",-1, V10-Runs_Header + "," ,1 );
 
thanks for answering nathan, i will try it and letyou now...

btw i was using something like that but more simple.. and in a while open script with timing 1 second
------------------------------------------------------------------------------------------
MyTag = $DateString + StringChar(44) +$TimeString + StringChar(44) +tag 1+StringChar(44) + StringFromIntg(tag2, 10 )+StringChar(44) + tag3

FileWriteMessage("C:\data\log.csv",-1,MyTag,1);
------------------------------------------------------------------------------

but i had a problem with this.. The values were recorded correcly every second , in second one , they were recorded in row one of the csv , second 2 in the second row... etc

But then I wanted to add one specific value in lets say cell (2,10) , how could that be done ?
 
Also if u know.. whats the difference between

FileWriteMessage("C:\data\log.csv",-1,MyTag,1)

and

FileWriteMessage("C:\data\log.csv",-1,MyTag,0)

is there any other posible value to asign there apart from 0,1 ??
 
ok so if i put 0 , the values will always be recorded in row 1 of the csv , so they would be overwriting always..

but how could i do to write in a specific row ? is it posible ?
 
The 1st parameter is the log file name

2nd = offset (IN BYTES) to where in the file you want to write. I seriously doubt you have that information available to you. 60 entries per minute - You're going to have a file full of data in short order.
You could parse your way down through the file to locate to position of where you want to write, but I don't see how you're going to determine that any place is the correct place to write the data.

I have an issue with what you are wanting to do by updating a timestamped record in your CSV file. I'm thinking you should just put the correct data in each line.

So, answer to your question - No, it would write the data at byte 20.
 
ok..but the records i save are short... but when i stop recording i want to save one single value in cell (5,2) how can i do that ?

lets say i have 50 rows on values in the excel and when i want to stop recording i want to save one last value but in cell (5,2) is there a way to do that ?
 

Similar Topics

Hi, this wonderware application handles 6 batching tanks, I'm recording historical trending of temperature in the tanks, my question is if I can...
Replies
1
Views
3,412
Hello, I was wondering if there is a utility to view alarm log files from InTouch 7.1. I found that the system writes a new alarm log file...
Replies
1
Views
5,664
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
128
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
144
Hi, I am upgrading a Wonderware SCADA form version 9.5 to version 23. I am able to migrate all the graphic, but when to activate the runtime this...
Replies
8
Views
391
Back
Top Bottom