HELP! GPIB ilrd() in VB

I'm having trouble in VisualBasic with an HP DMM using the GPIB cmd : ilrd(Dev%,ValueStr$,Len(ValueStr$)). I'm pretty sure it's how I've dimensioned ValueStr$. What is the proper way? I've also seen the call used like: ilrd(Dev%,ValueStr,Len(ValueStr)). No $ signs. Whats the difference?

my code uses: Dim ValueStr As String Dim Dev As integer Also, what does the $ at the end of ValueStr mean, and the % on Dev?

Reply to
sdeyoreo
Loading thread data ...

Hi,

Took from the MSDN Help: " The type-declaration character for String is the dollar sign ($). The type-declaration character for Integer is the percent sign (%). "

And the Dev% value is the handle of your instrument that you assigned when you initialized it.

I'm using this function and here is how it is implemmented, this is the function on VB 6.0: '------------------------------------------------------ ' Reads a specific number of bytes from GPIB validating if an error ocurred Public Function ReadGPIB(ByVal Device As Integer, count As Integer) As String

Const arraysize = 100 ' Size of read buffer Dim ValueStr As String * arraysize ' Buffer to receive from GPIB

ilrd Device%, ValueStr, count ' reads the string If (ibsta And EERR) Then Call GPIBClearError(Device%, "Unable to send data to Device No." & Device) 'Feb/28/02 RVC replacement ReadGPIB = "N/A" Else ReadGPIB = Left(ValueStr, count) End If

End Function '------------------------------------------------------------------

Can you tell me exactly what your problem is, may be I can come up with some experience that might help you.\\

Reply to
gustavo.ramirez.v

Reply to
sdeyoreo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.