LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI not transferring data to instrument.

Solved!
Go to solution

Hello to all those interested.  I'm working on a instrument driver for a Agilent D3000A (E4432A) signal generator trying to get the generator to sweep the amplitude from -30dBm to -75dBm and then back again in a loop.  The loop resides in a event structure and is called by a switch on the front panel.  When the switch is selected the event triggers and the loop information is passed to the VI's.  The problem is that the VI "Sweep Steps" isn't using the data from the # of point in the sweep and the dwell time at each point and the loop runs like the amplitude is just switching between the min and Max amplitude levels.  But once I stop the program the generator will continue sweeping (only in one direction) but the the correct dwell time and number of points.  When I use the "Measurement and Automation explorer's" NI spy program I'm not seeing that data get transferred to the instrument.  I'm not sure if having the SubVI's in the order of execution is correct and was wonder if someone could take a look and let me know if I have them in an incorrectly order.  Could not find a example of this program type from the driver's examples so there is little help there.  I have attached the program and the instrument driver for your review, so please take a look and pass on any information that you feel will help me get this running correctly.  I have also tried to run the sweep in a single sweep mode and just have the direction change to get the sweep to ramp the other way but I'm still getting the same results. 

The generator has options 15E and UN3. 

I,m using LabVIEW 2010 on a Dell Dimension 2400 running Windows XP and service pack Version 5.1.2600 Service Pack 3 Build 2600.
Please let me know if you need any other information.

Thanks,

Download All
0 Kudos
Message 1 of 6
(2,138 Views)

First of all, I have trouble believing that your stop program button works while you are sweeping or that you can stop the sweep.  Your event structure's event is set to Lock Front Panel.  In general, things that take a long time should not be put into an event case.  It would be better having the sweep functionality in another loop that you can command with a queue or notifier.

 

Also, I bet you are expecting your Dwell to be in seconds.  The Wait is really in ms, so you probably need to multiply by 1000.

 

EDIT:  It just hit me.  Your wait needs to be the dwell time multplied by the number of steps.  The dwell time is how long it stays at a given level during the sweep.


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 2 of 6
(2,121 Views)

Crossrulz,

Thank you for the information.  I know that the stop button was not working but that at the time was the least of my worries.  I was unaware that an event structure would lock out the front panel so I'm going to go back and see what else I may be able to use.  As to using the queue or notifier I'll have to find out how they function before I use them so back to the books.  I appreciate you time and I'll let you know how this turns out, I have to have this running to go to a show next to be used for a demo of one of our new GPS down converter.

Take Care!

0 Kudos
Message 3 of 6
(2,111 Views)

"When the switch is selected the event triggers and the loop information is passed to the VI's."

 

The only data passed to the loop is the reference and error wire.

 

"The problem is that the VI "Sweep Steps" isn't using the data from the # of point in the sweep and the dwell time at each point and the loop runs like the amplitude is just switching between the min and Max amplitude levels.  "

 

I'm guessing you are talking about the sequence of drivers in the "active sweep functions" case, yes? 

 

 

"But once I stop the program the generator will continue sweeping (only in one direction) but the the correct dwell time and number of points. "

 

Sounds like the instrument might be getting a lot of commands and is doing what it was told to do.

 

" When I use the "Measurement and Automation explorer's" NI spy program I'm not seeing that data get transferred to the instrument. "

 

Try using I/O spy, now called the I/O trace.  Run this during the VI and it will log what is being sent by VISA.

 

 

 "I'm not sure if having the SubVI's in the order of execution is correct and was wonder if someone could take a look and let me know if I have them in an incorrectly order. "

 

Domain knowledge.  You should try running these VI's one at a time in order to see if they work.  Usually I put together a SubVI that runs drivers in order to make sure my process is correct, then I put them in a application.

 

" Could not find a example of this program type from the driver's examples so there is little help there.  I have attached the program and the instrument driver for your review, so please take a look and pass on any information that you feel will help me get this running correctly.  I have also tried to run the sweep in a single sweep mode and just have the direction change to get the sweep to ramp the other way but I'm still getting the same results." 

 

Not to familiar with these instruments in a daily use kind of way.  You might have to look at the manual and check the vendors forums to see if there is some similar questions.

 

You might try sweeping with just one point, and/or some other methods to run simple, them move up to multiple points, etc...  

-------
Mark Ramsdale
-------
Message 4 of 6
(2,108 Views)
Solution
Accepted by topic author ggaryt

For the short term, just right click on the event structure, select Configure Events Handled by this Case and uncheck the Lock Front Panel.  Also, I'm not sure if you caught my edit.  I think your problem is your wait (or lack there of).  Have your waits be a little more than the number of steps multplied by the dwell time.  You have the let the instrument run its sweep after all.


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 5 of 6
(2,105 Views)

Hello Mark,

 

Thank you for the information, Crossrulz and you have given me a very good starting point to fix this problem and I'm starting to get the program to acknowledge the front panel in the loop so I have some control back and that is progress.  I'm looking at the loop and trying to find out why the data isn't loading but that is all part of learn how to use LabVIEW correctly.  Thanks again for your help and I'll let you know who this turns out, I need to have this working next week.

 

Happy Friday to you all!

0 Kudos
Message 6 of 6
(2,090 Views)