importing arbitrary waveform for generation.

Post your VB and VBA discussions here
Post Reply
fabianmicallef
Newbie
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

importing arbitrary waveform for generation.

Post by fabianmicallef »

I am trying to set up the AWG on my 2204 picoscope and I am using VBA for excel. How do I import the data of the arbitrary waveform, which is currently saved as a column in a CSV file, and how do I implement it in the function ps2000_set_sig_gen_arbitrary? Eseentially, what do I have to place in the argument arbitraryWaveform, which is of type Long. Thank you for your continued support.

fabianmicallef
Newbie
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

Re: importing arbitrary waveform for generation.

Post by fabianmicallef »

I am also trying to set up fast streaming of data. The streaming example in the SDK examples for excel is compatible streaming which on the attached pdf says that it cannot be used for my 2204 model. I have tried my best to modify the example for fast streaming but the computer freezes when I run it, I believe that the problem is that I am not using the pointers and indexes required correctly. I also have no idea in what variable are the readings going as none of the functions the pdf told me to define seem to have places for them, unlike the ones used in the example. Here is the code:

Code: Select all

Sub StreamingData2()
ReDim values_a(100) As Integer
ReDim values_b(100) As Integer
ReDim values_c(100) As Integer
ReDim values_d(100) As Integer
ReDim times(100) As Long
Dim no As Long
Dim overflow As Integer
Dim counter As Integer

ps2000_handle = ps2000_open_unit()
  
If ps2000_handle = 0 Then
   MsgBox "Unit not opened", vbOKOnly, "Error Message"
   Exit Sub
End If


Call ps2000_set_channel(ps2000_handle, 0, 1, 1, 10)

Cells(17, "E").Value = "channel A opened"

Call ps2000_set_channel(ps2000_handle, 1, 1, 0, 10)
  
Cells(17, "E").Value = "channel B opened"
  
'Trigger disabled
Call ps2000_set_trigger(ps2000_handle, 5, 0, 0, 0, 0)

'find the maximum number of samples, the time interval (in time_units),
'the most suitable time units, and the maximum oversample at the current timebase
timebase = 13
no_of_samples = 100

ok = ps2000_run_streaming_ns(ps2000_handle, 1, 13, 100, 1, 1, 15000)

counter = 0

'the values (in ADC counts)
no = 0
While no = 0
  no = ps2000_get_streaming_last_values(ps2000_handle, buffers)
Wend

buffers = my_get_overview_buffers(no, overflow, 0, 0, 100)

For i = 0 To (no - 1)
   Cells(counter + i + 4, "B").Value = values_a(i)
   Cells(counter + i + 4, "C").Value = (values_a(i) / 32767) * 20000
Next i
    
If counter > 1000 Then
  counter = 0
Else
  counter = counter + i
End If
 
End Sub

Hitesh

Re: importing arbitrary waveform for generation.

Post by Hitesh »

Hi Fabian,

You arbitrary waveform needs to be a set of char values in the range 0 (min value) to 255 (max value). It should be possible to obtain the values from the csv file into a char array which you can pass to the function call.

Please refer to the recently updated PicoScope 2000 Series Programmer's Guide on our documents page for further information:

http://www.picotech.com/document/

With regards to Fast Streaming, release 10.5.0.28 for the SDK contains an example that shows how to collect Fast Streaming Data and retrieve data once the collection has stopped.

Best wishes,

fabianmicallef
Newbie
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

Re: importing arbitrary waveform for generation.

Post by fabianmicallef »

Thank you for your advice.
Could you please give me another link to the recent SDK zip file as the one on the software page is not functioning.
It is giving me the following error:

Code: Select all

This XML file does not appear to have any style information associated with it. The document tree is shown below.

AccessDenied
Access Denied
20888FFCA726E8B2

H53oHka/9GkG+kTYT2LrEcRzS3fUNEZfEiG47MJLTKrPL8JmhsgWJosy9CgdXsZ4


Hitesh

Re: importing arbitrary waveform for generation.

Post by Hitesh »

Hi Fabian,

We are aware of an issue with our download server which should be corrected soon. If you require this file immediately please email support@picotech.com for a link.

Thanks,

fabianmicallef
Newbie
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

Re: importing arbitrary waveform for generation.

Post by fabianmicallef »

I have e-mailed,
Thank you for your support

Post Reply