-
FlexPro
- Auf einen Blick
- Features & Optionen
- Einsatzgebiete
- Alle Vorteile
- Neu in FlexPro 2021
- FlexPro gratis testen
- FlexPro View OEM Freeware
- Kaufberatung
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produkte
- News
- Support
- Unternehmen
- Jobs
- Kontakt
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
filling X column with formula in VBA
Home > Community > Automation and VBA > filling X column with formula in VBA
- Dieses Thema hat 2 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 20 Jahren, 11 Monaten von michel.aubry@gould-nicolet.fr aktualisiert.
-
AutorBeiträge
-
Dezember 23, 2003 um 8:29 pm Uhr #12443michel.aubry@gould-nicolet.frMitglied
Good morning,
I am using a formula ( see vb code ) to fill the X column of a signal . The “.FillColumns” line in the code generate an error message “invalid procedure call or argument” .
It only works If I replace the Step variable directly by a numerical value but I need to use a variable in the formula.
How can I do ?Dim oSignal As DataSet
Dim Step
Step = 0.1
Set oSignal = ActiveDatabase.RootFolder.Add(“Random”, fpObjectTypeDataSet)With oSignal
.DataStructure = fpDataStructureSignal
.DataType(fpDataComponentX) = fpDataTypeFloat32
.DataType(fpDataComponentY) = fpDataTypeFloat32
.NumberOfRows = NbPoints.FillColumns “(NumberOfValues(i), FloatingPoint32 1,FloatingPoint32 Step )”, fpDataComponentX
.Value(fpDataComponentY) = DataY
End WithBest regards
Dezember 23, 2003 um 8:46 pm Uhr #8738Bernhard KantzTeilnehmerThe first argument of the FillColumns method is a FPScript formula which will be evaluated to produce a data series or data matrix to be assigned to the component specified as the second argument. The variable i is predefined and holds a data series of index values 0, 1, 2, 3 and so on.
In your code you are using a second variable Step which is decraded on the VBA level but not for the FPScript function. To solve your problem you may either exchange Step by the literal constant 0.1 or add the following code to the FPScript formula:
Dim Step
Step = 0.1
(NumberOfValues(i), FloatingPoint32 1,FloatingPoint32 Step )
Hint: If you switch on macro recording and the use the command “Fill column with values” you will see that FlexPro uses an FPScript with delarations as given above.
Dezember 23, 2003 um 8:46 pm Uhr #8124michel.aubry@gould-nicolet.frMitgliedGood morning,
I am using a formula ( see vb code ) to fill the X column of a signal . The “.FillColumns” line in the code generate an error message “invalid procedure call or argument” .
It only works If I replace the Step variable directly by a numerical value but I need to use a variable in the formula.
How can I do ?Dim oSignal As DataSet
Dim Step
Step = 0.1
Set oSignal = ActiveDatabase.RootFolder.Add(“Random”, fpObjectTypeDataSet)With oSignal
.DataStructure = fpDataStructureSignal
.DataType(fpDataComponentX) = fpDataTypeFloat32
.DataType(fpDataComponentY) = fpDataTypeFloat32
.NumberOfRows = NbPoints.FillColumns “(NumberOfValues(i), FloatingPoint32 1,FloatingPoint32 Step )”, fpDataComponentX
.Value(fpDataComponentY) = DataY
End WithBest regards
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.