12-08-2010 09:09 AM
Hello together,
I want to receive data from my scope (Tektronix mso4054) without using any commercial software like TekVisa or SignalExpress.
I want to use C# to communicate with the scope.
I included NationaInstruments.VisaNS and NationalInstruments.Common to my references in C#. And I succesfull can check with C# if may PC is connected to
the scope. But know I want to receive data from the scope. I know that I have to begin a VXISession, but it does not function. How do I open correctly a new VXISession?
I also do not know how to get help for my case.
Can some help me or give any hints?
Greetings to all
12-09-2010 07:54 AM - edited 12-09-2010 07:54 AM
Hi mnikoli,
if you want to have some information about perform a communication with VISA please check this example and read the note. Hope this helps
"Using Microsoft Visual C# to Find all VISA Resources and Perform Communication"
<http://zone.ni.com/devzone/cda/epd/p/id/4095>
If you have some special questions about your communication with your Tektronix scope please feel free to contact the manufacturer about the commands.
12-09-2010 08:11 AM
Hello,
now it functions. Now I receive data from the scope and can send queries to the scope.
1. But I get everytime the ErrorTimout <0xBFFF0015>. I have buffers, in which I save the received signal datas from the sope. And after this buffer the mentioned error occurs.
How can I solve this problem?
2. And does someone now where I can get the query-List for all queries to the scope?
Like: "*idn?" = To receive the identity of the scope
"CURVE?\n" = The whole curve will be sent to my PC
"WFMOutpre:YMULT?\n "= To receive the Y multiple scale factor
... and so on..
3. My scope sends me only one byte, when I am using the query "DATA:ENCDG RIBINARY;WIDTH 1\n". When I change the width to 2, then I get two bytes per signalpoint, but the second is everytime zero. Why?
Are there any hints to solve my problems?
Greetings
12-09-2010 08:21 AM
Hey,
some additional information to your error:
VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
So maybe its a problem with your buffers (but I don't think so) but it looks like you have a problem with you VISA communication. Maybe your scope don't send in an appropriate time or the VISA Timeout is to low (maybe your set the parameter to short?)
2. Normally you can find such information on the manufacturer website in the user manual, take already a look there?
3. Is this an command from VISA or a command from your scope?
12-09-2010 09:15 AM
dennis, thank you for first that you are talking to me. You don´t know, how many forums I used to plot my questions. And no forum was able to answer me. It´s nice to know, that someone work or worked on the same cas e;-)) i am really happy now ;-)) althought my program does not function very well ;-))
1.) The timeout problem I solved now. I made a misstake, using a byte array at a point where no array is allowed, so automatically the timout eror occurs.
2.) I received right now the programmer manual, so I will read it.
3.) yes this is a visa command and causes the timout problem i have mentioned in 1.) .Two bytes should be send for one signal point, but only one is send and the second is empty. hmm.. I don´t know.
Sorry for my English. I would prefere German 😉
But here is a new question: My scope has 100000 sinal points, but I can receive only 16384 signal points. Do you know, how to expand the buffer for receiving data?
Thanks
12-09-2010 09:47 AM
Hey,
thanks for this compliment. I hope I can help you with your further questions anyway to make your program running.
To play around with the VISA buffer the command "viSetBuf" should be helpful. Maybe you can decrease the data points of your scope to send the data not in one big packet? Maybe you can set a parameter on your scope to build packets with a size somewhere around 15000 data points? If you search for VISA commands in the future take a look to the LabWindows/CVI online help. CVI is an option to use hardware from National Instruments products programming c++ instead of LabVIEW. There you can find a lot of information about commands. Or refer to your NI-VISA help instead, its installed with the NI-VISA driver on your PC and you can find it under "Programmes" -> "National Instruments" -> "VISA" -> "Documents".
"National Instruments LabWindows / CVI Online Help 2009"
02-14-2011 10:42 AM
Hi I have one moe question
I wrote a code in C using Visa.dll to communicate with my scope. But my target is, to control the scope via a microcontroller.
My
question ist: Is it possible to include the VISA.dll on
microcontroller? Or does an implementation exist for microcontrollers
to controll scopes?
Does exist some .c or .h files in C to implement in microcontroller?
Greetings and thanks...
02-16-2011 10:14 AM
Hi mnikoli,
unfortunately, there is no way to install or use NI-VISA on a microcontroller. Depending on the type of interface that you are using to communicate with your scope (serial port, GPIB, ethernet), you might find prefabricated libraries to send and receive raw or ASCII data. You will then need to disassemble the driver calls or look into your scope's manual to learn the necessary "language" commands that put your scope in a desired mode and request sampled data.
There are sample applications for communicating with a generic serial or ethernet device with a microcontroller in LabVIEW's Embedded Module (targeted for ARM boards), but that is commercial software, which you wanted to avoid in your first post.
Best regards,
Sebastian