04-25-2017 02:40 AM
Hi,
I want to write a VI that use the *LRN? query for a Aglient InfiniiVision 7k Series Scope. With my infiniium scope this wasn't a problem. I simply stored the *LRN? return in a textfile and then used VisaWriteFromFile to load the settings at a later time. The Infiniium returns a string and all is fine. So the new InfiniiVision returns "binary block data in IEEE 488.2 # format". I tried to save the *LRN? return in a binary file but it doesn't work. Can anyone help me with this? Thank you
Solved! Go to Solution.
04-25-2017 02:57 AM
Hi Dust,
I tried to save the *LRN? return in a binary file but it doesn't work. Can anyone help me with this?
So there is "something" that "doesn't work". How can we help you on this "something"?
What does "not work"?
What is the error you get?
Where are you stuck?
Can you attach your VI with your try to save some data?
Can you create a string indicator with default data? Read the query result from your device into a string indicator, then right-click the string and "make current values default". Then save your VI and attach it!
04-25-2017 03:14 AM
Hi thanks for the reply. In the attached vi you can see what i tried. I also attached the data file with the saved data.
What is not working: When I want to send the data with the "load scope settings" button the scope returns a "invalid character" or a "invalid seperator" error. Maybe also the saving of the data is wrong done from me. Also the VISAWriteFromFile function says that it opens in binary mode so i thought this could be the solution. For the infiniium i used the same vi except that i use the WriteToTextFile function instead of the WriteToBinaryFile function. With the Infiniium it works fine because the *LRN? query returns a string.
Thanks for your help.
Greetings
04-25-2017 03:37 AM
Hi Dust,
you are sending the data back to your device without any additional command.
I guess the scope expects some kind of command before it accepts the data!
(It's the same with reading the data: first you send a command, then you can read the data…)
I'm sure you read the manual of the scope before. I'm also sure you will find the answer to your question in this manual! 😉
04-25-2017 03:45 AM
Hi Gerd,
Yes i read the manual before. The return data of the *LRN? Query includes a scope specific command before the binary block data.
From the manual:
"The *LRN? query result contains the current state of the instrument. This
query is similar to the :SYSTem:SETup? (see page 449) query, except that
it contains ":SYST:SET " before the binary block data. The query result is a
valid command that can be used to restore instrument settings at a later
time."
Greetings
04-25-2017 03:49 AM - edited 04-25-2017 03:50 AM
Hi Dust,
From the manual:…
This really helped to spot the problem! 🙂
When you look at your saved dataset you will recognize 4 leading bytes infront of the : SYSTEM: SET command! These 4 bytes are the size of the saved data - and are written by default when you use the WriteBinaryFile function. Just switch off those 4 bytes as is described in the help of this file function… 😄
04-25-2017 03:57 AM
Hi Gerd,
OMG shame on me. Thank you so much 😃 It works perfectly =). You are my hero of the day 😄
Thanks and have a nice day!