LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array to waveform graph

Hi,

I have a callback library node which returned a 2D array of size (2 x 100). This node is a data acquisition program which acquired 2 set of data of 100 points from 2 different channels. I would like to know how can i get the time of each of these 100 samples (they are of fixed sampling interval)? Do i need to do it in the data acquisition program OR can i do it in labview using the time-stamp vi to get the start of the acquisition process?

I am trying to send these 2D array and time stamp to a waveform graph. How can i combine them?

Thanks

wee
0 Kudos
Message 1 of 11
(8,998 Views)
I assume that you are not getting any timing information back when calling the DLL.

You can use the �Get Date/Time In Seconds� function next to the Call Library Function Node to register when the DLL was called.

Use the �Build Waveform� function to bundle the start time (t0), the sampling interval (dt) and the data array into a Waveform data type. You can then display this by using a Waveform Graph.

See the attached �TimingInfo.GIF� for an explanation.

Best regards,
Philip C.
Applications Engineer
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 2 of 11
(8,989 Views)
Hi Philip,

Yes, assumption is correct.

Thanks for your picture. However, i remembered that I have tried something similar last week, the error was that the "Y" can only accept a 1D array. I have not figured out how to change it to acccept a 2D array which i am planning to input. I am not sure where to change it.

Thank you.

wee
0 Kudos
Message 3 of 11
(8,989 Views)
Remember to allocate the memory in LabVIEW before calling the DLL. See the attached image where the we allocate a size of 2x100 to the 2D array.

Best regards,
Philip C.
Applications Engineer
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 4 of 11
(8,989 Views)
Hi,

Sorry for this late reply.

I have tried the suggestions. But i encountered a problem. Even after i have initialised my array to 2D, the Build Waveform function still gives me the error of 2 different sized arrays connected.

I have posted two snapshots (jpeg format) of the "before i connect the 2D array to the Build Waveform" and "after i connect the 2D array to the Build Waveform". I am not sure where did i go wrong.

I am sure that i have a 2D array as subsequently in the vi, i have used the Index Array function to obtain the respective elements of in this array.

For another question,

This same 2D array is (8x1). Can i use a waveform graph to display 8 different points corresponding each elements on the same x-value (8 vertically plotted points)? I have tried and connected this array to a waveform graph but it produced a single point only. If i were to transpose this array, I get 8 points but on different x-value (1 point on x=0, 1 point on x=1 and so on).

Thanks a lot
0 Kudos
Message 5 of 11
(8,954 Views)
0 Kudos
Message 6 of 11
(8,953 Views)
it seems that i cannot post two attachments at the same time... Is there a way to do it?
cheers.
0 Kudos
Message 7 of 11
(8,954 Views)
Posting more than one attachment?
mmmm...
Well, you could travel back in time to the old forum system.
And if that solution isn't good for you, compress the files into a ZIP file.

___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(8,941 Views)
i just thought that there is a special way to do it as it is pretty common in other websites.

Thanks for your answer

cheers
0 Kudos
Message 9 of 11
(8,931 Views)
Hi,

By the way, I have solved my problem of getting a 2D array (8x1) onto a waveform chart with time stamp using "build waveform" and "bundle".

Cheers
0 Kudos
Message 10 of 11
(8,920 Views)