isotipo de TecnoEdu
Destacado:
Equipamiento Educativo, Audiovisual... ¡y mucho más!

Funciones no documentadas de la Calculadora de DataStudio

Hay algunas funciones avanzadas de la calculadora del DataStudio que no están documentadas en el manual, ni aparecen en los menúes desplegables de ayuda automática.

Sin embargo, estas funciones son realmente poderosas y permiten transformar una interfase 750 en el corazón de un laboratorio de Control

outputvoltage( A )

  Entrega el valor A (en V) a en la salida analógica de una interfase SW700 o SW750.

Los límites son: +/- 5V @ 200mA con la SW750 y +/- 10V @ 1A si se cuenta con el amplificador de potencia CI 6552A

limit( min, max, x )

  Recorta la salida a los valores min o max si el valor x cae fuera de ellos (funciona como un amplificador saturado)

integral( x )

  La integral del valor x entre el comienzo del muestreo y el tiempo presente

derivative( x )

  La derivada de x respecto al tiempo, en el momento presente

Ejemplo de uso conjunto de todo lo anterior: Control PID

  Definimos los cálculos siguientes:
  • TempDeseada: Cargar cte
  • Temp: entrada de un sensor de temperatura
  • Verror = TempDeseada - Temp
  • CteProp: Cargar cte de ctrol Proporcional
  • CteInt: Idem ctrol Integral
  • CteDer: Idem ctrol Derivativo
  • Vsalida = outputvoltage(limit(0 , 5 ,CteProp * Verror + CteInt * integral(Verror) + CteDer * derivative(Verror))
  • Con la salida se puede controlar un calefactor (p. ej. una lamparita de algunos de nuestros kits de electricidad)

Ejemplo de uso conjunto de todo lo anterior: Control on/off

  Definimos los cálculos siguientes:
  • TempDeseada: Cargar cte
  • Temp: entrada de un sensor de temperatura
  • Vsalida = outputvoltage(limit(0, 2.5 , 2.5*(Temp < TempDeseada))
  • Con la salida se puede controlar un calefactor (p. ej. una lamparita de algunos de nuestros kits de electricidad)

outputstate( adapter #, adapter port, state )

  Sets the state of a digital output channel on a connected PASPORT Digital Adapter.

When configuring the Digital Adapter, the Relay Control option must be selected.

adapter # = the number of the connected digital adapter (1 for the first, 2 for the second, etc...)
adapter port = the number of the port on the adapter (i.e 1 or 2)
state = a variable or sub-expression If the state is a non-zero value, then the relay connected to the digital adapter port will be energized ("on").

If the value of state is exactly zero, then the relay is not energized ("off").

timeof( x )

  Tiempo transcurrido (en segundos) desde que se comenzó a medir x

Ejemplo: Generador de funciones arbitrarias

  voutcontrol = outputvoltage(limit(-5 , 5 , 5*sin(timeof(CualquierMedición))))

Aquí usamos CualquierMedición simplemente para "robarle" los pulsos de clock

peakamp( timeWindowInSeconds, x )

  Looks at the input data (x) over timeWindowInSeconds and reports a single value representing half the distance between the minimum and maximum value. This is useful for reducing fast-sampled data of a harmonic phenomenon to a small number of points representing the "average amplitude". With this function, a reasonable level calculation can be manufactured for a sensor sampling at only 200 Hz.

inrange( minimumValue, maximumValue, x )

  Compares the input value (x) with the specified range and returns the value 1 for values in the range (inclusive) and 0 for values outside of the range. This is a quasi-boolean operator.

mod( numerator, denominator )

  Returns the remainder (a floating-point number) when the numerator is divided by the denominator an integer number of times. The numerator and denominator can each be a constant or an input variable.

chgfilter( changeAmount, x )

  Filters input values for x, reporting only those values which represent a change of at least "changeAmount" from the prior value. If changeAmount is 0, then any change (no matter how small) is reported. This filters out a large number of identical (or nearly identical) data values.

timefilter( timeOffset, x )

  Filters input values for x, subtracting "timeOffset" from the time of each point. Useful for time-shifting data on the X axis, especially when the event of interest does not occur at time zero. The Y values are unchanged.

first( x )

  Returns the first input value for x, for each other input value. Useful for subtracting in initial value of a measurement from each later value (e.g. "x - first(x)").

avgfilter( N, x )

  Smooths data by averaging N values to produce 1. Has the effect of reducing the number of data points by a factor of N.

and( A, B )

  Performs a logical and of the results of the sub-expressions A and B. If the expressions A and B each result in a non-zero number, then and(A,B) = 1.0, otherwise and(A,B) = 0.0.

example: and( x > 1, x < 3 ) will produce a value of 1.0 when the input variable x is between 1 and 3 (exclusive), and 0.0 otherwise.

or( A, B )

  Performs a logical or of the results of the sub-expressions A and B. If either expression A or B result in a non-zero number, then or(A,B) = 1.0, otherwise or(A,B) = 0.0.

example: or( x < 1, x > 3 ) will produce a value of 1.0 when the input variable x is less than 1 or greater than 3, and 0.0 otherwise.

not( A )

  Logical not of the sub-expression A. If A results in a non-zero number, the not(A) = 0.0. If A results in 0.0, then not(A) = 1.0.

A > B

  Greater Than. If the value of A is strictly greater than the value of B, then A > B = 1.0, and 0.0 otherwise.

A < B

  Less Than. If the value of A is strictly less than the value of B, then A < B = 1.0, and 0.0 otherwise.

outputswitch( A )

  Controls the ON/OFF state of the Signal Generator window when using a ScienceWorkshop interface (SW700 or SW750). If the result of the sub-expression A is non-zero, then the Signal Generator is turned ON. Otherwise, the signal generator is turned off. The waveform, amplitude or voltage settings of the Signal Generator are unaffected by this command.

Volver a la página principal del Data Studio

  Ir