LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difficulty synchronizing data from VISA resource with data from a physical channel

Essentially what I'd like my program to do is control the electrical power going (sourcing either current or voltage) into a light and measure the intensity of the light at a given power level, and then do this automatically for ~1000 increments of the source voltage/current.

 

One of my lab partners made a program a while back which does what we want("LIV Sweep Rev.vi" the first image in the link at the end of this post), but it's a bit sloppy: the program is able to interact with the power supply (connected directly to the computer via USB) and make it turn on, increase the voltage/current, and record the "IV" characteristics just fine. The program can also interact with the light detector (connected via NI-BNC 2110) and gather the photocurrent data. The problem, however, is that the data wouldn't be in sync. The photocurrent data for when the light was actually supplied with 1V would be improperly recorded in the cell for when 2V are applied to the light. To fix this problem my lab partner added in a time delay so that the detector will pause for ~0.35 sec (user-specified in front panel) before gathering data.

 

The program works, but I figured there had to be a better way. The thing about the timing, however, is that it changes from run to run. Sometimes a delay of 0.45 s works well, and other times the power supply will have shut down while the detector is still gathering data (and thus we miss the low end of the sweep). Other times the detector will turn on too early, which will cut off the high end of the sweep.

 

(Note: I have next to zero experience with LabVIEW, but I know a little bit of java, so I understand most programming jargon)

I spent all day yesterday trying to find out how to synchronize two data aquisitions (my attempt is shown in the "LIV SweepSummerDuncanRev3.vi" in the link at the bottom, 2nd image) but I'm running into trouble when I try to trigger the sample clock using the VISA Resource Name for the power supply.

 

The programs can be viewed here:

http://imgur.com/a/Up3eS

 

I'd really appreciate any and all advice that you folks have to offer!

0 Kudos
Message 1 of 2
(2,032 Views)

Change the code such that rather than using a ramp from your power supply, just output a single value. Then do your measurement and then step to the next value in your ramp.

 

You can use a State Machine (SEarch if you do not know that term in LV).

 

Some gear will allow specifying a ramp driven by an external clock. If you widget can handle an external clock/trigger that approach could run faster.

 

Without hardware to syncronize the various sub-systems you would have to resort to using a RT OS and depending on the instruments, even that could be hit-n-miss.

 

So re-code to step-measure-step-measure etc.

 

Ben

 

 

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