Some content on this site is available only to logged-in subscribers. Contact Us for information on becoming a subscriber.

InSource.Solutions | InSource Training | InSource Client Portal
InSource Solutions Logo
Log In Sign Up
InSource.Solutions InSource Training InSource Client Portal Log In Sign Up
  • Home
  • AVEVA Application Server
  • AVEVA Application Server Tech Notes

Application Server script to write CSV data to a file

Last updated: February 24th, 2025

Description

  • Author: Brian Schneider
  • Published: February 24th, 2025

Details:

Overview

A simple example of writing csv (any string) data to a file to a folder path specified in the parent object.

Resolution

UDAs for this Object

DataForFile

String

ErrorMsg

String

FileWriteCsv

Boolean

Script Configuration:

Script Name:

"FileWrite"

Execute Type:

"Execute"

Expression:

"me.FileWriteCsv == 1"

Trigger Type:

"OnTrue"

Script:

me.FileWriteCsv = 0;

me.ErrorMsg = "Error message ... ";

Dim sw AS System.IO.StreamWriter;
Dim csvIASFile AS String;

csvIASFile = MyContainer.MfgFilePath + Me.Tagname + ".csv";

if (System.IO.File.Exists( csvIASFile ) == False) Then
   sw = System.IO.File.CreateText( csvIASFile );
else
   sw = System.IO.File.AppendText( csvIASFile );
endif;

sw.WriteLine(me.DataForFile);

sw.Dispose();

 

server script csv writing
Give feedback about this article

Recommended articles

TN - 1240 Creating a Watchlist Using an Import File

Read More

How to receive group emails

Read More
Support Icon

CONTACT SUPPORT

How to reach us

10800 Midlothian Turnpike Tpke, Suite 209, Richmond, VA 23235

1.877.INSOURCE

Technical Support - 1.888.691.3858

Contact Us

  • InSource Solutions
  • InSource Training
  • InSource Client Portal
  • Log In
InSource Solutions Logo

© 2025 InSource Solutions. All Rights Reserved.

Knowledge Base Software powered by Helpjuice

Expand