Famos Ii
Famos Ii
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.
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
© 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).
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".
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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
6 Working with the Project Administration
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Projects 7
· 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
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
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).
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
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
· 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
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
· 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."
Step 5:
Add these command lines to your sequence:
· Run it all the way through by entering sequence smoothing in the input box.
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.
© 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()
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
16 Advanced use of the project administration
· 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 )
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.
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
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]
· Show the signals sintest1 and signal together in one curve window.
© 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
© 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
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.
· 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
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.
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
23
For a quick introduction, open the Sequence Editor and write the following:
LOAD PA1
SHOW PA1
When the sequence is run, the file slope is opened and displayed in a curve window.
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
24 Generating artificial signals
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
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
· 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
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.
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
; 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
Assignment
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
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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Groups as variables 31
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
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
· 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]
Now enter this command line in the Input box and run it with either F9 or using .
Schritt 2:
Append this command line to the end of the sequence and save it again:
SAVE {<Name>} PA2
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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Comparison operators 37
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:
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…]
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Logical operations 39
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\).
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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Determining slopes and isolating values 41
· 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\).
· 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)"
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).
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
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
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>
END
© 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.
© 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
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.
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
The command FileLoad and FileSave 49
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
50 Loading files
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)
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Exercise: Opening a file to read 51
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)
; Import the objects from the file and save each of them as a variable.
Content1 = FileObjRead(fileID,1)
Content2 = FileObjRead(fileID,2)
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
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)
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)
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)
Schritt 5:
Close the two files.
SVStatus1 = FileClose(FileID)
SVStatus2 = FileClose(sintestID)
Result
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
i_file = 1
while i_file <= n_file ; big loop: files
filename = FsFileListGetName( ID_List, i_file)
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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Fill report automatically 59
; 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
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Connect intervals 61
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
62 Specific Examples
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
;*****************************************************
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"
© 2017 imc Meßsysteme GmbH, imc Test & Measurement GmbH imc FAMOS II, 18th Edition - 2017-02-15
Further examples 63
© 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
· 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
© 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
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