Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viWriteButter in NI VISA sessionBased cmd

How to write a huge byte array in NI VISA MessageBasedSession .Function similar to viWriteBuffer in VISA ?

Can i use viWriteBuffer  cmd in NI VISA .My application is in C# .net .

0 Kudos
Message 1 of 4
(2,840 Views)

Hey!

 

For simply resizing the buffer, you could use viSetBuf. I'd recommend referencing the following resources about VISA:

 

This is the VISA User-Manual. You'll want to focus on chapter 5. http://www.ni.com/pdf/manuals/370423a.pdf

 

Sometimes the easiest way to learn something is by looking at examples. This Knowledge Base article shows you where to find VISA example programs. http://digital.ni.com/public.nsf/allkb/F3CBBEBF8D846BF586256B450059E5EA

 

Finally, for an overview of using VISA calls in C#: http://zone.ni.com/devzone/cda/tut/p/id/2739#toc3

 

Hope this helps!

 

Ryan S.

 

0 Kudos
Message 2 of 4
(2,832 Views)

Thanks for the Response.

 

I am working with NI.VisaNS and NI.Common ,Programming in C#. I want to write huge file in byte array to the instrument.

I used viBufWrite() in C ,in C# i tried to use mysession.Write(byte[]) which did not work.

 

How do i know the cmd similar to viBufWrite() in VisaNS.

 

Any document which have c version and c# version cmds comparision.Please help

 

Thanks

0 Kudos
Message 3 of 4
(2,830 Views)

There really isn't a document for a straight comparison between the C and C# command calls. You'll have to look them up individually.

 

For C: Programs >> National Instruments >> NI-DAQ >> Text Based Code Support >> NI DAQ-mx C Reference Help

For C#: Programs >> National Instruments >> NI-DAQ >> Text Based Code Support >> NI DAQ-mx .NET Framework Help

 

Hope this helps!

 

Ryan S.

0 Kudos
Message 4 of 4
(2,816 Views)