0% found this document useful (0 votes)
37 views69 pages

Famos Ii

Uploaded by

pradeep12.ats
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views69 pages

Famos Ii

Uploaded by

pradeep12.ats
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

imc ACADEMY

Training Material

imc FAMOS II
Projects and Sequences
18th Edition - 2017-02-15

© 2017
imc Meßsysteme GmbH • Voltastraße 5 • 13355 Berlin • Germany
imc Test & Measurement GmbH • Max-Planck-Str. 22b • 61381 Friedrichsdorf • Germany
About imc ACADEMY
Welcome to the imc ACADEMY training program. We thank you for joining us for today’s training session.

imc ACADEMY has existed since 1998 and offers a broad scope of instruction on measurement
technology from imc. For this purpose, you have a choice of different paths of knowledge transfer, for
instance training sessions, workshops and seminars. To cover the various topics, several traininers are
available who each focus on a different specialized area.

Learn more about imc ACADEMY at www.imc-academy.de.

For any questions which may arise, imc's support department is happy to help:
By e-Mail: [email protected] [email protected]
By telephone: +49 (0)30 467090-26 +49 (0)6172 59672-40
By fax: +49 (0)30 463157-6 +49 (0)6172 59672-222

About this training


imc FAMOS (Fast Analysing and Monitoring of Signals) is a program for fast analysis and visualization of
measurement data. The basis for this tool kit's high processing power is the structure of the data sets
used. Only data sets having this structure yield useful, meaning interpretable, results.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Disclaimer of liability
The contents of this documentation have been carefully checked for consistency with the hardware and
software systems described. Nevertheless, it is impossible to completely rule out inconsistencies, so that
we decline to offer any guarantee of total conformity.
We gratefully accept any suggestions for improvements, please contact our Hotline (hotline@imc-
berlin.de).

We reserve the right to make technical modifications of the systems.

Copyright
© 2017 imc Meßsysteme GmbH, Berlin, Germany
© 2017 imc Test & Measurement GmbH, Friedrichsdorf, Germany

This documentation is the intellectual property of imc Meßsysteme GmbH and imc Test & Measurement
GmbH. imc Meßsysteme GmbH and imc Test & Measurement GmbH reserve all rights to this
documentation. The applicable provisions are stipulated in the "imc Software License Agreement".
The software described in this document may only be used in accordance with the provisions of the "imc
Software License Agreement".

imc Software and Microsoft® Windows


imc software runs on the Microsoft® Windows operating system.

GPL Sources
Some components of our hardware use software, that is licensed under GNU General Public License
(GPL). If you would like a copy of the GPL source code contained in this product please contact our
Hotline.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Table of Contents 5

1 Working with the Project Administration ......................................................... 6


1.1 Projects ...................................................................................................................... 6
1.1.1 The Project-Explorer ....................................................................................................................... 6
1.1.2 Project properties .......................................................................................................................... 7
1.1.3 Loading, saving and running a project ............................................................................................ 8
1.1.4 Special properties of an active project ........................................................................................... 9
1.2 Exercise: Organized work methodology with projects ............................................... 11
2 Advanced use of the project administration ................................................... 16
2.1 Exercise: Determining a frequency manually ............................................................ 16
2.2 Exercise: Automated determination of the frequency ............................................... 20
3 Sequences with parameter tranfer ................................................................. 23
4 Generating artificial signals ............................................................................ 24
4.1 Exercise: Generating an artificial signal with value inputs ......................................... 24
4.2 Exercise: Generating an artificial signal with parameter transfer ............................... 26
5 Working with text variables ............................................................................ 28
5.1 Text and addressing options ..................................................................................... 28
5.2 Exercise: Text replacement with variables ................................................................ 29
5.3 Exercise: Groups as variables .................................................................................... 30
5.4 Exercise: Naming data sets automatically ................................................................. 34
6 Targeted detection/isolation of events .......................................................... 36
6.1 Exercise: Comparison operators ............................................................................... 37
6.2 Exercise: Logical operations ...................................................................................... 39
6.3 Exercise: Determining slopes and isolating values ..................................................... 41
7 Working with loops ........................................................................................ 43
7.1 Exercise: Displaying relative maxima using a loop ..................................................... 43
7.2 Exercise: Importing a complete data folder ............................................................... 46
8 Loading files ................................................................................................... 48
8.1 The command FileLoad and FileSave ......................................................................... 48
8.2 Exercise: Opening a file to read ................................................................................ 51
8.3 Exercise: Opening a file for writing using the File* commands .................................. 54
9 Specific Examples ........................................................................................... 56
9.1 Multi-file selection ................................................................................................... 57
9.2 Calculation of a dataset ............................................................................................ 58
9.3 Fill report automatically ........................................................................................... 59
9.4 Connect intervals ..................................................................................................... 60
9.5 Further examples ..................................................................................................... 62
10 Import Export ............................................................................................... 64
10.1 The ASCII/Excel-import Assistant ............................................................................ 64
10.2 Export via ASCII or Excel ......................................................................................... 66
10.3 Import-filters .......................................................................................................... 67
10.4 Import with the File-Assistant ................................................................................ 68
Index ................................................................................................................. 69

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
6 Working with the Project Administration

1 Working with the Project Administration


1.1 Projects
The settings made for the folder structure determine in which folders any sequences, curve
configurations or report templates are always saved. This files belonging to only one assignment are
alongside others which are called by many assignments (e.g. a standard report template). In order to
work in an organized way with imc FAMOS, files belonging to one assignment should be saved together –
the project administration serves this purpose.

1.1.1 The Project-Explorer


The Project-Explorer is the command center for administering imc FAMOS projects. Here, you can create
new projects, load, run or delete existing ones.
To call the Project-Explorer, use the menu item File > Open > Project.
imc FAMOS Project folders are denoted by a special icon:

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Projects 7

1.1.2 Project properties


In the project properties, you determine which additional settings are to be associated with the current
project. By means of the menu item Project > Miscellaneous > Properties, you reach the following dialog:

· Variables:
o The complete content of the Variables list is saved. In case the amount of data is very large, you
should not activate this option, since the data will be copied to the project folder.
· Open curve window:
o The configurations of all open curve windows are saved.
· Open sequences:
o The filepaths of the currently open sequences in the Editor window are saved. When loading the
project, the system attempts to re-load and display the sequences.
· Open Panels:
o The paths to the Panel-pages which are open are saved; not the panels themselves.
· Project-Favorites:
o With the project there is an associated private group of favorites named "Project favorites: <Project
name>". Favorites created by the user within this group are automatically saved with the project.
· Window layout:
o The position and configuration of the main imc FAMOS windows, and of the Data Editor, Dialog
Editor and Report Generator, whichever are open, are saved.
· Input window contents:
o The complete content of the Editor input box is saved.
· Data Browser:
o With this option the state of the Data-Browser is saved.
· Variable window: Display filter
o The filter settings in the Variables window are saved.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
8 Working with the Project Administration

1.1.3 Loading, saving and running a project


Load project
To load an already existing project, select the desired project from the Projects list in the Project-
Explorer and click on the Load button.
When a project is loaded, the following actions are performed:
· The name of the loaded project is displayed in the title bar of the imc FAMOS main window at
the top right.
· Sequences belonging to the project are denoted by a "P" in the tab.
§ The settings saved in the project are restored. These can include:
· Variables
· Curve windows
· Input box contents
· Opened sequences/dialogs in the Editor box
· Project favorites. These are shown in the "Favorites" box as an additional sub-group
· The default folders for sequences/dialogs, curve configurations (*.ccv) and reports (*.drb)
are changed to the project folder.

Save, Close, Delete


· In order to save the current project, use the menu item Project > Save > Save. In accordance with
the project components selected among the project properties, the files and settings belonging to
the project are stored in the project folder.
· To close the active project, use the menu item Project > Miscellaneous > Close. A confirmation
prompt may appear to verify whether to save changes to the project.
· In order to remove a project which is no longer needed, you can use the button Delete project in
the Project-Explorer. The entire project folder including all subfolders is deleted. Alternatively, you
can also simply delete the project folder using the Windows Explorer or any other file manager.

Current/Last session
· The so-called current session represents a special case of a general imc FAMOS project. With the
menu item Extra > Session > Save current session, you can save the current state of the imc FAMOS
session. This can include the content of the variables list, the open curve windows and sequences,
the arrangement of the various imc FAMOS working windows and the input box contents.
· Using the menu command Open last session, you can restore the saved session, for example, in
order to proceed working where you left off on the previous day.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Projects 9

1.1.4 Special properties of an active project

Search order
When a project in imc FAMOS is active, this has the following additional consequences:
The functions/comands "CvConfig, RgDocOpen, SEQUENCE, Dialog" for loading files which pertain to
the project use an alternative search order, unless a complete filepath is specified.
Search order:
§ Current working folder (determined by the higher-level sequence/dialog)
§ Project folder
§ The pre-set default folder for the respective file type (which can be set in the options under
"Folders" or such functions as SDIR, SetOption(..), RgSetDir).

Load a sequence/dialog/curve configuration/report:


If the file does not belong to the project folder, you will be prompted to confirm whether to add the
file to the project:

If you choose "No", the selected file is loaded without any changes.
By contrast, if you choose "Yes", the selected file is copied to the project folder and the newly created
copy is opened. In this way you can easily import already existing files in a project.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
10 Working with the Project Administration

Saving a sequence/dialog/curve configuration/report:


If the selected filepath does not match with the project folder, you are prompted to decide whether to
save the file in the project folder instead.

If you choose "No", the file is saved under the originally selected path.
By contrast, if you choose "Yes", the file is save in the project folder instead.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Organized work methodology with projects 11

1.2 Exercise: Organized work methodology with projects


Assignment

· Create your first project, open the waveform sintest1 and perform digital smoothing on it.
· Create a report about it and save everything as a project.

Procedure
Step 1:
Go to File > Restart

· Go to File > New > Project


· In the dialog which is now open, enter the name "My Project”.
· Below is shown in which folder your project is now located.
· Close the window by clicking on OK.

Step 2:
Next, enter the following command lines in the Editor box:
LOAD sintest1
interval = BoxValue?("Smoothing width", 3, 0)
fs = xdel?(sintest1)
smooth_sintest1 = Smo(sintest1, interval * fs)
· Run the lines all the way by clicking on .
· Confirm the value 3 in the box which opens.

Step 3:
· Graphically display in two coordinate systems the waveforms sintest1 and smooth_sintest1
one above the other.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
12 Working with the Project Administration

· Save the curve configuration as smoothing.ccv.

· Run the sequence all the way through repeatedly and test as the smoothing window has 5,
10, 100, 200 values.

Step 4:
· Create a report [Extra > Tools > Report Generator] having a curve object with
§ the title "curve" [click the right mouse button in the curve window] and
§ a text object with the title "textbox" and the text: "Smoothing over a width of #f3.0
intervals of length 20µs."

· The text #f3.0 is a placeholder which is replaced by a function later.

· Save the report as Report1.drb.

Step 5:
Add these command lines to your sequence:

Error = CwLoadCCV(sintest1, "smoothing.ccv")


Error = RgDocOpen("report1.drb",0)
Error = RgCurveSet("curve", sintest1,0)
Error = RgTextSetData("textbox", interval, 0)
[Group: Presentation > Curve window / Report Generator]

· Save the sequence under smoothing.seq.

· Run it all the way through by entering sequence smoothing in the input box.

· Save your entire project using the menu item Project

Step 6:
· Close the Report Generator without saving.
· Delete the Editor box contents.
· Exit imc FAMOS.
· Start imc FAMOS again.
· Choose under File > Open > Project > Last the menu item "My project".
· The sequence smoothing is open again.
· When you run the sequence, you have the same curve window back and the report you
composed.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Organized work methodology with projects 13

Hint
· The report template should not be saved after replacing the placeholder, because the
replaced text will be saved.

Result
· A noisy sine signal is smoothed. The exercise is saved as a project.

Noisy and smoothed sinewaves

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
14 Working with the Project Administration

Report

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Organized work methodology with projects 15

Remarks
· After creating "My project", all newly created files are saved by default in the project folder.
· If you wish to save your project or make it available to others, you only need to use the
project folder and do not need to search for the individual files from the sub-folders.
· For this reason, the following functions change the order in which imc FAMOSsearches for the
files, unless you provide a complete filepath and a project is open:
o SEQUENCE
o Dialog()
o RgDocOpen()
o CvConfig()
o CvLoadGlobalSetting()

The search order is changed as follows:


o Current working folder (folder in which the sequence to be called is located)
o Current project folder
o Pre-set default folder

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
16 Advanced use of the project administration

2 Advanced use of the project administration


2.1 Exercise: Determining a frequency manually
Assignment

· Determine the fundamental frequency in a noisy signal and output it as a reference signal.

Procedure
Step 1:
· Create a project for this exercise under the name FindMaximum ( File > New > Project )

Write this sequence in the Editor box and run it:

Load sintest1
sintest1 = Red2(sintest1) ; Editing > Resampling
spec_sintest1 = Spec(sintest1) ; Analysis > Spectral Analysis > General

Step 2:
Determine the frequency having the highest amplitude in the spectrum.
· select spek_sintest1 and display it in the Data Editor
· display spek_sintest1 in the curve window .

By means of Drag&Drop and the plug symbol , link the Data Editor with the curve window.

Change the line type to Spikes in Configuration > Lines.

Measure the quantities desired with the help of the Data Editors and/or the curve window.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Determining a frequency manually 17

Determining the maximum amplitude and the associated values

Step 3:
Enter the values found (amplitude: 3.032V; frequency: 372.2Hz; phase: -93.15°, offset:
0.00638V).

A = 3.032
fmax = 372.2
phi0 = -93.15 * PI/180
off = 0.00638
t = ramp(0,xdel?(sintest1),leng?(sintest1))
signal = A * Cos(PI2 * fmax * t + phi0) + off
SetUnit(signal,"s",0)
SetUnit(signal,"V",1)
[SetUnit: Variables > Properties > Units]

Run the sequnce.

· Show the signals sintest1 and signal together in one curve window.

· Save the Editor box contents as maximum_hand.seq.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
18 Advanced use of the project administration

Step 4:
· Open the menu under Project > Miscellaneous > Properties and checkmark all options.
· Exit the menu with OK

Settings in Project properties dialog

· Save the project and close imc FAMOS.

· Next, re-open imc FAMOS and load your project.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Determining a frequency manually 19

Result

You generate a reference signal at the fundamental frequency, which you can compare with
your noisy signal. The result is saved along with all components as a project. After loading the
project, you have opened all the same variables, curve windows and sequences as were open
before exiting imc FAMOS.

Remarks
· By adjusting the project property settings, you can determine yourself what you wish to save.
Thus you can save variables, for instance, without having to save them as a data set, and have
them available for further processing. If you change the project properties later, so that for
example you no longer need to save your variables, then imc FAMOS deletes any previously
saved variables from your project folder.
· Consider providing helpful comments on your sequences, so that others can later make sense
of them.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
20 Advanced use of the project administration

2.2 Exercise: Automated determination of the frequency


Assignment

Enhance the previous sequence, so that imc FAMOS imports and displays the waveform’s
values by itself.

Procedure
Step 1:
Open your project FindMaximum.

Save your sequence maximum_hand.seq under the new name maximum_auto.seq by clicking
on Save As in the tab's context menu.

Step 2:
Now replace the numbers with the following formulas and then run the sequence:

A = Max(spec_sintest1.M)
fmax = Pos(spec_sintest1.M, A)
phi0 = Value(spec_sintest1.P, fmax)*InRad
off = ValueIndex(spec_sintest1.M, 1)

Step 3:
After LOAD sintest1 add the following command line:

waveform = sintest1

· Next, in the subsequent code, replace sintest1 with waveform. [In the ribbon Edit > Find >
Replace]
· Run the sequence again.

· Display the waveforms waveform and signal in one window.

· Save all your curve settings as curve.ccv and then close the curve window.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Automated determination of the frequency 21

Step 4:
Replace the command lines
LOAD sintest1
waveform = sintest1

with the following lines:

filename = DlgFileName("c:\imc\dat", "dat", "Select file",0)


filename = "~034" + filename + "~034" ; Add quote signs (= ASCII34) to
the path
FAMOS
Load <filename> waveform
Spaces in path names can be escaped with the help of quotation marks by using SvToChar(34)
or "~034".

Spaces in path names can be escaped with the help of quotation marks by using SvToChar(34) or
"~034".

At the end of your sequence replace all command lines after the calculation of the reference
signals (signal =…) with:

x_waveform = Unit?(waveform, 0)
SetUnit(signal,x_waveform,0)
y_waveform = Unit?(waveform, 1)
SetUnit(signal,y_waveform,1)
Error = CwLoadCCV(signal, "curve.ccv")
[DlgFileName() belongs to group Presentation > Dialogs > Pre-defined]

· Open autostart.seq from your project folder and write instead of the command line
BoxMessage… the line SEQU maximum_auto

· The Autostart sequence can be run by double-clicking on the Project Favorites entry or using
the menu item Project > Miscellaneous > Run .
· Test the sequence with a variety of data sets, e.g. square.dat, sin3.dat...

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
22 Advanced use of the project administration

Result

You now have a project which determines the fundamental frequency of a vibration signal
which is transferred and displays it graphically as a reference signal along with the original
signal.

Remarks
· The Autostart sequence is created by imc FAMOS in the corresponding folder when a new
project is set up and initially only contains a change notification.
· If you start your main sequence via the Autostart sequence, you can run the project directly.
This also allows others to use your project without needing to know which sequence must be
started and how.
· Besides the two ways to run the Autostart-sequence, either via its Favorites entry or via the
menu, there is the alternative of opening imc FAMOS and the project directly as a Windows
shortcut.

Start Project via Windows Shortcut


As the target for the shortcut to the project named Projectname, enter the following line:
C:\imc\Bin\Famos.exe /P "C:\imc\Projects\FindMaximum"
Double-clicking on the shortcut then opens imc FAMOSand the project and runs the
Autostart sequence.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
23

3 Sequences with parameter tranfer


General
What is a sequence?
· A sequence comprises a series of formulas or commands which are carried out in a designated
order. The sequence has such control commands as loops and conditional branching.
When does it make sense to use sequences?
· Sequences are always helpful whenever analysis, report composition, documentation or
visualization of data proceed according to a fixed pattern. A sequence may be a good idea in the
following cases:
§ Analyzing large quantities of data according to specific criteria
§ Recurring analysis procedures
§ Complex documentations

Sequences with parameter transfer


To achieve the greatest possible flexibility, sequences are able to transfer parameters. A maximum
of 9 parameters can be used, which must be designated PA1 through PA9.
· The parameter number is determined by the order in which it is called in the sequence.
· A parameter can be a variable, a sequence, a file or a function, in other words any object which
can occur in imc FAMOS.

For a quick introduction, open the Sequence Editor and write the following:
LOAD PA1
SHOW PA1

Save this sequence under "parameter1.seq"

Now call the sequence in the Input box as follows:


SEQUENCE parameter1 slope
Instead of SEQUENCE it is also possible to write sequ or SEQU.

When the sequence is run, the file slope is opened and displayed in a curve window.

How does it work?


· imc FAMOSuses a simple method: before the sequence is run, imc FAMOSreplaces the
placeholders PA1, PA2 etc. with the text appearing after the sequence call. To better
understand, imagine the following scenario:
§ You open a sequence which contains parameters.
§ Use find and replace to replace all placeholders with the corresponding texts after the
sequence call.
§ Run the edited sequence.
· This is exactly what imc FAMOS does, automatically and in the background.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
24 Generating artificial signals

4 Generating artificial signals


4.1 Exercise: Generating an artificial signal with value inputs
Assignment

Write a sequence which is able to generate arbitrary sinusoidal signals, and then use it to make
two different signals. The general equation of a sinusoidal oscillation is: y = A•sin(ω t+φ )
+offset.

Procedure
File > Restart

Write the following sequence and provide comments.


_amplitude = BoxValue?("Enter amplitude",1,0)
_frequency = BoxValue?("Enter frequency",1,0)
_phase = BoxValue?("Enter phase shift as multiple of pi",0,0)
_offset = BoxValue?("Enter offset",0,0)
duration = 1 ; [s]
fs = 1000 ; [Hz]
x = Ramp(0,1/fs,duration*fs)
sine = _amplitude * sin(pi2*_frequency*x + _phase*pi) + _offset
SetUnit(sine,"s",0)
SetUnit(sine,"V",1)
show sine
[BoxValue?-function in group 10; Ramp function in group 6; Sin function in group 1; SetUnit function in group 17; Xdel
function in group 16]

· Save the sequence as artificial_signal.seq:

Run the sequence with a variety of values for the amplitude, frequency, phase and offset – in
the example: 1,1,0,0 and 2,2,0,0.

Result

The user can generate various sinusoidal signals be entering the relevant factors accordingly.

Remarks
With the SetUnit-function, the correct units for the x- and y-axis are applied to the sinusoidal
signal.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Generating an artificial signal with value inputs 25

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
26 Generating artificial signals

4.2 Exercise: Generating an artificial signal with parameter transfer


Assignment

· Modify the previous sequence. The necessary sine function factors are now transferred as
parameters (PA1–PA4) upon calling the sequence.
· Create a favorite function entry.

Procedure
Replace the first four command lines by the following and
_amplitude = PA1
_frequency = PA2
_phase = PA3
_offset = PA4

Save the sequence as para1.seq:

Save the sequence as a favorite with the name "Parameter".


§ Click on the Favorites tab in the Functions box.
§ In the menu which opens in response to clicking the right mouse button over the
window, select New Entry….
· Enter as the designation "Parameter". Do not set a check in the box for "Execute!".
· Enter for Formula/Instruction "sequ para1".
· For the short description, compose a description of the function.
· Under Help text, make not of the order of the parameters transferred.

· Go back to the input window and delete it if necessary.


· Double-click on the new favorite.
· In the input window, the instruction SEQU para1 now appears.

Let the sequence run with a variety of parameters – in the example: 1,1,0,0 and 1,2,1,1.
[Parameters are separated by spaces, written directly after the sequence call, e.g.

sequ para1 0 0 1 1

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Generating an artificial signal with parameter transfer 27

Result

You obtain various sinusoidal signals generated by parameter transfer and not by input in
boxes.

Definition of favorites with explanation of the necessary parameters

Remarks
· The sequence is not carried out right away when the Favorites entry is clicked on, but may
only be started once the parameters PA1 through PA4 have been specified in the Editor box.
This is why when defining the favorite the checkmark by “Execute!” was not set. Any
sequence which is not run automatically can be recognized by the absence of an exclamation
point in front of the favorite’s entry.
· When calling a sequence having parameters, these are available under the names PA1
through PA9. When the sequence is run, the parameter values transferred are applied instead
of the PA-variable.
· If the sequence is interrupted by a breakpoint or by an error, then the PA-variables’
momentary values can be displayed by clicking on .
· If you use the SEQU command to call a sequence and if you wish to run through it in
individual steps, then instead of running single steps (F9 or ), you must run single steps in
the sub-sequence (Shift + F9 or right-click the mouse in the button bar).

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
28 Working with text variables

5 Working with text variables


5.1 Text and addressing options
General text options
"" Normal Text MyText= "MyChannel"

<> Variable from <MyText>= Data


; Angle brackets converts text into variable.
text:
{} Variable with {12XY Channel @86%} = Data/100*86
; Combined with text variable:
"forbidden"
Text= "Channel %1\2"
characters: {<text>}= empty
Text array FourTexts = TxArrayCreate(4)
FourTexts[2] = "Text for the second element"
SecondText = FourTexts[2]

; Dynamic extended text field


TxArray = TxArrayCreate(0) ; Initial size is 0
Index = 1
WHILE Index <= 5
; TxArray grows automatical
TxArray[Index] = "Line "+ TForm( Index, "F00")
Index = Index+1
END

General addressing options


: Group MyGroup:sintest1= sintest1
MyGroup:sintest2= sintest2
MyGroup:sintest3= sintest3

[ ] Index For samples:


X= Sintest1[3] -> 3rd sample of sintest1
For groups:
SecondChannel= MyGroup:[2] ; copies sintest2 from group
For matrices or segmented waveforms:
MyMatrix[x,y]= z
Example:
;Create Matrix
dim= 10
MyMatrix= Ramp(0, 1, dim*dim) * 0
setseglen( MyMatrix, dim)

; Set Value
x= 2
y= 3
z= 5
MyMatrix[x,y]= z

; Read Value
My_Z_Value= MyMatrix[x,y]

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Text replacement with variables 29

5.2 Exercise: Text replacement with variables


Spaces in path names can be escaped with the help of quotation marks by using SvToChar(34)
or "~034".

Assignment

· Load a waveform with the operator for text replacement.

Procedure
Run these command lines. Adapt the path to your example file sintest1.dat if necessary:
Filename = "c:\imc\dat\sintest1"
LOAD <Filename>
LOAD <Filename> data
Compare the waveforms open in the Variables box sintest1 and data.

Result

You have opened the original waveform sintest1.dat twice in imc FAMOS, once as sintest1 and
once as data.

Remarks
The operator <…> is replaced with the variables’ content similarly to the case with search-and-
replace in text editing. Only afterwards are the command lines carried out. Thus, this exercise
carries out:
LOAD c:\imc\dat\sintest1
This command line opens the waveform under the filename as sintest1. The next line also
opens the waveform sintest1.dat, but under the name which you supply as the parameter – in
this exercise as "data".

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
30 Working with text variables

5.3 Exercise: Groups as variables


In imc FAMOS, there are no so-called local variables. Any variable once created is thus available for all
sequences, sub-sequences and dialog events. This fact can easily lead to errors in the running of the
program, for example since an iteration loop in a sequence uses "i" as the iteration variable. If one then
calls such a sequence from within another sequence, then much caution is necessary if "i" is used in the
calling sequence.
Along with the problems associated with using local variables, there is also a problem with comparing
multiple measurements of the same type. If all measurements contain a waveform named “Torque”,
then it would be necessary to rename it each time one is opened, or to ensure somehow that any already
existing waveforms named “Torque” are not overwritten.
One way to avoid this problem is to use groups. imc FAMOS includes texts and values as data types, and
also groups as well. A group in imc FAMOS can encompass all other data types except for another group.
By means of the groups it is possible both to clearly structure the variables needed for running
sequences, and to keep order among a large amount of variables in the Variables list.

Exercise 1: Calculations with groups

Assignment

Calculate the maximum and minimum values of all test data sets sintest1 through sintest5. To
do this, group all of these data sets together.

Procedure

Load the datasets Sintest*

· Select the waveforms to be joined together in the Variables list.


· The item Group is available either via the context menu called by right-clicking the mouse, or
in the menu Variable > Edit >Group.
· Give this group the name Test.

Enter the following sequence:

Maxvalues = Max( Test)


MinValues = Min( Test)
Min() and Max() in group 8 Statistics

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Groups as variables 31

· Execute the sequence.

Result

· You obtain a group in the Variables list containing the selected variables.
· The results for the maximum and minimum values are also to be joined to a group.

Remarks
Whether the groups are displayed by default as open or closed can be set in the settings for the
Variables list under Extra> Options.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
32 Working with text variables

Exercise 2: Grouping auxiliary variables

Assignment

· Load the sequence "Sine_Box_input.seq" from the USB flash drive and convert all auxiliary
variables to group variables.

Procedure
· Load the sequence "Sinus_Box_input.seq" from the USB flash drive ("\imc FAMOS\training
courses material\FAMOS 2\Exercise_2_5.1")
· Save it under "Sinus_Box_input_Group

· In front of each auxiliary variable, prefix the group name "SBG:". You can use the function
Replace from the Edit menu. Be careful when replacing "x". Only replace the variable and not
the letter "x", which also appears in xdel(), for example.
· The text should then appear as follows:
; Enter all parameter for the sinus function
SBG:_amplitude = BoxValue?("Enter magnitude",1,0)
SBG:_frequency = BoxValue?("Enter frequency",1,0)
SBG:_phase = BoxValue?("Enter phase in factor of PI",0,0)
SBG:_offset = BoxValue?("Enter offset",0,0)
; Create time ramp
SBG:x = Ramp(0,pi2/1000,1000)
; Set sample rate
SBG:x = Xdel(SBG:x,0.001)
;Create sinus signal
sinus = SBG:_amplitude*Sin(SBG:_frequency*SBG:x + SBG:_phase*pi) +
SBG:_offset
SetUnit(sinus,"s",0) ;Set unit for x-Axis
SetUnit(sinus,"V",1) ;Set unit for y-Axis
;Show sinus in curve window
show sinus
· At the end of the sequence, the following command line deletes the group of auxiliary
variables:
delete SBG

Run it again.

Result

The use of the group avoids the occurrence of side effects. After the sequence has been
executed, no auxiliary variables remain in the Variables list, except Sine, as intended.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Groups as variables 33

Remarks
· The initial letters are used as the group designation, which should be as distinctive as possible
so that when multiple sequences are used, no groups become changed or deleted in other
sequences.
· This effort may not pay off except in rare cases. However, it may be worthwhile to query at
the beginning of a sub-sequence whether there is already a variable having the group name
which is used for the auxiliary variables. The following command lines prevent the sequence
from being run in such a circumstance, thus avoiding undesired side effects in many cases:
If (VarExist?("SBG"))
BoxMessage("Attention!", "Variable SBG does already exist!", "!1")
exitsequence 1
End
· The two examples illustrate how to create group variables either manually or with the colon.
In addition, there are more Gr* functions in Variables > Datatypes > Groups, for finding the
count, name, or index of group elements.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
34 Working with text variables

5.4 Exercise: Naming data sets automatically


Assignment

· Pass a data set to a sequence as a parameter. This sequence determines its histogram and
saves the result under a generated variable name.
· Afterwards, the result is displayed and saved with an auto-assigned designation.

Procedure
Step 1:
Enter the following sequence:
LOAD PA1 dataset
Name = FsSplitPath("PA1",2)
Name = Name + " Histogram"

{<Name>} = Histo(dataset,0,0)
SHOW {<Name>}
[FsSplitPath-function under System > Filesystem > Filename]

Save it under the name ShowHisto.seq:

Now enter this command line in the Input box and run it with either F9 or using .

SEQU ShowHisto sintest1

Schritt 2:
Append this command line to the end of the sequence and save it again:
SAVE {<Name>} PA2

The command line in the Input box is to be changed as follows:


SEQU ShowHisto sintest* erg_hist##

Run this line again using either F9 or .

Result

· The sequence returns a histogram, displays it and in the last step saves it.
· Depending on the waveform analyzed, the designation of the histogram generated changes.
· The second parameter determines under what name the result is saved.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Naming data sets automatically 35

Remarks
· The function FsSplitPath splits up the filename transferred and returns its folder or just the
file ending.
· Text and text variables can be appended using the “+” symbol in the order in which the
addition is made.
· Variable in wavy brackets {…} make it possible in imc FAMOSto use digits at the beginning of
variable names and special characters (here an empty space) inside a variable’s name.
· The command line in step 4 transfers as the first parameter the files based on which the
histograms are to be calculated. The asterisk serves as a wildcard – in the exercise, all files are
loaded which start with "sintest". The second parameter transfers to the sequence the
designation under which the calculated results are saved, as a two-digit serial number. For
details on the use of the # symbol in calling sequences, see the imc FAMOS help under
imc FAMOS > Sequences > Sequences with parameters > Incrementing numbers.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
36 Targeted detection/isolation of events

6 Targeted detection/isolation of events


After a measurement, it is often desired to limit your focus of the measured data to regions which meet
certain constraints.
For this purpose, imc FAMOSoffers various capabilities with the help of which events can be targeted for
isolation. The following exercises present the most important among these possibilities.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Comparison operators 37

6.1 Exercise: Comparison operators


Assignment

The pause time of a bus trip is to be determined based on velocity data. Further, the engine
load in % is to be determined at a torque > 50%.

Procedure
Create a new project.

Load the file BusTrip.dat from the USB flash drive (imc FAMOS\dat\). It contains three data sets:
speed in kmh, Torque in % and Power_Engine in %

· Write the following command lines in the Input box and run them:

Stop_level = 0.5 'km/h'


Busstop = speed < Stop_level
Busstop_duration= Max(Int(Busstop))
Time_Complete= xdel?(speed)*(leng?(speed)-1)
Busstop_duration_percent= Busstop_duration/Time_Complete * 100'%'

Torque_50= Torque > 50


Power_Torque50= Power_engine* Torque_50

· Display "Busstop" and "speed" in a curve window.


· In a second curve window, display Power_Engine, Torque, Torque_50 and Power_Torque50.
Display the results and if desired, zoom into a certain region.

Save the contents of the Input box as a sequence and save the project.

Result

· Comparison of data sets yields a binary results data set. By means of simple integration, the
duration during which the data return the result "1" can be determined.
· The binary result data set multiplied by another of the experiment's channels sets all values
at which the result is "0" to zero.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
38 Targeted detection/isolation of events

Remarks
· Besides the comparison operators < (less than) and > (greater than) there are also <= (less
than or equal), >= (greater than or equal) and <> (unequal). They can be used on complete
waveforms if they have the same sampling interval and sample count.
· The result of a comparison is always either 0 (false) or 1 (true). Thus, the whole resulting
waveform will consist of a series of zeroes and ones. Such a digital waveform has its own
symbol in the Variables window and is displayed in the curve window together with other
data types in a narrow band without y-axis scaling.
· In order to have the constant value threshold displayed in the curve window, the checkmark
for "Single values" must be set in the More Waveforms… window.
[Configuration > More Waveforms…]

Signal recordings in response to a threshold

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Logical operations 39

6.2 Exercise: Logical operations


Assignment

If a waveform’s value exceeds or falls below a certain threshold, the value of a different
waveform is determined.

Procedure
If it has not already been done, load the file BusTrip.dat from the USB flash drive (imc
FAMOS\dat\).

Write and run the following sequence:


v_rsamp= RSamp(speed, Torque)
v_Analysis= v_rsamp *((Torque > 40) AND (Power_engine > 50))

· Open a curve window with Torque, Power_engine, v_rsamp and v_Analysis.


· For these waveforms, the y-axes should appear stacked on top of each other again

Save the sequence and the project.

Result

As soon as a signal falls above or below a threshold, a different signal’s value is recorded. In the
process, the time axis remains intact.

Remarks
· You can perform logic operations on combinations of two or more waveforms. For this
purpose, imc FAMOS comes with the logical operators AND, OR, NOT and XOR.
· If the waveforms do not have the same length, the operations are only performed up to the
end of the shorted one.
· Using the RSamp function, the waveform speed is sampled at the sampling times of the
waveform torque and clipped to the same length.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
40 Targeted detection/isolation of events

Recording of a signal in response to two thresholds

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Determining slopes and isolating values 41

6.3 Exercise: Determining slopes and isolating values


Assignment

· The bus velocity is to be assessed on the basis of acceleration (>0.8 m/s²) within a particular
value range (30-40 km/h).
· A data set's values are to be recorded at the points in time found.
· The subsequent recording of data should not include a time axis.

Procedure
Load the data sets belonging to the file BusTrip.dat from the USB flash drive (imc FAMOS\dat\).

Run this command line:


v_m_s= speed/3.6 ; speed in m/s
level = SearchLevel(v_m_s, 3, 30/3.6, 40/3.6, 2, 0.8, 0, 0)
[SearchLevel function in group Anaylsis > Seek]

· Open the waveforms v_m_s and level in a curve window with one y-axis.
· Change the display style for level to "Only symbols" and "Dots (large)"

Now complete this line:


Torque_level = Value(Torque, Level.X)

In a second curve window, have the new waveform Torque_level displayed twice, to get the
value (line style: only symbols) along with the waveform (line style: spikes).

Save your project.

Result

· If a signal crosses a threshold and has a particular slope, a different signal is recorded.
· The result is not a continuous signal, but consists of points to be observed in isolation.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
42 Targeted detection/isolation of events

The slopes of a signal found with SearchLevel

Isolated values of the waveform “noise”

Remarks
· The SearchLevel function only returns those points in a waveform which have both a certain
level and a certain slope.
· The result of the SearchLevel function is an xy-waveform, where the x-axis contains the
positions of the points found and the y-axis their values.
· With the Value-function, the values of the other waveform are imported at the points found
in the first waveform.
· In order to have the waveform Torque_level displayed both as spikes and as dots, you must
display it twice in the curve window, once as dots and once as spikes.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Displaying relative maxima using a loop 43

7 Working with loops


7.1 Exercise: Displaying relative maxima using a loop
Assignment

Create a sequence which divides the waveform slope into four equally long segments. The
maxima of these segments are also determined.

Procedure
Begin the sequence with these command lines:

LOAD slope
l_pos = 0

Next create a counter loop by choosing a FOR-Loop from the Functions > Boilerplates
Now fill in the loop:
FOR ii = 1 TO 4
st_name = "piece" + TForm(ii,"f1.0")
r_pos = l_pos + 0.001
<st_name> = Cut(slope, l_pos, r_pos)
l_pos = r_pos
SHOW <st_name>

max_name = "max_" + st_name


<max_name> = Max(<st_name>)
SHOW <max_name>

END

Save this sequence as MaxLoop.seq.

Run the sequence.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
44 Working with loops

Result

Four curve windows open with the 1 ms long sections of the waveform slope. Also, the four
relative maxima are outputted.

The four generated portions of the waveform “slope”

The four maxima of the waveform “slope”

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Displaying relative maxima using a loop 45

Remarks
· For better clarity, it is good to indent the loop portion. imc FAMOS can accomplish this for
you, if you select the item in the context menu (called by right-clicking the mouse over the
Input box) called Format automatically.
· The WHILE-loop runs through four times until the break condition becomes valid and the loop
is exited. The counter index ii is used to count the variables.
· imc FAMOS does not check whether the break condition even can be met. For this reason,
there is a possibility of accidently programming an endless loop which must be aborted by
means of the ESC key.
· You can create your own program building blocks (boilerplate) or edit existing material. To do
this, open the file FamosBps.txt in the subfolder /BIN of the imc FAMOS installation folder.
That is also where the syntax for boilerplate is explained.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
46 Working with loops

7.2 Exercise: Importing a complete data folder


Assignment

Create a sequence which opens all of a folder’s waveforms as variables in imc FAMOS.

Procedure
Enter this sequence
; Set open dialog to example files. Adjust if necessary.
dir = FsDlgSelectDirectory("folder","C:\imc\imc FAMOS\dat",0)

IF TLeng(dir) > 0
FileListID = FsFileListNew(dir, "*.dat", 0, 1, 1)
n_file = FsFileListGetCount(FileListID)
i_file = 1
WHILE i_file <= n_file
file = FsFileListGetName(FileListID, i_file)
subdir = FsSplitPath(file, 6)
filename = FsSplitPath(file, 2)
file = "~034" + file + "~034"
subdir = "Group" + subdir
IF VarExist?(subdir) = 0
{<subdir>} = GrNew()
END
LOAD <file> {<filename>}

GrChanAppend({<subdir>}, {<filename>})
i_file = i_file +1
DELETE {<filename>}
END
FsFileListClose(FileListID)
END

DEL dir
DEL filelistid
DEL n_files
DEL i_file
DEL file
DEL subdir
DEL filename

Run the sequence and in the folder selection dialog select C:\imc\imc FAMOS\Dat\Experim.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Importing a complete data folder 47

Result

All files in the folder and its subfolders are loaded into imc FAMOSas variables. In the process,
the files are saved in groups of variables created by the sequence.

Remarks
· Groups of variables offer the ability to introduce structure to the variables used, since they
can be organized as a group. Besides the commands GrNew and GrChanAppend, you can also
create a new Variables window with the mouse. To do this, highlight the waveforms to be
joined into a group, right-click the mouse and select Group. Afterwards, enter either an
existing or a new group name.
· The FsFileList contains a file list in which filenames and folder names are collected. The list is
addressed by its ID and its entries by their serial number. In order to open the individual list
contents, in other words, the files, the counter loop runs through the number of times
corresponding to the count of entries.
· The filter belonging to the FsFileListNew function (here: *.dat) determines which files are
included in the FsFileList. You should only specify a filter for all files (*.*) if you are sure that
there are no other files in the folders through which you search, besides files to be opened.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
48 Loading files

8 Loading files
8.1 The command FileLoad and FileSave
As of imc FAMOS 6.3, the commands FileLoad() and FileSave() are available, which replace the
commands Load and Save, respectively, offering more options. The Load/Save command, however, is
retained for compatibility purposes.
Along with normal loading and saving of a imc FAMOS file, the command also allows direct
loading/saving of 3rd-party formats. As well, a complete text file can be written in a text variable.

Normal loading and saving in imc FAMOSformat


FileLoad("slope","", 0) ; corresponds to the Load-command

FileSave("c:\imc\Dat\NewFile", "", 0, sintest1, sintest2, sintest2)

Quick loading in imc FAMOSformat


For loading large data volumes, it is possible to apply the option "Quick". This displays the data
as a link to the file. However, as soon as the data set is edited, the data are moved entirely to
the working memory. When the data sets are very large, this can result in delayed response by
imc FAMOS.
FileLoad ("slope","imc/Famos|Quick", 0)

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
The command FileLoad and FileSave 49

Load with measurement assignment


If you want to load imc FAMOS data with measurement assignment, you need to add an import-
filter with FAMOS-format as base.

Afterwards data can be used by using this filter.


FileLoad ("c:\imc\imc
FAMOS\dat\EXPERIM\0001\*.dat","$FAMOS_Measurement", 0)

Loading/Saving a text file


FileLoad ("mycomment.txt","imc/Text", 0) ; loading a text file
As the variable’s name, the filename is used. Note that it only works if the import filter "Text
file" is activated:

FileSave("z:\tmp\comment.txt", "imc/Text", 0, Comm?(MyChannel1)); Save


to text file

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
50 Loading files

Loading/Saving a file in Matlab format


FileLoad("1.mat","#MatLabImportExport", 0)

FileSave("z:\tmp\export.mat", "#MatlabImportExport|Matlab 4 Format", 0,


MyChannel)

Loading an ASCII-file, specifying the import filter


This is for loading an ASCII file for which a filter had previously been created using the Import
ASCII Assistant. [FilterName] represents the name under which the filter was saved in the ASCII-
import dialog and is identical with the format name displayed in the "Load file"-Dialog.
FileLoad ("1.txt","#ImportAscii1.dll|FilterName", 0)

Loading a file, specifying the external format


FileLoad ("1.lec","lecroy", 0) ; loads a file of the format "Lecroy"

Loading an EXCEL-file

For loading an EXCEL-file with an existing derivative import filter. This was created before on the
basis of the EXCEL-format. The private settings have been made in such a way that the cells B2
through C300 are read. The import filter has been saved under the name 'EXCEL (B2-C300)'.
FileLoad ("c:\test\result.xls","$EXCEL (B2-C300)", 0)

Saving a group having three variables as an Excel file


FileSave("z:\tmp\c.xls", "[XLS] Sample EXCEL-Export Template", 1,
result)

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Opening a file to read 51

8.2 Exercise: Opening a file to read


Assignment
· Open a file and have its content displayed, and/or search for particular waveforms in the file.
· To do this, use the file SlopeSquare (no space) saved for the exercise "The LOAD command".
· All commands in this exercise are found in the Functions list, group 13, File Functions.

Procedure
Run each line separately.
; Open the file SlopeSquare to read it.
FileID = FileOpenDSF("c:\Training\SlopeSquare",0)
; Have the amount of objects contained in the file indicated.
Amount = FileObjNum?(fileID)

; Have the types of the two objects in the file indicated.


Typ1 = FileObjType?(fileID,1)
Typ2 = FileObjType?(fileID,2)

; Have the names of the two objects in the file indicated.


Name1 = FileObjName?(fileID,1)
Name2 = FileObjName?(fileID,2)

; Import the objects from the file and save each of them as a variable.

Content1 = FileObjRead(fileID,1)
Content2 = FileObjRead(fileID,2)

; Display Content1 and Content2 graphically


Search for particular waveforms, e.g. slope, square and sintest1.
Search1 = FileObjFind(fileID,“slope”,1)
Search2 = FileObjFind(fileID,“square”,1)
Search3 = FileObjFind(fileID,“sintest1”,1)
; Close the open file.
SVStatus = FileClose(fileID)

Result
· A file was opened whose contents were read out and searched for particular waveforms.
· The waveforms imported from the file, as well as the results of the queries, are adopted in
the Variables list.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
52 Loading files

Graphical displays of the file SlopeSquare

Variables list

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Opening a file to read 53

Remarks
· With the command FileOpenDSF(), a 0 located at the position after the filename or pathname
means that this file was only opened for reading. A 1 or 2 signifies that the file was opened for
writing.
· With the commands FileObjType?(), FileObjName?() and FileObjRead(), the first argument in
the parentheses is the file identifier, which you obtain by calling FileOpenDSF(). The second
argument is the number of the object in the file. The return value of FileObjType?() signifies:
§ 0 = group
§ 1 = waveform
§ 2 = text
· The first argument for the command FileObjFind() is also the file identifier, the second is the
object for which to search, and the third is the number of the object at which to begin the
search. Since the file used does not contain any waveform sintest1, a 0 is returned as the
object number.
· FileOpenDSF() opens a measurement value file in the imc FAMOSformat. In order to open a
measurement value file in a user-defined format, use the command FileOpenFAS(), which
also belongs to group 13.
· All files which were opened with FileOpenDSF() or FileOpenFAS() must be closed again with
FileClose() or FileResetAll().
· imc FAMOS can administer a maximum of ten open files at once. By forgetting to call
FileClose(), this number can be quickly reached, leading to error messages being posted.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
54 Loading files

8.3 Exercise: Opening a file for writing using the File* commands
Assignment

· Open a file, supplement it with a new waveform and then delete it again.

Procedure
Step 1:
Load the waveform sintest1 in the Variables list, as demonstrated in the previous exercise.
sintest1ID = FileOpenDSF( "sintest1",0)
sintest1 = FileObjRead(sintest1ID,1)

Open the file SlopeSquare, from the previous exercise, for writing.
FileID=FileOpenDSF("c:\Training\SlopeSquare",2)

See how many objects are present in the file.


Amount = FileObjNum?(FileID)

The variable Amount has the value 2, because there are two variables in this file.

Step 2:
Write the waveform sintest1 into your file SlopeSquare.
SVStatusWrite = FileObjWrite(FileID,sintest1)

Re-check the amount of objects in your file.


Amount2 = FileObjNum?(FileID)

After writing sintest1 to the file SlopeSquare, the variable Amount2 is 3.

Step 3:
Find out which objects are present in your file.
Name1 = FileObjName?(FileID,1)
Name2 = FileObjName?(FileID,2)
Name3 = FileObjName?(FileID,3)

Save the contents of the file in variables and display them graphically
Content1 = FileObjRead(FileID,1)
Content2 = FileObjRead(FileID,2)
Content3 = FileObjRead(FileID,3)

The names are slope, square and sintest1. The date is loaded to the corresponding variables
Content1, Content2 und Content3.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Opening a file for writing using the File* commands 55

Step 4:
Delete the waveform sintest1 from the file.
SVStatusDelete = FileObjDel(FileID,3)

Check the number of objects in the file again.


Amount3 = FileObjNum?(FileID)

After deleting the amount is 2 again.

Schritt 5:
Close the two files.
SVStatus1 = FileClose(FileID)
SVStatus2 = FileClose(sintestID)

Result

A waveform was added to an existing file and later deleted again

Remarks
· The command FileOpenDSF() opens a file of measured values. If no complete filepath is
specified, the system searches through the current loading folder.
§ 0 following the filename means read,
§ a 1 or 2 means write.
· For a 1, a new file for writing is created. If the file concerned already exists, it is
overwritten.
· For a 2, a file is opened for writing. If the file concerned already exists, its contents
remain intact and the new data objects are appended.
· The command FileObjDel() requires the opened file’s identifier and the number of the object
to be deleted.
· Don’t forget to close all opened files again with FileClose() or FileResetAll(). FileResetAll()
closes all previously opened files, without saving any changed files. Commands such as
FileObjWrite() would have no effect.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
56 Specific Examples

9 Specific Examples
The following sequences can be used as template sequences for your own projects.
Using the sequence Selection, you select multiple imc FAMOSfiles; files with multiple channels are also
allowed. This sequence in turn calls a sequence Multifile_Calcualtion, in which the calculation is
performed. However, the sequence Report could just as easily be placed here, which serves to output
any waveform on paper.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Multi-file selection 57

9.1 Multi-file selection


; Selection of files, including multi files
ID_List = FsDlgSelectFiles("Select a file!", "C:\", "*.DAT", 0)
n_file = FsFileListGetCount( ID_List)

i_file = 1
while i_file <= n_file ; big loop: files
filename = FsFileListGetName( ID_List, i_file)

ID_file = FileOpenDSF( filename, 0) ; open file


if ID_file > 0
n_channel = FileObjNum?( ID_file)
i_channel = 1
while i_channel <= n_channel ; small loop -> Objects in file
data_name=FileObjName?( ID_file , i_channel)
<data_name>= fileObjRead( ID_file ,i_channel )

sequ Multifile_calculation <data_name>


i_channel = i_channel+1
end
FileClose( ID_file)
end
i_file = i_file + 1
end
FsFileListClose(ID_List)

del ID_*
del i_*
del n_*
del data_name
del filename

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
58 Specific Examples

9.2 Calculation of a dataset


; Sequence to calculate a sine waveform
; using parameter

; PA1 = Normal waveform


; Call sequence: Sequ Multifile_Calculation sintest1

; create groupname "PAx" converts variable into text


Group = "Statistik_" + "PA1"

; Create group <> Converts text into variable


<group>: RMS = rms( PA1)
<group>: Maxi = max( PA1)
<group>: Mini = min( PA1)
<group>: Mean= mean( PA1)
<group>: Spectrum= fft( PA1)

; remove aux variables


Del group

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Fill report automatically 59

9.3 Fill report automatically


For this example, we need a report with a table header (3 columns, 2 rows, title: "table") and a curve
window with the title "Curve1".
; Simple example to create a report
del *
FAMOS
load slope
show slope
CwLoadCCV( slope, "slope.ccv")

; Name of user
name= BoxText?( "Enter your name!", "Name", 0)

; Purpose of exercise
purpose= BoxText?( "What's the purpose of this exercise?", "Training", 0)

; Get time
z= TimetoText( TimeSystem?(), 2)

; Get date
date= TimetoText( TimeSystem?(), 4)

; Open report
RgDocOpen( "Report1.drb", 0)
; Fill table
RgTableSetCell( "table", 2, 1, name, 0)
RgTableSetCell( "table", 2, 2, z, 0)
RgTableSetCell( "table", 2, 3, date, 0)
RgTableSetCell( "table", 2, 4, purpose, 0)

; fill Curvewindow
RgCurveSet( "Curve1", slope, 0)

; RgDocPrint(0)
del name
del z
del date
del purpose

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
60 Specific Examples

9.4 Connect intervals


Example: Connect Intervals.seq
; Sequence to combine interval directories created by imc Devices.
; Combines: Normal waveforms, events (triggered data), segments (spectrum, histogram) and reduced
data (TransRec)
; 1. Choose experiment
; 2. Select first subdirectory
; 3. Select last subdirectory
; Find a multifile called complete_files.dat at your experiment directory
; last change 2005 May 2
; 2005 Juli 29:: Events have been joined together
txExperiment = FsDlgSelectDirectory("Select experiment directory", "C:\", 0)
if TLeng(txExperiment)= 0
exitsequenz
end
txStart = FsDlgSelectDirectory("Select first test directory", txExperiment, 0)
if TLeng(txStart)= 0
exitsequenz
end
txLast = FsDlgSelectDirectory("Select last test directory", txExperiment, 0)
if TLeng(txLast)= 0
exitsequenz
end
txExperimentt = TConv( txExperiment, 2)
txStart = TConv(txStart, 2)
txLast = TConv(txLast, 2)
; Create list with channels and load them out of the first subdirectory
_FileListID = FsFileListNew(txstart, "*.*", 0, 0, 1)
FOR _ii = 1 TO FsFileListGetCount(_FileListID)
_Filename= FsFileListGetName( _FileListID, _ii) ; get filename of channel

_fh = FileOpenDSF( _Filename, 0 ) ; open channel file


TxName = FileObjName?(_fh, 1) ; Get name of channel
<TxName> = FileObjRead( _fh, 1) ; Load data into variable with channelname
if EventNum?(<TxName>) > 0
EventJoin( <TxName>, 0)
end
FileClose(_fh)
END
FsFileListClose(_FileListID )
;Create list of all subdirectories
_DirListID = FsFileListNew(txexperiment, "*", 1, 0, 1)
_ii = 1
_status= 0 ; status variable: 0=looking for first testdir
; 1= load start test dir ; 2 = load last test dir
WHILE _ii <= FsFileListGetCount(_DirListID)
_subDir= FsFileListGetName( _DirListID, _ii)
_Dir = TPart( _subDir, tleng(_subDir)-20, tleng(_subDir))
show _dir
; --------------- Find interval directory and set status ------------------------
if _status= 0
if Tcomp( _subDir, txStart)=0 ; is that the first subdirectory to be loaded?
_status= 1 ; yes, start loading
end
else
if Tcomp( _subDir, txLast)=0 ; is that the last subdirectory loaded?
_status=3 ; yes, default ist no saving
txdatname = DlgFileName(txexperiment,"dat","save result as...",0)
if tleng(txdatname )> 0
_FileCompleteID = FileOpenDSF(txdatname, 1)
_status=2 ; yes, open comlete_Files.dat
end
_ii= 100000 ; ignore following subdirectories.
end
end
; -------------------------------------------------------------------------------
if _status>0
_FileListID = FsFileListNew(_subDir, "*.*", 0, 0, 1)

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Connect intervals 61

_kk = 1 ; join all channels of present subdirectory


WHILE _kk <= FsFileListGetCount(_FileListID)
_Filename= FsFileListGetName( _FileListID, _kk) ; get filename of channel
_fh = FileOpenDSF( _Filename, 0 ) ; open channel file
TxName = FileObjName?(_fh, 1) ; get name of channel
if Tcomp( _subDir, txStart)=0
; First interval directory -------------------------
<TxName> = FileObjRead( _fh, 1) ; load data
if seglen?(<TxName>) > 0 ; Set segment length to 0
SetSeglen( <TxName>, 0)
end
FileClose(_fh) ; close channel file
_kk = _kk + 1 ; next channel
else
; Further interval directories -----------------------------------------
_data= FileObjRead( _fh, 1) ; load data
_Segment= seglen?( _data) ; Segmented data (spectrum,
; histogram)?
if _Segment > 0
SetSegLen( _data, 0)
end
; --------------------------- join/append ------------------------------
if IsXY( _data)=1 ; TransRecDaten ---------------------------
_y = join( <TxName>.y , _data.y) ; yes, join components
_x = join( <TxName>.x ,_data.x)
<TxName>= XYof(_x, _y)
else
if EventNum?( _data)>0 ; triggered data?
_eN= EventNum?(_data)
_eI=1
while _eI <= _eN
eventappend( <TxName> , EventGet(_data,_eI,0), 0)
_eI= _eI+1
end
else
; segments and normal waveforms
<TxName> = join( <TxName> , _data)
end
end
; Last interval. Write resultfile -----------------------------
if _Status= 2
if _Segment> 0 ; Set segments to segmented data
SetSegLen( <TxName>, _Segment)
end
FileObjWrite( _FileCompleteID, <TxName>) ; Write channel to result file
end
FileClose(_fh) ; Close file
_kk = _kk + 1 ; next channel
end
END
FsFileListClose( _FileListID)
end
_ii = _ii + 1 ; next subdirectory
END
if _status= 2
FileClose( _FileCompleteID)
end
FsFileListClose( _FileListID)
FsFileListClose( _DirListID)
del _*
del tx*

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
62 Specific Examples

9.5 Further examples


Example: Pa_over_List.seq
; Example to create parameters using the variable list

number= VarGetInit(1) ; Creates a internal list of all selected variables


current_var = 1

if number> 0 ; Are any variables selected?


while current_var <= number ; Yes, proceed with each selected entry
var= VarGetName?( current_var ) ; Get names (text) of variable

;--- FUNCTION -----------------------------


show <var> ; Function (here show), text must be written in <>
; then imc FAMOS take a text as variable

current_var = current_var +1 ; next entry


end
else
erg= BoxMessage( "Variable list", "Nothing selected!", "!1")
end

del erg ; Remove temporary variables


del number
del current_var
del; Example to create parameters using the variable list

Example: XY_Tip_over.seq
;*****************************************************
; Sequence to invert a waveform
;
; Call: sequ XY_tip_over InputVariable ResultVariable
;
; Parameter:
; PA1: Input normal waveform
; PA2: Output inversion result
;*****************************************************

; Create ramp, with sampling rate of original waveform


x= ramp( 0, xdel?( PA1), leng?( PA1))

YUnit x "s" ; Set unit

PA2= Xyof( PA1, x) ; Create result


del x ; Remove temp variable

Example: AsciiExport.seq
Filtrat = FiltTP(PA1, 0, 0, 6, 100)
fh = FileOpenAscii2("c:\tmp\erg.txt", "Example ASCII export template", 1)
if ( fh > 0)
err = FileObjWrite( fh, PA1)
err = FileObjWrite( fh, Filtrat)
err = FileClose(fh)
end
TxFileName = "c:\tmp\Zufall.txt"

fh = FileOpenAscii2(TxFileName, "Example ASCII export template", 1)


if ( fh > 0)
nNumber = VarGetInit(1)

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Further examples 63

for current_var = 1 TO nNumber


TxVarName = VarGetName?( current_var)
err = FileObjWrite( fh, <TxVarName>)
end
err = FileClose(fh)
END
fh = FileOpenAscii(TxFileName, 2) ; Option 2: Append
if ( fh > 0)
err = FileLineWrite(fh, "User: Hans Meier", 0)
err = FileClose(fh)
END

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
64 Import Export

10 Import Export
10.1 The ASCII/Excel-import Assistant

Assignment

Open the ASCII file "Sample_ASCII_Import.txt" from the USB flash drive (imc FAMOS\dat\).

Procedure

· Load the file with the file type to "ASCII Import..."

· The Editor shows the file’s contents and highlights the name, unit and data in color.
· Begin by setting the time track.
· Go to the second page, "Name". First enter the name, then the unit.
· Test the settings by clicking on OK. Once you re-load the data, imc FAMOSshows you the
settings which had just been made.

Save the settings on the page "Import filter". The next time you load, this format will be
available for selection directly.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
The ASCII/Excel-import Assistant 65

Remarks
· To load an Excel file, Excel has to be installed as well.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
66 Import Export

10.2 Export via ASCII or Excel


To create an export template, select from the imc FAMOSoptions dialog File – Save/Export.

Improved export to the ASCII format


The concrete format is defined by means of a so-called export template which can be created using a
dialog. This dialog would contain controls for the file and column headers, for displaying and
formatting scaling columns, column separators, etc. The templates produced are then available as
export formats in the "Save file"-dialog. Selected variables can be exported in the easiest way as a
multi-column ASCII file.
A detailed description is provided in the Online help (F1), in chapter imc FAMOSUser’s Manual > File
Management > Saving files > ASCII-Format (export template) > Define ASCII-export templates

Linkage to Microsoft EXCEL (XLS-Format)


If EXCEL is installed, XLS-files can be directly imported and exported. Saving is performed in the same
way as for ASCII export, namely template-driven, while import is configured by dialog. Thus, for
example, a complete Excel table in XLS format can be opened in auf imc FAMOSin one go, or even the
variables currently selected in imc FAMOScan be saved together with an XLS-file directly. The
procedure is the same as for creating an ASCII file.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Import-filters 67

10.3 Import-filters
The dialog is called by means of the menu item "Extra"/"Options", on the page "File-Load/Import".
This dialog provides an overview of all import filters currently available on the computer. Here, you can
control the visibility and order of the filters in the associated selection lists (e.g. in the dialog "Load File",
or in the Data Source Browser), set filter options and define new, derivative import filters.
The priority of import filters set here is also applied to finding the the right import filter for the files
selected when the format is set as "automatic".

The list contains all import formats supported by FAMOS. These comprise:
· the import formats permanently integrated into imc FAMOS (FAMOS, EXCEL...),
· import filters created with the File Assistant (menu item "Extra"/"File Assistant", file extension
*.fas). E.g. (LeCroy, Diadem..,),
· import filters made available through special extension libraries (*.dll) (Matlab, ATFX...),
· derivative import filters (see below)
Installation already comes with a large amount of import filters. An overview is provided in the manual
Import- /Export Filters, which is part of the imc FAMOS Help (F1).

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
68 Import Export

10.4 Import with the File-Assistant

The File Assistant serves the purpose of importing any arbitrary data formats. It is started via the menu
item ExtraÞFile Assistant. How to create an import filter is described in chapter File Assistant of the
imc FAMOSmanual. There is a whole separate training program on this topic. If you only need file formats
for which imc has already made filters, request them from either the imc or Customer Support.
Import/Export with DLLs
In contrast to the File Assistant, the DLL interface makes import AND export of extraneous formats
possible. The description of the interface is oriented towards those having programming skills and is
available from imc/Additive upon request.

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Index 69

Project-Explorer 6
Index
Projects
Create 6
A
Addressing 28 R
ASCII 48, 66 Report Generator 11
Assistant 64
Import 64 S
Autostart 20 Save 48
Sequence
C Autostart 20
Comparison operators 37 Parameter transfer 23
Session 8
D Smoothing 11
Data
load 48 T
Load file 51 Text variables 28
save 48
Write file 54

E
Events 36
EXCEL 66
Export template 66

F
Favorites 26
Folder 6

G
Groups 30

I
Import
ASCII 64
Assistant 64
Intervall
connect 60

L
Load 48
Logical operators 39

O
Options 66

P
Parameter transfer 23, 26
Project 6
Close 8
Load 8
Properties 7, 16
Save 8

© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15

You might also like