08-29-2017 09:32 AM
Hi everyone,
I tried to get data from Vector Network Analyser MS2026C mit Labview 2017. I use USB or Ethernet to connect MS2026V with my Labtop.
I followed the example-code from Anritsu Manuel but there is always error 1073807339 by the first VISA Read, no matter what the connection is with USB or Ethernet, no matter how I tried the suggested solutions from older topics, such as with "VISA Property Node for Bytes At Port", with "Waiting function (before reading)" or with long timeout value between the second VISA Write and the first VISA Read, it doesn't work.
Here are the old topics that I found and tried.
http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0
I think baund rate is not the problem by me because I use USB or Ethernet to communicate with the Network analyser.
I am a student in Intership and just learn Labview for a few weeks. I really appreciate if someone have a look and tell me what I should do or try to fix this problem.
Thanks a lot.
Thuy Tran
08-29-2017 10:17 AM
It looks like the strings you are writing don't have any termination characters at the end of them. Should they? What does the manual say? If you turn those constants into \code display, and turn on the display format indicator, add either a \n or \r and see if they work.
08-30-2017 02:57 AM
Hi RavensFan,
1. turn those constants into \code Display -> done.
2. turn on the display format indicator, add either a \n or \r -> actually I don't really know what you mean.
It still doesn't work.
I attached hier the manuel for your reference.
Thanks!
Thuy
08-30-2017 08:30 AM
You added the \n while you were in normal mode. That means you added a literal backslash and "n". You need to enter \n while in \codes mode which enters the linefeed character. (It will not be visible if you go back to normal display mode.
Right click on the constant, Visible Items, Display Style. Now it is obvious on the block diagram that the constant is shown in \code display mode.
You did not attach a manual. You just attached a screenshot of the block diagram.
08-30-2017 11:17 AM
I don't have a MS2026C but I can make a few comments on your code.
1) Your command formatting for :TRACE:DATA? is wrong. You are concatenating the "Trace Number" AFTER the \n. That makes no sense. It should be BEFORE the termination character. Rather than using concatenation, read the help file for Format Into String function. I like using that function instead of concatenation.
2) You are reading a large block of data and it MAY include the termination character as part of the data. The flow should look like: DisableTermChar -> Read Data -> ReenableTermChar
3) Why are you type casting the whole byte stream into a single scalar value. I would think that you would be interested in the entire trace, and not just the FIRST value. Type cast into an array instead. Better yet, see next comment.
4) Rather than swapping words then swapping bytes to correct for endian-ness, it may be easier to use Unflatten from String.
5) Some instruments transmit an extra "\n" at the end of the block transfer. You MAY need to read the Y bytes followed by an extra 1 byte read to clear the buffer.