LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

E3631A sampling issue

Solved!
Go to solution

Hi all,

 

There are a program to set vary voltage out and read it on table and write it into file, but the data duration is too long (around 4s for each cycle), how can I take sample as small as possible. Thank you.

0 Kudos
Message 1 of 7
(3,014 Views)

Hello,

I can't look at your E3631A vi's as you haven't included them, but you are using one loop to acquire and write data. If you split this in to two loops and use a producer/consumer (data) architecture using queues, you can increase the acquisition rate and write to the disk at a different rate. Try this one here: 

https://decibel.ni.com/content/docs/DOC-8962

Or search for "producer consumer data"

Hope this helps.

Regards,

aCe


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 7
(3,007 Views)

Thanks aCeSmiley Wink, I will try it later

0 Kudos
Message 3 of 7
(2,989 Views)

I try it refer to the Producer/Consumer design, but the cycle time is same (still 4s). Do I set something wrong, pls give comment. Thank you!

Download All
0 Kudos
Message 4 of 7
(2,973 Views)

You need to move the data acquisition loop to the producer loop (top while loop) and keep the write to file (typically slower) in the consumer loop (bottom while loop)

Also, express vi's can be detrimental to performance. Try to avoid them if possible. 


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 5 of 7
(2,958 Views)
Solution
Accepted by topic author nvnewbie

Hi nvnewbie,

 

Actually, your problem has nothing to do with your data acquisition structure, although on both of your block diagrams you do not have the file input wired to Write to Measurement File, so you are not logging any data. You should wire your table to the string input to Write to Measurement File. 

 

The delay that you are seeing is expected; the Configure Output, Configure Current Limit, and Read Output VIs within the Agilent E363X Instrument Driver Library all call the Error Query VI, which is also within the Agilent E363X Instrument Driver library. The Error Query VI has a built in 1 second delay in order to make sure that there is not a timeout when communicating to the E3631A over serial. You can see this delay for yourself if you open up your SubVIs in your block diagram.

 

Since you call the Configure Output, Configure Current Limit, and Read Output VIs with every iteration of your while loop, that is 3 seconds of guaranteed delay each time the while loop iterates. There are also delays built into those VIs themselves, so all of this delay adds up to 4 seconds. If you want to minimize this delay, you can edit the Error Query VI to reduce the delay, though I would expect this to cause timeout errors if you make the wait too slow. Serial is not made for high-speed communication. You can also rewrite your code to only call the Configure Output and Configure Current Limit VIs when you need to adjust the settings. 

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 6 of 7
(2,939 Views)

Dear aCe,

 

Thanks you for support me, I got the answer from Dan.

 

 

Dear Dan,

 

Thanks a lot for your reply, I sure it is the answer for the issue. I just know I can explore the code inside the blockSmiley Surprised, it will be helpful for my later learning.

0 Kudos
Message 7 of 7
(2,931 Views)