DPO4104 Oscilloscope - Saving .csv Multiple Times in C#
Posted: June 11th, 2018, 10:23 am
Hello,
I have been working on a program in C# (Visual Studio 2017) that can save a .csv file multiple times. This CSV needs to include x-axis data as well as data from Channel 1 and Channel 2. The current issue I am running into is that I am unable to run the program more than one without power cycling my Oscilloscope.
I run my code and, when it goes to save Channel 2, the response from the first query (in my case, YMULT) seems to be coming back incorrectly. My code crashes at the parsing of the response, saying "System.FormatException: 'Input string was not in a correct format.'" Upon looking into Response, it is an empty string. I am unsure why I cannot communicate with the Oscilloscope multiple times. Do I need to reset it in some way?
As a side note, the same thing happens after I save Channel 1, crash, and re-run the code. The second time through, it does not save channel one, crashing with the same error.
I have attached my Visual Studio Solution zipped in a .rar file. Please let me know if you have any advice for my code or if more information is needed!
EDIT: I have realized that, upon zipping and attaching my file, my first query says 'TVA.Write("DATA:SOU CH1, CH2");' This was a form of the code that I was testing, and not how I have been running it. It should just say 'TVA.Write("DATA:SOU CH1");'
Regards,
Jon
I have been working on a program in C# (Visual Studio 2017) that can save a .csv file multiple times. This CSV needs to include x-axis data as well as data from Channel 1 and Channel 2. The current issue I am running into is that I am unable to run the program more than one without power cycling my Oscilloscope.
I run my code and, when it goes to save Channel 2, the response from the first query (in my case, YMULT) seems to be coming back incorrectly. My code crashes at the parsing of the response, saying "System.FormatException: 'Input string was not in a correct format.'" Upon looking into Response, it is an empty string. I am unsure why I cannot communicate with the Oscilloscope multiple times. Do I need to reset it in some way?
As a side note, the same thing happens after I save Channel 1, crash, and re-run the code. The second time through, it does not save channel one, crashing with the same error.
I have attached my Visual Studio Solution zipped in a .rar file. Please let me know if you have any advice for my code or if more information is needed!
EDIT: I have realized that, upon zipping and attaching my file, my first query says 'TVA.Write("DATA:SOU CH1, CH2");' This was a form of the code that I was testing, and not how I have been running it. It should just say 'TVA.Write("DATA:SOU CH1");'
Regards,
Jon