Response to Plotting 1D array
"In general, if the prototype of the method specifies a matrix for a parameter, you must specify a matrix and vector is not an option. Depending on what you're trying to do you could try creating a matrix that has a single row and passing that for the parameter.
- Elton"
My response:
"If you don't know the size of array, and want to use say "malloc," you cannot create a 2-D array using it; however, dynamically creating a 1-D array using "malloc" is no problem. Then, given the 1-D array created by "malloc," how can I apply it to Plot3DSurface?"
Please see the answer posted in the original thread about this issue.
- Elton
Similar Messages
-
How do I plot an array of waveforms?
The computer on which I am building my VI doesn't have access to the internet, so I can't post any of my code (so I'll use as much detail as possible)
I am taking DAQ measurements for four devices that come in as (I believe) an array of dynamic data type. I split the signal and I have each channel outputting its own dynamic data type. After a user-specified time interval, a timed while loop will trigger the DAQ to take a measurement and write the data to a file and plot the data. The file writing was easy, but I am stuck on the plotting aspect.
What I have: Since efficiency won't be an issue (~15 minute average time delay), I have created a shift register of dynamic data type. Each iteration of the while loop, I append the newly acquired data to an array of dynamic data using the BuildArray function. I need to be able to take this and plot it in a graph, but every time I try it tells me that the dimensions of the source and sink don't match. Also, I need to do this for each of the four sets of data (and put them on the same plot).
What can I do to get plottable data from my shift register?
I cannot open .VI files, so I would really appreciate it if I could get responses in pictures of block diagrams or text. Thanks.
Solved!
Go to Solution.Hi nc61,
stay away from DDT (dynamic datatype) and you will be fine. Especially when trying to collect data by building up arrays of DDT (which probably isn't doing what you really want)...
- Use DAQmxRead to get either arrays of data or waveform(s). Use BuildArray for simple data or waveform functions for waveforms to collect data in shift register. Plotting will be easy with those data!
- There's the well-known example finder in LabVIEW's help menu. Try it...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
How to plot mutiple arrays on right and left y axes?
Hi everyone,
I have a (hopefully small?) problem... I have a 2D array with 6 columns of data I need to plot on a graph... I would like array 0 to plot on the left axis and arrays 1-5 to plot using the left axis... I have tried using clusters to group both sets of data wired to a for loop for each axis... But this is not working... Can't seem to find anything online to help with this..
Any suggestions would be greatly appreciated.
Regards,
Jack
Solved!
Go to Solution.Not to worry.... Found this link..
http://digital.ni.com/public.nsf/allkb/049C7E362BE4270A8625756E005CC46F
Thanks for vewing...
Regards,
Jack -
Plotting an array with a large number of data points
Hello All,
I am collecting data every second for 24 Hrs. How do I plot this on a XY plot? I have the data collection setup in a while loop and my initial attempt was to use a shift register and a build array to make the array and that works OK. The problem is I do not know if this is a wise option in terms of memory usage. (I end up making 3 arrays and 3*86400=259200 data points in 3 shift registers).
What is the better way to plot 86400 data points in a XY plot? I am also writing the data to a file every second.
Thanks,
KBAllan,
Thanks for the message. I am attaching with this message a ccpy of my vi where you can see that I am collecting data from 3 counters, writing them to a file and displaying them. Can you comment on this Vi with regard to memory management?
Yes, I would like to see your examples. Thanks once again.
KB
Attachments:
PC21.vi 418 KB -
Best method for plotting data array?
I am reading data from a Delta Motion controller and writing that data to an array in my vb.NET program. The data is not time stamped but I know what the sampling interval is (0.001s). I want to take that data and plot it on my Waveform Graph. What is the best method for doing this? I'm sure this is simple, but I'm new to MS and LV.
Private Sub btnRampUpA_Click(sender As Object, e As EventArgs) Handles btnRampUpA.Click
Dim Axis0ActualPrsData() As Single = New Single(4096) {} 'Create array for data from the RMC controller to be read into
Dim Axis0Actual() As AnalogWaveform(Of Single)
If RMC.IsConnected(PingType.Ping) = True Then 'Check to make sure comms to RMC is good before trying to read data from it
Try
RMC.ReadFFile(FileNumber150.fn150Plot0StaticUA0, 112, Axis0ActualPrsData, 0, 4095) 'read the plot data where sample period = 0.001
Catch ex As ReadWriteFailedException
MessageBox.Show("Unable to read plot data from the RMC. " & ex.Message)
End Try
End If
End Sub
Thank youPlotYAppend appears to be the answer according to the white page, although I don't have it working as of yet. Can someone confirm?
-
Plotting amended arrays of temperature data
Hi, I am trying to compare different thermocouples/temperature measuring devices. I have a little experience with labview but not too much. I wanted to know if I am approaching this problem the right way. My supposedly complete data set of temperature seems incomplete when I plot it in my "difference" and "corrected" plots.
There are right now two sources of analog data. I am trying to compile all the data into an array then find the difference between the two data channels, take a best fit and correct the second data channel so that the two channels of data have almost no offset bewteen them. I am using Labview 8.6. I've attached the vi below.
Thank you for any help or advice you may be able to offer. Also occasionally a error pops up when I tried to troubleshoot with the highlight excecution. It says that the data is no longer available.
Thanks
Attachments:
Thermocouple2.0.vi 108 KBWhat exactly is your question? What isn't working on your VI?
Regarding the error, when Highlight Execution is on, the loop runs so slow that the buffer is read dry before the next loop comes around. You can observe this by putting a DAQmx Read Property Node in your loop, and read the AvailSampPerChan and the TotalSampPerChanAcquired.
You are taking very few samples and waiting a long time for them to come in. At a rate of 10 (S/s) and asking for 50 samples, it takes your loop 5 seconds to complete. Why so few samples? You can take hundereds of samples, even a thousand, then take a Mean of those samples and you would not need filtering.
Richard -
I need a 3 D plot which update continiously with some time delay, in order to observe the movement of the point in 3 D plane as well as the pah it is following. The datas are stored in a txt file in the format shown below.
Data1There should be lots of examples and documents online that will help you get familiar with using the 3D graph in LabVIEW. You could start here or here. You can also search for 3D in the Example Finder (from LabVIEW: Help >> Find Examples) for plenty of examples that will help.
Jarrod S.
National Instruments -
I would like to plot an array of U32 with a digital waveform graph.
When I try to do this I can only view the first 8 bits. How do I plot all 32 bits?
Take a look at the attached VI, where I am able to plot all 32 bits on the graph. I have the axis autoscaling, and I made sure it was large enough to see.
Evan
Attachments:
i32_to_Digital.vi 44 KB -
Plotting 1D array in 3DSurfaceG​raph
Hey, I am just wondering, are there any ways to use 1D Array/Vector as the third parameter in 3DSurfaceGraph or do we have to use a 2D Array/Matrix in 3DSurfaceGraph? Thanks.
Malloc'ing a 1D array vs. a 2D array doesn't matter since the CNiGraph3D methods don't accept arrays anyway - you ultimately have to convert to Measurement Studio vector/matrix types to specify to the methods. Please refer to the previous discussion about converting C array types to Measurement Studio data types to pass to the CNiGraph3D methods.
- Elton -
Create plot with time vs array
Hi I am new in the forum.
I have this problem.
I would representate 7 plots versus tiime.
I calculate time and measure the 7 values in Y-axis and put them in an array.
How I can do to plot the array versus time?
Thank you in advance
RafAttached is an example. Ignore what I said earlier about keeping
data from previous times. IT seems to be a moot point with
charts, which will keep previous data by default! Oh thank
goodness for LabView!
Attachments:
multi-chart.vi 37 KB -
How can I programmatically remove a selection of plots from a waveform graph?
I have a waveform graph to display a number of plots, which I need to programmatically add and delete to as selections of data are chosen by the user for display.
I've looked under the VI Server Property node and cannot see anything suitable for adding extra plots, or removing existing plots. I expected to see a Plot Data array variable, with each element containing the data for each of the plots on the graph. There is such an array for the annotations, which I can easily edit by Removing Subset for Array, or Insert into Array, but nothing for the plot data. The Value property is a Variant, which I'm unsure how to handle. Should I be working with this perhaps? Can this be done by creating a Local Variable read node? Or am I missing something simple here??
Thoric (CLA, CLED, CTD and LabVIEW Champion)Hi Mike,
I was trying to use the Property Node (Value) to read the waveform graph, but I was getting a Variant type back, not a 2D array of DBLs as I expected. Turns out I was passing the graph control reference to a subvi whose control refnum had the Include Type flag unchecked. As a result of this explicit definition, Value was of an uncertain (undefined) type and couldn't be natively provided. It would have had to have been cast into a more specific type to work. Have solved the problem by ensuring all my references are of a strict type, and now (as you recommend) the Property Node (Value) is useful
Many thanks for the response!
And many thanks for the demo too! You put that together remarkably quickly!
Thoric (CLA, CLED, CTD and LabVIEW Champion) -
How do you update an intensity plot one element at a time?
I would like to use an intensity plot (or other control) to plot data collected from A/D channels. How do you get the Intensity plot to update one element at a time vs. row by row? Tips and suggestions greatly appreciated!
> I would like to use an intensity plot (or other control) to plot data
> collected from A/D channels. How do you get the Intensity plot to
> update one element at a time vs. row by row? Tips and suggestions
> greatly appreciated!
>
You will need to use the intensity graph and keep the buffer yourself.
Init the data with background values and start filling then in using
Replace Array subset. Presumably you are in a loop. Recirculate the
data in a shift register adding new data each iteration and plotting the
array to the intensity graph.
Once you get to the horizontal edge, you need to decide if you split the
data to get rid of the first row and append a new background row to the
end making a strip chart, or do you clear the array and start over from
the initial edge again making a scope chart, or do you mod the index
with the buffer size and erase a row at a time in advance making a sweep
chart.
To update the scales, you don't have to change the data. Just write to
the Offset property each time you scroll and it will relabel the data
with 0 mapping to the offset value.
Greg McKaskle -
Scatter Plot Problem!!
Hello everyone,
I am quite new at Labview and I have a question regarding plotting 2d-array in a scatter plot.
I would like to plot my data as a scatter plot, which I have done with the Waveform graph, and now I would like to find out the area with the highest density in the scatter plot
and mark the area with a circle...is it possible in Labview to realize this?? I would be very thankful for every tips!
Thank You
Best Regards
YunYes it is possible. You said you are using a waveform graph, wouldn't an XY graph be a better choice? I don't know the data you are getting so a waveform graph might be the right tool here.
In either case you'll need to define a length of X that you want to find the denses amount of points. So say X=1 so then you will find all the points between 0 and 1 and count them, then 0.1 to 1.1 and count them, then 0.2 to 1.2 for the length of X on your graph. Doing this in a For loop will make it easy, and then your output will be an array of counts for each section. Find the maximum using the Array Max & Min function.
Then you can highlight the graph using property nodes. You can use a cursor, or annotation, or a custom picture. The easiest would probably be an Annotation and in the Example finder there is one called "Graph Annotations" that find the minimum, maximum, and average values for a graph and put an overlay on the graph.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously. -
We have 2 3.42 systems - one on Fedora Core 1 and one on RedHat Enterprise
3 and wish to join as an array. However no matter whether use command line
or array manager and primary or secondary(to be), it starts - prompting
for administrator account, and then fails with no very informative message.
I wonder if because no telnet & using ssh with root as adminitrator
account?
Thanks for any help.Peter Polkinghorne wrote:
Carl wrote:
Peter Polkinghorne wrote:
Carmelo wrote:
Peter Polkinghorne wrote:
We have 2 3.42 systems - one on Fedora Core 1 and one on RedHat
Enterprise
3 and wish to join as an array. However no matter whether use commandline
or array manager and primary or secondary(to be), it starts - prompting
for administrator account, and then fails with no very informativemessage.
I wonder if because no telnet & using ssh with root as adminitrator
account?
Thanks for any help.
Peter,
Try using the following command to help you see why the servers are not
attaching. You can post the output. From the primary.
$ tarantella array join primary FQDN secondary FQDN --verbose
Use FQDN and make sure that each can resolve the other.
Other things to look out for.
* You need to have port 5427 open between the servers
* servers need to be able to resolve each other, use DNS
Your problem does not sound like it has anything to do with telnet or
ssh.
>>>
>>>
Regards,Thanks for the suggestions - I have verified that they can resolve
eachother and have used FQDN. I have also checked not firewalled from
eachother.
What happens is that the array join command prompts for secondary admin
username & password, which it accepts and then completes.
Running tarantella status --verbose initially yields:
Health check:
- primary.ksblaw.co.uk: Accepting peer connections.
- secondary.ksblaw.co.uk: Accepting peer connections.
One or more array members reported that they are not in this array.
If an array join has just been performed, the join is complete when the
servers report they are array members.
then after 5 minutes or so yields:
Health check:
- asterix.ksblaw.co.uk: Accepting peer connections.
- All responsive servers report consistent array topology.
Contacting primary.ksblaw.co.uk for status information.
Array members (1):
- primary.ksblaw.co.uk (primary): Accepting standard and secure
connections.
- Webtop sessions (0):
- Emulator sessions (0):
I there any logs I can check for why failed - I did have a scan but could
see nothing obvious.
Peter Polkinghorne
Do either of these systems have more than one network card ?
Carl
No - they both have single ethernet port & are both on same subnet.
PeterSituation resolved - did not have correct reverse DNS set up - now fine.
Just a pity no very obvious error message to alert to this problem.
Peter -
Hi,
i am trying to write an array coming out of a for loop into a file. If i plot the array in the Front panel everything works, but if i write it to a text file some aditional characters (empty space and this rectangle) appear.
The file should look like the text file but without spaces before first number of row and rectangle.
Attached are .txt and screenshot of blockdiagramm
Thanks for any help
Philipp
Attachments:
bd.jpg 98 KB
summary.txt 1 KBFirst of all: Thanks.
Your solution did exactely what i want, and i am fine with using a non-elegant version, if it works.
About that autoindexing + indexing the path:
I know this is stupid, and i changed it to not autoindexing. But these things happen, when you try to quickly expand an already existing vi and want to automatize with for loops instead of doing the same things over and over.
I am attaching the whole vi. it first was just the analysis, basically the inner loop, where i wanted to be able to vary the number and size of the parts of the waveform that go into the PSD to see how analysis time and numbers of averages effects the spectrum.
In the next step i created a vi that writes a string of two variables in a file, and then i wanted to do this for all files in a directory.
i am totally aware of the fact, that there are several dirty solutions. But i guess you are used to seeing these things, that could be done much more elegantely and efficiently, but if you try to get a quick solution that works for you and you learned Labview by trial and error, this is the way your vi´s look like.
By the way, what would you suggest to learn "clean" labVIEW programming ?
thanks again,
Philipp
Attachments:
acc_analysis+summary+loop.vi 182 KB
Maybe you are looking for
-
I used to be able to print my bank statements directly from the website to my printer. Now the print program sends the file to a file with a "cgi" extension and saves it on my desktop but as an Adobe file. When i open it to print, Adobe says it is no
-
Type conflict with ASSIGN in BADI for Virtual Key Figures
We get the below error dump in ST22 when executing BEx queries that contain virtual key figures. error message - 'Type conflict with ASSIGN in program "ZCL_IM_THR_RSR_OLAP_BADI======CP".' We have a BADI implementation that calculates few virtual key
-
Windows 8.1 enterprise screen saver custom time wont save setting??
i have no idea why i cannot save time settings for my screen saver. it keeps the same time default no matter what. any ideas how i can custom set this? very annoying. system specs: OS Name Microsoft Windows 8.1 Enterprise Version 6.3.9600 Build
-
Can i access MSN without wi-fi network?
Can i access MSN without Wi-Fi network? I mean, this might sound incredibly stupid but can I run apps such as MSN, Skype, FaceTime, through the 3G network? Without connecting to a wireless network? For example, if you're somewhere else other than hom
-
Extracting data from multiple tables, avoiding duplicates.
Hi I currently have two tables called Book and JournalPaper, both of which have a column called Publisher. Currently the data in the Publisher column is the Publisher name that is entered straight into either table and has been duplicated in many cas