FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro-Support
Wissen
Community
Über Uns
Referenzen
Jobs
Allgemeiner Kontakt
Händlerverzeichnis
FlexPro-Support
DE
EN
FR
Placeholder
Produkte und Lösungen
Support und Downloads
Unternehmen
Magazin
Kontakt
Sprache
MyWeisang

Account Einstellungen

Topic

how do i return multiple datasets

Startseite ' Community ' FPScript ' how do i return multiple datasets

Anzeigen von 3-Stellen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #33228
    Martin Kneppe
    Teilnehmer

    I am currently using FlexPro Demo.
    The first simple script i wrote is appended below.
    I am trying to get all slopes from two datasets and evaluate the position and the time-shift between the two datasets. As result i get the Position and the time-shift as a list of values.
    How do i return both lists as two new dataset ?

    Dim Array1,Array2,Position,Difference
    Dim i,a,b,c

    Array1=Slopes(‘DSS 1 SI’, 2, 1, 1, EVENT_POSITIVE)
    Array2=Slopes(‘DSS 1 SI’, 2, 1, 1, EVENT_NEGATIVE)

    a=NumberOfRows(Liste1);
    b=NumberOfRows(Liste2);
    if a>b Then
    c=b
    else
    c=a
    End

    Position=0#2#(c+5)
    Difference=0#(c+5)

    FOR i = 0 TO c-1 DO
    Position[i][0]=Array1[i]
    Position[i][1]=Array2[i]
    Difference[i]=Liste2[i]-Liste1[i]
    END
    Return Signal(Position,0.1),Signal(Difference,0.1)]

    #33230
    Martin Kneppe
    Teilnehmer

    I am currently using FlexPro Demo.
    The first simple script i wrote is appended below.
    I am trying to get all slopes from two datasets and evaluate the position and the time-shift between the two datasets. As result i get the Position and the time-shift as a list of values.
    How do i return both lists as two new dataset ?

    Dim Array1,Array2,Position,Difference
    Dim i,a,b,c

    Array1=Slopes(‘DSS 1 SI’, 2, 1, 1, EVENT_POSITIVE)
    Array2=Slopes(‘DSS 1 SI’, 2, 1, 1, EVENT_NEGATIVE)

    a=NumberOfRows(Liste1);
    b=NumberOfRows(Liste2);
    if a>b Then
    c=b
    else
    c=a
    End

    Position=0#2#(c+5)
    Difference=0#(c+5)

    FOR i = 0 TO c-1 DO
    Position[i][0]=Array1[i]
    Position[i][1]=Array2[i]
    Difference[i]=Liste2[i]-Liste1[i]
    END
    Return Signal(Position,0.1),Signal(Difference,0.1)]

    #33229
    Bernhard Kantz
    Teilnehmer

    For each dataset you have to create your own FPScript formula. Create two new formulas and use the [b]List Element Operator[/b] to take an element from a list.

    Example:
    Formula1 with the name “ListFormula”
    return [&ltvalue1&gt1, &ltvalue2&gt2]

    Formula2:
    ListFormula.Value1
    or
    ListFormula.[“Value1”]
    or
    ListFormula.[0]

    Formula3:
    ListFormula.Value2

    support@weisang.com

Anzeigen von 3-Stellen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.