LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I synchronize the time (x-axis) on 2 independent wave charts?

Hi all. I have a wave chart that displyas 14 channels of waveform data acquired by DAQ-mx. I also have another wave chart displays keyboard input via transforming numbers to y-axis amplitudes.

Functionally, I would like to have the keyboard inputs marking events in my experiments so I can go back and see the change in the acquired waveforms from the 14 channels.

However, the problem is that the two charts never diplay or record in the same x-axis format (tried fiddling with property nodes or just change things via chart properties). I tried to hook them up with a common timestamp but the dynamic data from the DAQ assistant does not like to be bundled with an external timestamp and plugged int
o a graph. I understand the DAQ acquired data are already timestamped, so is there anyway to use that timestamp to synchronize the x-axis of the two charts? Or are there any suggestions how to get the two charts at least record under the same timestamp?

I am a newbie so if you want something clarified, please ask. Thanks in advance for any help.
0 Kudos
Message 1 of 8
(3,763 Views)
Hello Kaminakiba,

I have attached an example program taking data from both a DAQ Assistant and a random number generator, synchronizing their data to the same timestamp, and plotting on two different charts.

If none of these suggestions help, or if I�m not correctly understanding your issue, please post the software and versions you are using, the applicable portions of your code, and any other information that may help, and I�ll be happy to look further into it.

Have a nice day!

Robert M
Applications Engineer
National Instruments
Robert Mortensen
Software Engineer
National Instruments
Message 2 of 8
(3,763 Views)
Hi Robert,

Thanks very much for the advice and example. The idea of it works like a charm. However, the dynamic data does not like to plug into build waveform and I can only get "single waveform" to work when using "from DDT" to convert the dynamic data into a waveform (like what you had in your example). Even when I did that, the graph refuses to display 14 channels stacked together, and goes into this loop which it restarts itself. Here is the file that I have been working on, please let me know where you think I've got it wrong. Thanks again.
0 Kudos
Message 3 of 8
(3,763 Views)
Hello Kaminakiba,

I was unable to open your VI, due to missing sub-VI�s: Read Keyboard.vi, Check for Function Key.vi, Close Keyboard.vi, Open Keyboard.vi. However, I modified the example I sent to work with multiple channels. Let me know if this works for you.

Have a nice day!

Robert M
Applications Engineer
National Instruments
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 4 of 8
(3,763 Views)
Hi Robert. Sorry for the lack of response as I was away for a week. I got onto the example you posted a couple of days ago. Once again problem solved bar a small glitch. I have been trying to find my problem but ended up just tweaking it by elimination. Might be something quite simple but I just can't spot it.

Like my previous comment on implementing my system in your example, for some reason the 14 channel graph that has its input from the DAQ assistant restarts every 100ms or so once the program is running. i.e. the graph displayed would only be a record of 100 ms. I have modified your example to demonstrate my problem.

One interesting thing I noted while trying to fix this by elimination is that if I don't modify the wa
ve chart in your example, everything works. However, as soon as I delete the original chart, add and customize a new one, the chart starts to "stutter". I have considered there was something between the properties of the wave charts but found none. Like I said, maybe it's just something simple I can't see.

Thanks again for your great help and I am looking forward to another informative feedback.
0 Kudos
Message 5 of 8
(3,763 Views)
Hello Kaminakiba,

I was able to run your modified example after changing the DAQ Assistant to voltage reads on 14 channels. I only saw glitches (stutter) when I used the OS for other processor intensive applications, which glitches are probably due to my slow computer (1 Ghz, 128 MB RAM). What exactly do you mean when you say the graph restarts every 100 ms? The graph has a scrollbar at the bottom, making available all previous data.

Have a nice day!

Robert M
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 6 of 8
(3,763 Views)
Hi Robert,

That's interesting, what you have encountered. Firstly, I wonder if switching the DAQ assistant from analogue current input to voltage has anything to do with it. I need to take the current measurement so I need the system to work with current instead of voltage (acquiring continuously).

The machine I am using is a AMD Athlon 2500+ with 512 RAM, so it shouldn't be a machine problem.

The problem I have is that the record would start from the right hand side of the graph, display the signal with a history of approx. 100msec before restarting again. Visually, you just see the 100 msec signal band appearing, disapearing and apearing again on the right hand side of the graph, in quick succession. Conseq
uently, the scroll bar picks up no history.

Hope this description helps, please let me know if you require more information. Thanks again!
0 Kudos
Message 7 of 8
(3,763 Views)
Hello Kaminakiba,

After switching the DAQ Assistant to current measurements, I was able to replicate your issue. This is unexpected behavior, and unfortunately, there is no easy fix at the moment. The chart works fine when tied to the data right out of the DAQ Assistant, but exhibits the described behavior after adding the timestamp. I will let you know what progress we make with a work-around, but for the time being, the data coming out of the DAQ Assistant will have to suffice.

Robert Mortensen
Applications Engineer
National Instruments
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 8 of 8
(3,763 Views)