Thread: VB.net - Using binary block mode transfer for arbitrary waveforms 33521a


Permlink Replies: 3 - Pages: 1 - Last Post: Aug 8, 2012 1:02 PM Last Post By: dnao2 Threads: [ Previous | Next ]
dnao2

Posts: 9
Registered: 04/22/12
VB.net - Using binary block mode transfer for arbitrary waveforms 33521a
Posted: Jul 5, 2012 1:02 PM
Click to report abuse...   Click to reply to this thread Reply
Hi there,

I have been so far unsuccessful in transferring an arb. waveform directly within my program into the function generator using the binary block mode. I was successful transferring using a list of binary integers.

For the binary block mode, If I were to transfer 9 binary values (ex. 0,100,1000,10000,30000,10000,1000,100,0) would the following syntax be correct?

Dim inputString As String = "DATA:ARB:DAC VOLATILE, #2180100100010000300001000010001000"

  • where 2 = number if digits to follow
  • where 18 = number of bytes to transfer (9-16bit data values = 18 bytes)
  • DAC data values between -32767 to 32767, all concatenated without spaces, etc

I am then sending this string using the command:

visa32.viPrintf(vi, inputString + vbLf)

I do not want to save the data file and load it. I am generating the points within the program and then sending it over. In my particular program, I am using 64000 points, so my <n_bytes> would be 128000.

Any help would be appreciated!! I've read a lot of different guides but I cannot find anything specifically for vb.net.

Thanks in advance

dnao2

Posts: 9
Registered: 04/22/12
Re: VB.net - Using binary block mode transfer for arbitrary waveforms 33521a
Posted: Jul 6, 2012 7:53 AM   in response to: dnao2 in response to: dnao2
Click to report abuse...   Click to reply to this thread Reply
To add an update, I've made some progress which I think is on the right track. The above line should be changed to the following:

Dim inputString As String = "DATA:ARB:DAC VOLATILE, #218" + arrData.ToString

where each element of the arrData stores a value to be transferred. Hope this helps others who might be interested in it.
lhornburg

Posts: 432
Registered: 01/15/10
Re: VB.net - Using binary block mode transfer for arbitrary waveforms 33521a
Posted: Jul 10, 2012 10:47 AM   in response to: dnao2 in response to: dnao2
Click to report abuse...   Click to reply to this thread Reply
Did you get this working now, or do you still need some assistance?
dnao2

Posts: 9
Registered: 04/22/12
Re: VB.net - Using binary block mode transfer for arbitrary waveforms 33521a
Posted: Aug 8, 2012 1:02 PM   in response to: dnao2 in response to: dnao2
Click to report abuse...   Click to reply to this thread Reply
Hi,

I have solved the issue binary block mode transfer. It is slightly different than what I posted above.

Dim arrData(numSamples - 1) As Int16
for i as integer = 0 to numSamples-1
arrData(i) = ____ (your data)
end for

status = visa32.viPrintf(vi, command + vbCrLf) ' command = "DATA:VOLATILE:CLEAR" as a string
status = visa32.viPrintf(vi, "DATA:ARB:DAC myWave, %*hb" & vbCrLf, arrData.Length(), arrData)

Thanks!

Point your RSS reader here for a feed of the latest messages in all forums