-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Axis problems
Home > Community > Automation and VBA > Axis problems
- This topic has 5 replies, 2 voices, and was last updated 17 years, 1 month ago by Gordon Leonard.
-
AuthorPosts
-
November 7, 2007 at 3:11 am #12399Gordon LeonardParticipant
Here we go, whilst using the 30 day trial, i don’t have long to find out what FlexPro is like etc and I do like forums so will be on here a lot, probably with lots of repeated questions. The only way i have found to search the forum is to go via google which often pops up with results linking back here.
I have created a flexpro object within VB, then created a dataset and populated it with values. I will mainly be plotting column x against y, so have set up a “.DataStructure = fpDataStructureDataMatrix” with 2 columns and pass it a VB array like DataArry(1,100): .Value(fpDataComponentAll) = DataArray. Is this the best way to do it?
I have then plotted the dataset on a ‘diagram2d’ which is where my first issue comes up. If the first element in the array (at (0,0)) is (130,-99) for instance, the axis starts at 0,0 (or atleast the ticks say (0,0)) where i would have expected them to show that the first point is at (130,-99). I hope i have explained myself. I am obviously missing something but have not worked out what?
Thanks in advance
Gordon
November 7, 2007 at 3:11 am #8082Gordon LeonardParticipantHere we go, whilst using the 30 day trial, i don’t have long to find out what FlexPro is like etc and I do like forums so will be on here a lot, probably with lots of repeated questions. The only way i have found to search the forum is to go via google which often pops up with results linking back here.
I have created a flexpro object within VB, then created a dataset and populated it with values. I will mainly be plotting column x against y, so have set up a “.DataStructure = fpDataStructureDataMatrix” with 2 columns and pass it a VB array like DataArry(1,100): .Value(fpDataComponentAll) = DataArray. Is this the best way to do it?
I have then plotted the dataset on a ‘diagram2d’ which is where my first issue comes up. If the first element in the array (at (0,0)) is (130,-99) for instance, the axis starts at 0,0 (or atleast the ticks say (0,0)) where i would have expected them to show that the first point is at (130,-99). I hope i have explained myself. I am obviously missing something but have not worked out what?
Thanks in advance
Gordon
November 7, 2007 at 6:31 pm #8630Bernhard KantzParticipantPlease use the data structure ‘Signal’ instead of ‘data matrix’.
... .DataStructure = fpDataStructureSignal ...
A signal has a Y-component and a X-component, each with a data set of the same length.
If you create a 2D-diagram for a signal, it’s not necessary to enter the dataset for the X-component in the diagram wizard.
But if you want to create a 2D-diagram for a data matrix (first column: Y-component, second column: X-component) you have to enter the X- and the Y-component:
The Y-component is matrix[0] and the X-component is matrix[1].Please see also
FlexPro Help (F1)
Working with Data SetsNovember 7, 2007 at 9:14 pm #8631Gordon LeonardParticipantThanks for the reply.
At the moment a signal, with 2 columns will not plot y against x. (it actually plots something that looks right, but clearly isn’t!)
##code:
datasignal.Value(fpDataComponentAll) = datarr
2dgraph.Curves.Add.Data.dataset= “data1”
##the closest i have got is to create any type of data structure, then use the flexpro gui to choose to plot data1[0] against data1[1], although i dont know how to do this in terms of vb objects (i want to tell the plot i want to use “seperate data sets for x and y comps”):
pseudo code:
2dgraph.Curves.Add.Data.XAxis= “data1[0]”
2dgraph.Curves.Add.Data.YAxis= “data1.Y[1]”
endNovember 7, 2007 at 9:54 pm #8632Bernhard KantzParticipantUse the Composed-property. ‘data1’ is a signal.
Dim oDiagram As Diagram2D Set oDiagram = ActiveDatabase.RootFolder.Add("2D-Diagram", fpObjectType2DDiagram) With oDiagram.Curves.Add.Data .Composed = True .DataSet = "data1.Y" .XDataSet = "data1.X" End With oDiagram.Update
The macro recorder is the most convenient way of creating a macro. Even if you are working with FlexPro Professional and have the Visual Basic Editor available for programming, it makes sense to start with a macro recording and to modify the code later, if necessary.
See also
Automating Task|Creating and Using MacrosNovember 7, 2007 at 10:06 pm #8633Gordon LeonardParticipantyou won’t believe me, but i have just worked that out from the help, i wasn’t sure if it was the best way to do things.
i’ll look in to recording macros using this example so i can work out what is going on.
Thanks!!!!!!
-
AuthorPosts
- You must be logged in to reply to this topic.