using the signal generator with LabView 7.0

Using the signal generator with LabView 7.0, a forum discussion on Cleverscope Mixed Signal USB Oscilloscopes. Join us for more discussions on Using the signal generator with LabView 7.0 on our Other Issues forum.

Back to Forum Index : Back to Other Issues   RSS
Anon

10 May 2007
Posts:

Hello,

I have problems to setup the Signal Generator in LabView7.0
I use the CScope control driver VI to setup my frequency, my amp and so on.

But it won´t work.

When I start the Cleverscope Software the SigGen works fine, but it is not possible for me to get it started in LabView.

Can someone give me information, what I have to setup in the CScope Control VI to get the SigGen started?
bartschroder

10 May 2007
Posts: 477

The reason it does not work is that we have not yet updated the Labview 7.0 Vi to work with the Cs328A (we guess you have this?). It is updated for Labview 7.1. We will do this shortly.
Anon

17 May 2007
Posts:

hello again,

I´ve updated my LabView to version 7.1.

It was possible to get the SigGen started but I have new problems using the controlVI.

What is the correct way to let the SigGen work while I try to do a measurement?

I´ll try to explain what I want to do:

My mission is, that I have to use the SigGen to control a device by setting an amp, a freq and a waveform.
Also I need the outputsignal of the SigGen to trigger on a positive slope (connected on chan B of the cleverscope) to measure a voltage on chan A.

So I need the SigGen to control my device and for a TriggerInput(chan B) and chan A for measurement.

I get the SigGen startet with the controlVI: 1. set to Initialize
2. set to aquire to start the siggen output.

then I tried to Start my measurementprogram but it won´t get any data measured. Sometimes my SigGen stops the output, sometimes my LabView crashes or I get a ControlVI internal Error.

What is the correct way to start the SigGen-> Control commands
Do I need to let the Siggen controlVI always runnig when I try to do a measurement or is it enough when I start it first?

Why do I need to set a control on the control VI when I want to start the sigGen? That makes no sense to me.
Particularly ""Initialize"" and ""Aquire""....

please excuse my bad english (I´m german).

I hope you can help me out of my helplessness
bartschroder

24 May 2007
Posts: 477

Hello Daniel,
If you just want to control the Sig Gen, the correct sequence is:

1. Initialize
2. Update (with acquire cluster set as required).
Repeat update as needed.
3. Finish.

If you want to acquire at the same time, you can do
1. Initialize
2. Acquire (sets sig gen running, waits for trigger if defined)
3. Update (to change sig gen if required, even if not triggered)
Repeat 2-3 as needed.
4. Finish.

As you are doing it in Labview, make sure you call the 'wait for samples' with a timer. A good poll period is greater than 20ms. Anything less than 20ms will achieve nothing, and will just load the processor. Do not run Wait for Samples in a continuous loop without timer intervention (the timer gives time to the background thread monitoring the acquisition unit).

We have a compiled example 'Simple Scope' as an example. We suggest you download the latest vi from the resources page, and use the simple scope example just to test that your hardware is performing correctly.

You don't need to run the vi continuously. In fact you should be able to test it manually by opening the driver vi, and manually doing commands of 'Init' (and clicking on the Labview run button), then setting up the acquire cluster, and choosing the 'Update' command, and running, and finally 'Finish' and running.

We hope this helps.
Anon

31 May 2007
Posts:

Hello,

It seems that I have some new problems.

1. Always when I start the command Initialize, LabView is searching for the QuickUSB.dll library. It seems that the path for that dll won´t be saved.

Because of this problem, I have to built a waittime greater 3sec behind the init command. If not, there won´t be an aquisition.

2. You said that the waittime for the command ""Wait for samples"" has to be about 20msec. When I take a shorter time than 500msec nothing will be aquired.

3. I built my program with one ""INIT"" comand. Then I started in a ""for-loop"" (where I say how often I want to aquire) with ""AQUIRE"", then wait (500msec) and ""GOT SAMPLES"", I leave the for-loop and ""FINISH"".

It seems that the data I aquire is running away. Every single measurement it seems, that the first aquired samples are zero. With every new measurement its getting more.

for example: when I do only one measurement the data after the triggerevent is ok. When I try to measure two triggerevents with ""init, aquire, got samples, aquire, got samples, finish"" I have some samples after the second triggerevent that are zero.

Is it possible that the scope overwrites some samples or that I get some wrong measurement back?
Or do I have to finish after each measurement? But when I finish after each measurement I also have to Init everytime. And there is the QuickUSB.dll error again.

I hope you can help me again.

best regards,

bartschroder

1 Jun 2007
Posts: 477

Hello,
I shall send you by email a very small application that allows you to exercise the Cleverscope command by command. This shows you that you can open and close the DLL very quickly. Please put the quickusb.dll into the same directory as your application. However, you should only Load the DLL once, at start up - the delay is quite long as you say. In our application, we load it, open it, and leave it open until the user quits. Have you tried using the simple scope demo that is included with the labview vi. Please let us know if this working correctly.

We run a 20msec wait for sample loop. You can see that the scope is running much faster than once every 500 msec. The important thing here is that you allow some background time for the operating system to service the measurement thread. With labview the easiest way is to use a delay. So the sequence is:

Init
Loop1: Acquire
Loop 2: Delay 20 msec (using the time delay function)
Wait for samples - is got samples true - if it is, transfer the samples, if false Loop 2.
repeat Loop 1 until finished.
Close

Please email us your vi, and we will see what we can do. (But it is a holiday in New Zealand this weekend, for 3 days).

regards

Bart
Anon

2 Jun 2007
Posts:

Hello,

the simplescopeVI works without problems but it also is searching for the quickusb.dll. But I cant use this for my work, because I have to aquire a defined number of samples. My mission is, that I have to use the scope like a data aquisition system where I can say how much samples I want to measure in a defined time after a triggerevent. This aquisiton I have to do several times (for example 30 times, 2000 samples after triggerevent).

But since the last tests, I dont get the defined samples back. I allways get 5 to 8 samples more. This is no problem, because I can just cut them out of the array, but I dont understand why this is so.

The problem with the QUICKUSB.dll is, that the program is everytime, the command ""INITIALIZE"" is called, searching for the dll. Normally the SubVI´s should save the path for missing data. I´ll copy the dll to my VI path and look whether or not its working next week.

I´ll send you the VI next week.

thanks for help and nice holiday,

Anon

7 Jun 2007
Posts:

Hi,

I think I´ve found out why it won´t work. The problem is the command ""FINISH"".

Mostly when the command is called LabView crashes or I get some errors. I have now removed the INITIALIZE and the FINISH command from my main aquire VI.

When I start my LabView program 1st of all ""INIT"" is called. When I stop the prog. ""FINISH"" is called.

And mostly when I finish the program LabView crashes.

But my aquisition is working :)

I also found in your SimpleScopeVI nowhere the command ""Finish"" only if there is an error.

I´ve completly removed the finish call from my program and this still works. But allways when I close LabView I get a message that the program is still running.

So how you stop the scope?

Is it possible that there is an error when the command ""FINISH"" is called?



regards,
Back to Forum Index : Back to Other Issues   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.

×

Your shopping cart is empty.