Topic
Copy signals to data matrix
Page d'accueil ' Communauté ' Automation et VBA ' Copier les signaux dans la matrice de données
- Ce sujet contient 7 réponses, 2 participants et a été mis à jour pour la dernière fois par Norbert Bakkers, le il y a 19 années et 4 mois.
-
AuteurMessages
-
06.01.2006 à 19:54 #34997Norbert BakkersParticipant
I need to perform some matrix manipulations on the data of 4 signals. To do this I need to copy the contents of the signals in a matrix.
The signal (‘1’) has the following form:
[i]Signal with 24,000 64-bit floating points[/i]The matrix (‘DataMatrix’) has the folowing form:
[i]Data matrix with 4 data series with 24,000 64-bit floating point values each[/i]I copy the data using:
[i] ActiveDatabase.RootFolder.Object(“DataMatrix”).FillColumns “‘1′”, fpDataComponentY, , , 1, 1[/i]This produces the error: [quote]A change of values is not possible. The following error has occured: wrong data type. The process has been canceled[/quote]
If try to copy the number 1 to the matrix using [i]FillColumns “1”[/i] then there is no problem.How should I copy the signals to the data matrix?
06.01.2006 à 19:54 #35004Norbert BakkersParticipantI need to perform some matrix manipulations on the data of 4 signals. To do this I need to copy the contents of the signals in a matrix.
The signal (‘1’) has the following form:
[i]Signal with 24,000 64-bit floating points[/i]The matrix (‘DataMatrix’) has the folowing form:
[i]Data matrix with 4 data series with 24,000 64-bit floating point values each[/i]I copy the data using:
[i] ActiveDatabase.RootFolder.Object(“DataMatrix”).FillColumns “‘1′”, fpDataComponentY, , , 1, 1[/i]This produces the error: [quote]A change of values is not possible. The following error has occured: wrong data type. The process has been canceled[/quote]
If try to copy the number 1 to the matrix using [i]FillColumns “1”[/i] then there is no problem.How should I copy the signals to the data matrix?
06.01.2006 à 20:34 #34998Bernhard KantzParticipantUnfortunately we can’t reproduce your problem. Your code works with the latest version of FlexPro.
Please download the latest version and try it again.06.01.2006 à 22:36 #34999Norbert BakkersParticipantI’ve downloaded and installed the 30 day evaluation version.
I removed version 6 from my pc first. Is it possible to have both versions installed at the same time?
After opening my project in version 7, I got the message as indicated in the attached picture. Does this problem only occur in the evaluation version, or would I also have this problem in the professional version?
After this error message, Flexpro crashed with an exeption access violation.Is an alternative method available in version 6 to load the signals in the matrix?
[b][/b][b][/b][b][/b][img]uid14_flexpro warning.jpg[/img][b][/b][u][/u][i][/i]
06.01.2006 à 23:30 #35000Bernhard KantzParticipantYou can install both FlexPro6 and FlexPro7 at the same time.
But you can only open FlexPro Demo Databases with the demo version which are not older than 30 days. This is a limitation of the demo version. With FlexPro 7 Standard or Professional you can open FlexPro6 databases.Your code also works with FlexPro 6.0.35.
Is an alternative method available in version 6 to load the signals in the matrix?
You could create a FPScript formula to calculate the new matrix:
[CODE]
Dim d
d = DataMatrix
d[0] = ‘1’
return d
[/CODE]09.01.2006 à 20:21 #35001Norbert BakkersParticipantI have created a small Flexpro file that includes a VBA programme to fill a data matrix using the ‘FillColumn’ statement. I have used in version 6.0.35 and version 7 and also using version 6.0.33 on a different machine. All versions crashed the same way as described previously. (computer is Compaq Evo P4 2.4 GHz and XP Professional SP2)
The file also includes a formula that tries to fill the matrix using a FPScript. I have tried to fill ‘DataMatrix’ (Signal series with 4 signals) and ‘DataMatrix2’ (Data matrix with 4 data series). They both crash (in version 6.0.35 and 7) with the message ‘Signals cannot be used on the right side of an indexed assignment. Assign the components seperately.’
I solve this by recording a macro whilest filling the matrix by hand. However, this option would be too slow to implement in the programme.
Please advise how to solve this problem!!09.01.2006 à 21:09 #35002Bernhard KantzParticipantIf you want to copy the values of a signal into a signal series you have to copy the components of the signal seperately.
Copy the y-values of the signal into the first column of the signal series:
[CODE]
Dim oDataset As DataSet
Set oDataset = ActiveDatabase.RootFolder.Object(“DataMatrix”, fpObjectTypeDataSet)
oDataset.FillColumns “‘1’.y”, fpDataComponentY, , , 1, 1
oDataset.FillColumns “‘1’.x”, fpDataComponentX, , , 1, 1
[/CODE]
The equivalent FPScript formula is:
[CODE]
Dim d
d = DataMatrix
d.y[0] = ‘1’.y //Copy y-values
d.x = ‘1’.x //Copy x-values
return d
[/CODE]09.01.2006 à 21:29 #35003Norbert BakkersParticipantThank you very much! It works perfect now.
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.