Using Cscope control driver vi

Using Cscope control driver vi, a forum discussion on Cleverscope. Join us for more discussions on Using Cscope control driver vi on our Driver Questions forum.

Back to Forum Index : Back to Driver Questions   RSS

21 Oct 2009
Posts: 5

I'm new to LabView and am trying to write a LV vi that interfaces to my CS328. I want to use the signal generator to sweep a range of frequencies and read back using the oscilloscope. I've read "Using the Cleverscope Labview Driver" and "Cscope Driver vi Description", and I've had a good look at actual vi. According to the 'Using the vi' instructions, I need to setup the Acquire Definition and call using Acquire, but I can't see how to set up the Acquire Definition; the vi for it seems quite imposing. My best bet would be to use a bundle but i can't see how this would work. Also, I'm not sure if I should be using a frame sequence to accomplish everything or not. Can anybody give me some direction? Thanks.

24 Oct 2009
Posts: 396

Hello there,
You will find in our Control Driver collection two examples that illustrate what you are wanting to do. The application Simplescope.vi includes a GUI, and controls the sig gen, and displays the results. If you are using LV8.5 or later (we will soon do the same for all the other environments) you can download the latest LV85 control driver and also play with Minimal Scope which shows you the minimum steps needed to control the acquisition unit. There is a decription document here

Ok, onto your specific question - the acquire variable is a labview cluster (also exposed as a C struct in the DLL), which may look daunting, but is in fact just a collection of parameters, most of which you can leave as default if you don't use them. In labview to change one value, for example to set the Sig Gen Frequency, you use the Labview Bundle By Name cluster to change the frequency value




The incoming wire comes from the acquire variable, and the outgoing wire goes back into the acquire variable (or a while shift register as here).

In your application you will need to call Cscope Control with this steps:
Step Command Description
1. Acquisition Definition Setup
Command: None
Here you need to ensure that all the values in the acquisition definition variable are correct. Off course you can change these values later. If you change any values make sure you change the value in ‘Value Changed’ as well, as this forces an update scan in the driver (the driver only updates values that have changed to the acquisition hardware unit). A simple way is to wire the msec timer to value changed.
2. Initialize
Cscope Command: Initialize
Initialize the Cscope Control Driver, by wiring the Initialize command. The acquisition unit will be setup as specified by the Acquisition Definition, and the acquisition unit chosen. Make sure that the ‘Acquire Mode’ value is set to stop, otherwise the unit will do an acquisition following initialization.
Initialization, which is opening the port, retrieving the calibration coefficients, and sending the entire acquisition definition to the acquisition unit takes about 1.4 seconds.
3. Status
cscope Command: Status
Wait for Status = Open. This step is optional, but it does ensure that further commands are talking to an open system. If you don't wait for status = open, and there is no connected unit, the error output will show a warning
for an unconnected unit. If you do not use the Status check, you should wait about 1.5 secs before moving on to the Acquire step to allow the acquisition unit to be fully updated.
4a. Acquire
Cscope Command = Acquire
Acquire a samples set. You need to set the Acquire mode entry to either Single or Auto to capture the sample set. Single uses Triggered capture. Auto will capture with a trigger, if there is one, otherwise it just captures
regardless.
4b. Update
Cscope Command: Update
If you want to change a value in the acquisition unit - for example the Sig Gen Frequency, without acquiring, use the update command, and just change the value in the acquire cluster you want changed.
5. Wait for samples
Cscope Command: Wait for samples
Iterate until Got Samples is true, and then read the sample set. If you call at 50 msec intervals you will get maximum throughput. Calling any faster makes no gain. The Signal Output is an array that we turn into a waveform in this example.
6.Close
Cscope Command: Close
If you have multiple acquisition units connected, you may independently initialize and close a specific acquisition unit while leaving other acquisition units un-affected.
7. Finish
Cscope Command: Finish
Finishes operation - closes the runtime system.

You have to wire the variables as needed into the Cscope Control vi. The driver use document describes which variables are required. The Acquire variable is the one that defines the state of the system.

I hope this helps.

20 Feb 2012
Posts: 2

Command are
Unsigned 16 bit value.
Values are:
0 - Inititialize. Call this once to initialise the acquisition system
1 Acquire. Call to acquire data as defined by the Acquire Definition and other parameters.
2 Replay. Call this to re-decimate the capture buffer, and return new samples, based on the SamplesIn Replay, ReplayStartTime and ReplayStopTime values.
3 Wait for samples. Call this check for if all the samples have been received. The Value GotSamples is set true when all the samples have been received.
4 Update acquisition unit with capturing samples. Can be used to update the signal generator values for example.
5 Finish. Call this to close down the acqusition system
Back to Forum Index : Back to Driver Questions   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.