Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This may not be a pure c# question but maybe someone also has a similar problem.

I use Lxi (http://www.lxistandard.org/About/LXI-Protocols.aspx) to communicate with for example Agilent power supplies, scopes etc...

There are several ways to do this, but the most easy way is to use SPCI (a "simple" commands protocol) and in my case using a TcpClient.

So I use a TcpClient and a NetworkStream on port 5025 I can do that with string commands (for example "*IDN?").
I can also request "binary" data (A big chunk of XML data) from the device, but sending it back seems not to work. (This is for example used with scopes as a settings string "learn string")

So if there are people who have experience with this and have made this already work it would be a great help for me.

Thanks.
Peter
Posted
Updated 8-Mar-15 22:43pm
v2
Comments
Richard MacCutchan 9-Mar-15 4:40am    
but sending it back seems not to work
Unless you can expand on that with proper technical details it is unlikely that anyone can help. We cannot guess what you are doing or whether it is correct or not.

1 solution

I had it working now. I posted my question a little to early. :-)

But anyway here it the solution :
It seemed that it is necessary to send a linefeed after the binary data that needs to be send. So the SPCI command would be in it's complete form :

[SPCI COMMAND][Space][BINARY HEADER][BINARY DATA][Linefeed]

An example would be :

:SYST:SET  #800083042<setup prod="InfiniiVision" ver="02.35.2013061800" srver="2.0"> ...mode data... 


The defined header size must be the length of the binary data excluded the Linefeed at the end.
(header info see : http://cp.literature.agilent.com/litweb/pdf/ads2001/vee6at/appxA10.html)

Convert the whole string then to a 8bit bytes array and send it.

I don't know if this will work for all Lxi devices but it did work for a DSO 3034A.
So what I learned is that basically you enclose the whole binary data block with header into a SPCI "string" command, that means including the linefeed at the end that indicates the end of the command.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900