INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

GPIB: SCPI Help

GPIB: SCPI Help

(OP)
Hey Everyone,

I'm currently trying send the following SCPI command.

:MMEM:DATA "ARBI:<waveform name>", #ABC <------- Will the "#" be an issue
"<waveform name>"
the name of the waveform file within the signal generator.
A
the number of decimal digits to follow in B.
B
a decimal number specifying the number of data bytes in C.
C
the binary waveform data in 2-byte integers

I have several thousand bytes of data to send

Here is the code I have written, how do I format the data or change the code so that it will work properly?

# Download waveform to ESG
proc ::ESG::download_wfm {esg sour_fi sour_fq name} {

# open the source files
set fi [open $sour_fi]
set fq [open $sour_fq]

# fill arrays with the data
set i 0
while {1} {
set i_data [gets $fi]
set q_data [gets $fq]

set I_raw($i) $i_data
set Q_raw($i) $q_data

if {[eof $fi]} {
close $fi
close $fq

set Npoints [array size I_raw]
set Nbytes [expr $Npoints*2]
set Ndigits 5

break
}
incr i
}

# Convert to integer 0 to 16838
for {set j 0} {$j < $Npoints} {incr j} {
set Iwfm_data($j) [expr int(8191 + $I_raw($j)*8192)]
set Qwfm_data($j) [expr int(8191 + $Q_raw($j)*8192)]
}

set I [list]
foreach i_element [lsort -integer [array names Iwfm_data]] {
lappend I $Iwfm_data($i_element)
}

set Q [list]
foreach q_element [lsort -integer [array names Qwfm_data]] {
lappend Q $Qwfm_data($q_element)
}
# A B C from above
COMMON::write_instrument $esg ":MMEM:DATA ARBI:$name,#*$Ndigits$Nbytes$I"
COMMON::write_instrument $esg ":MMEM:DATA ARBQ:$name,#*$Ndigits$Nbytes$Q"

}
#----------------------------------------------------------------------------------------
Please let me know how to fix this, or if there is a mistake in my code

Thanks in advance,
CAO

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close