Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.
- Posts: 1
- Joined: August 26th, 2021, 8:49 am
- Country: Germany
I want to create text files with a C++ software on an AWG5208 harddisk via the LAN interface with a raw socket connection. Therefor I want to use the mmem:data command but I recognised that this does not work.
The text file I want to upload has a size of 15360 characters and the command my software generates is
directly followed by the file characters.
With "syst:err?" I get the error message: -161,"Invalid block data;Premature termination.
After some more tries I recognised that the command works as long as I send a single line but I get this error as soon as the data block contains a line feed (ASCII 10).
Has anyone an idea what I am doing wrong?
- Posts: 4
- Joined: September 16th, 2021, 5:16 am
- Country: Spain
I have experienced the exact same problem. And I believe i have found the problem (although not the solution). When using raw socket binary blocks of data cannot be transferred from or to your PC. The transaction finish prematurely when a zero is found. This problem occurs not only on your instrument but in others like MDO scopes as well. I believe it has something to do with Telnet server, because usually this one is listening on the same port configured for sockets, and Telnet does not like zeros on the data. Even if your protocol is NONE (i.e.not Terminal) and even if you change the default port. The effect is worse than expected because when this happens part of the data that was not sent on time is still waiting to be sent from the instrument to your pc and this will cause new problems when you try to connect again and send new commands. I dont know if this problem can be fixed, perhaps with a diferent configuration?
- Posts: 1
- Joined: September 21st, 2022, 11:21 pm
- Country: United States
In case anybody ever bashes their head against the wall like I did...
I found like the others that the socket server interface doesn't like newlines. Any 0xA bytes in the data block will terminate the message early.
The only way I found around it was to give up using the socket server entirely and use the VXI-11 interface.
- Tektronix Applications
- Posts: 811
- Joined: July 30th, 2008, 4:45 pm
- Country: United States
yes, raw socket messages are linefeed (byte 0x0a) terminated but the binary-block header ('#' character) signals an override for the number of bytes specified.
I've tested this on my AWG5208. I can read and write binary-block data without trouble. My socket server on the AWG is included with TekVISA v220.127.116.11. I have a copy of TekVISA v18.104.22.168 on my cloud storage: https://fortive.box.com/s/rty3eaug3gk7t ... r95yjcvoad
. This is the only recommended version on the AWG5200 and AWG70000A/B series instruments.
raw socket communication with instrument is tricky to begin with. you must end all messages with a linefeed AND you have to confirm receipt of the linefeed in the reply or keep reading. You then need separate methods for reading and writing binary data since the binary-block header overrides linefeed termination to accommodate the transfer of binary data.
you don't have to do any of this with VXI-11 because it is a higher-level protocol and verifies message delivery and message receipt automatically without the use of special characters.
Tektronix Application Engineer
Who is online
Users browsing this forum: No registered users and 1 guest