03-09-2012 08:58 AM
Hi,
since few days I am trying to resolve how to read data from spectrum analyser Agilent E4406A.
I was trying to read it in ASCII, but it takes about 7s to get an answer (via TCP).
I switch the device to send binary data. But when I cast it, I receive a table where some parts are resolved correctly, but major part is filled with trash data. I can run it several time, and I will always receive different number of good and trash data.
It seems like data from anayser is somehow wrong.
I read that viScanf function from Visa32.dll can resolve it somehow. I am trying to configure it and check wheather it can resolve this data. But probably I don't understand documentation. I attached what I did. (This analyser at the beginning should give welcome string but nothing is received even if I send a command.)
Maybe you could help me how to set these inputs.
Thanks in advance
Slawomir
03-09-2012 10:40 AM
I have no idea what you are trying to do. Why are you using the Call Library Function Node instead of the VISA functions on the palette? Why are you attempting to reinvent the wheel by writing your own driver? At the very least, you should at least look at the code in the driver and find the answer to your question. Sorry, but your code is so outside the norm that I don't what help you can here get if you continue. Perhaps you can post to a C/C++ board.
03-20-2012 07:07 AM - edited 03-20-2012 07:08 AM
What I want is to read correctly binary data from analyser.
I don't want to change the code to much (not mine, I want only to speed it up) and the code uses TCP communications instead of VISA.
Casting received binary data gives me only partially good result.
I attach the vi where I tried to resolve it. Values should be in range of (-110;0).
In a case structure I put what has been read from instrument. There you can find that only these ranges produce correct data: 0 - 34, 119 - 163, 190 - 209.
It seems like data from analyser is incorrect, but to be sure I wanted to use viScanf function as I found someone wrote that this can resolve binary data "automatically". But I have problems to configure it. That is why I ask for help.
Available driver uses VISA, so that means I would need to rebuild big part of the code and I would like to avoid it.