LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing Serial and DAQ data

I'm trying to synchronize in time data from TDK Lambda power supply and data from my DAQ.  I'm trying to plot data from both devices on a single XY Graph so I can see what the current reading on my power supply is when I see an event in the data collected form my DAQ  I've seen what could be solutions posted to the forum but the VIs are in versions of labview newer than mine.  I've posted what I have so far.  But I'm not sure how I can get the X-data from both loops to synchronize.

0 Kudos
Message 1 of 11
(2,794 Views)

I would add a sensing circuit so that you can measure the current with the DAQ.  Then you just have 2 channels in your DAQmx task and you know it will be synchronized.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(2,705 Views)

What sort of time-error is acceptable? As in, how accurate in time must they be synchronized?


GCentral
0 Kudos
Message 3 of 11
(2,700 Views)

This is THE perfect condition for using Waveform Data types and a chart to plot both values.

 

When you get an update from the power supply, put in an array that is the Y value of a waveform along with the current time of the PC...

 

And then

 

Grab the back log (property num of samples waiting) from the DAQ (configure to return WF data)

 

Then create an array of two waveforms (one from the power supply with a single value, and the other from the DAQ) and throw those at a chart.

 

Works as good as you can get based on the OS you are running on.

 

The chart does all of the work for us.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 11
(2,688 Views)

Deleted.  Posted to wrong topic

0 Kudos
Message 5 of 11
(2,665 Views)

@Ben wrote:

This is THE perfect condition for using Waveform Data types and a chart to plot both values.

 

When you get an update from the power supply, put in an array that is the Y value of a waveform along with the current time of the PC...

 

And then

 

Grab the back log (property num of samples waiting) from the DAQ (configure to return WF data)

 

Then create an array of two waveforms (one from the power supply with a single value, and the other from the DAQ) and throw those at a chart.

 

Works as good as you can get based on the OS you are running on.

 

The chart does all of the work for us.

 

Ben


When you say grab the DAQ's backlog do you mean the TotalSampPerChanAcquired from the the Read property node?  And what do I do with that single value?

 

I tried to follow your description as best I could.  This is what I did.  

  1. Created a property node that pulls the total samples per channel acquired.
  2. Built a waveform that contains an array of a single Y value from the power supply and a time stamp
  3. Built and array of two waveforms from the DAQ and the power supply.
  4. Fed the waveforms' array into a chart

Is this what you were trying to describe?  I've attached my VI of this.

0 Kudos
Message 6 of 11
(2,649 Views)

I think Ben meant the property "Available Samples Per Channel", but it actually isn't necessary in a Continuous Sampling task.

 

I made just a few mods in place to illustrate, saved back to LV 8.5 where you started from.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 7 of 11
(2,636 Views)

@Kevin_Price wrote:

I think Ben meant the property "Available Samples Per Channel", but it actually isn't necessary in a Continuous Sampling task.

 

I made just a few mods in place to illustrate, saved back to LV 8.5 where you started from.

 

 

-Kevin P


Old habits die hard.

 

Back in the day of traditional DAQ, ask for a fixed number of samples would hang eht thread waiting for the sample to arrive. So I would ask for "0" check the backlog and then request the buffered day be returned.

 

In other cases, I require a minimum number of samples or even multiples of some number of samples so that I could do some crunching, so again knowing how many were available was used.

 

Asking for "-1" just never occurred to me so thanks for that update Kevin!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 11
(2,615 Views)

Back in the day of traditional DAQ, ask for a fixed number of samples would hang eht thread waiting for the sample to arrive. So I would ask for "0" check the backlog and then request the buffered day be returned.

Yup, I remember those days and had that same habit too.   Now y'all kids get off our lawn!

 

 

-Kevin P

 

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 9 of 11
(2,610 Views)

@Ben wrote:

Back in the day of traditional DAQ...


Luckily, DAQmx came within a year after I started using LabVIEW.  Had a couple of small projects in Traditional DAQ and remember it being quite painful.

 

So, Ben, this is a really old habit that you just won't let die (I am talking nearly 15 years).  Let it retire already!

Spoiler
Preferably before December Smiley Wink

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 11
(2,595 Views)