master:fileread parametersPSCAD File Read

Every parameter of the PSCAD File Read (master:fileread): 9 names, with the unit, the default and the meaning PSCAD gives each one. Copy a name into parameters().

What master:fileread is

Reads columns of a data file into the run, replaying a recorded signal as an input.

Definition
master:fileread
PSCAD name
File Read
Category
Runtime
Parameters
9, in 1 group; 2 carry a unit
Read from
PSCAD 5.0.0, 2026-11-07

Most used master:fileread parameters

ParameterUnitDescription
fname·File Namethe file
nch·Number of Columns in the Output Filenumber of columns
sfreqHzsampling Frequencysampling frequency

Read and write master:fileread in Python

import mhi.pscad

pscad = mhi.pscad.connect()              # the PSCAD that is open; launch() starts one
project = pscad.project("my_case")       # a case loaded in the workspace

for comp in project.find_all("master:fileread"):   # the exact definition, namespace first
    params = comp.parameters()           # every parameter, as PSCAD holds it
    print(str(params["fname"]))          # File Name

comp = project.find_all("master:fileread")[0]
comp.parameters(fname="my_signal")       # write one parameter
  • A parameter is named exactly as in the table, letter case included: parameters() gives every one of them in a dictionary, and a name the component does not have is refused.
  • A value that carries a unit comes back as a number whose unit is only in its text, so read it as text first (str(...)) or the unit is lost. PSCAD keeps a written unit as it is given: "2500 [mohm]" stays in mohm.
  • A Choice is read and written as its symbol (the capitals in "Written as"), not as the words PSCAD shows in the dialog.
  • find_all() takes the exact definition only. A wildcard or a bare name without master: comes back empty; the Builder's px_find walks the pages for those.

The Builder's runtime does the same with the unit handled for you: px_get(comp, "fname") and px_set(...), which also records the old value so the case is put back at the end. Getting started shows them.

Configuration

ParameterUnitDefaultDescription
NameText··Name for IdentificationEnter a name for identification
delayReals0.0Delaytime offset or delayAt least 0
fnameText·emtdc_01.outFile NameEnter the full name of the file to be read
nchChoice·11Number of Columns in the Output FileEnter the number of columns in the file including time column if existsWritten as 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9, 10 = 10, 11 = 11
pathChoice·RELATIVEPath to the File Given asFilename may be given as an absolute path or relative to where the project resides.Written as RELATIVE (relative path), ABSOLUTE (absolute path)
repeatChoice·REWIND_AND_REPLAY_AGAINAt the End of DatafileSelect what to do if the end of the file is reached before the end of simulationWritten as OUTPUT_LAST_READ_VALUES (output the last read values), REWIND_AND_REPLAY_AGAIN (rewind and replay again), EXTRAPOLATE (extrapolate)
sfreqRealHz6400.0sampling FrequencyEnter sampling frequency used in the fileAt least 1E-307Used when tinfo==1
startChoice·ZEROBefore the DelaySpecify what to output before the specified delayWritten as ZERO (zero), OUTPUT_FIRST_VALUE_OF_DATAFILE (output the first value of datafile)
tinfoChoice·FIRST_COLUMNS_CONTAINS_TIMESampling Time InformationSampling time of the file may be configured to read from the first column or from the specified frequencyWritten as FIRST_COLUMNS_CONTAINS_TIME (first columns contains sampling time), KNOWN_FREQUENCY (known sampling frequency)

Related

← master:doblestate doblestate · master:optimum_run Optimum Run →