04-20-2010 02:14 AM
Hi everybody,
My question might be really simple, but it took me already days without real success...
I'm currently programming a LeCroy waverunner 104 Xi on CVI 8.5 via LAN. I'm trying to save a trace from a channel C 1...4 or internal memory M 1...4 to a previously specified file on the scope in *.xls or *.txt format. This already works with the STORE command on HDD ('STO C2, FILE'), but only on in a file I specified via keyboard on the scope / the save dialog. The STORE_SETUP command enables me to access all parameters (mode, data type...) of the "save waveform", except the save directory and the filename.
How can I set this up / which command must be used to specify the destination file. I'm missing something like the Hardcopy_Setup command, where I can just enter the target path and the name...
I'm really grateful for every answer!
04-21-2010 06:28 AM
Hi Michael,
welcome to our forums.
Could you please be a bit more specific as to what commands you are using. Are you using an example? Where can I find the commands you are referring to?
I downloaded the IVI driver for the scope but I haven't found any device specific functionality that would apply. Can you provide some code?
Thanks
Peter
04-21-2010 07:28 AM
Hi Peter,
thank you for your welcome and the answer!
You're right, I was a bit short with information, sorry. I installed the LeCroy LAB_WM827 VICP Passport for the connection. My communication runs on a LAN connection via this. The commands I am using are from the LeCroy Remote Control Manual Feb. 2005 (seems to be the actual / newest release). A simple example for connecting to the device is in the following:
#include <ansi_c.h>
#include <userint.h>
#include <visa.h>
#define MAX_CNT 200
ViSession defaultRM, instr; /* Communication channels */
ViStatus status; /* For checking errors */
ViUInt32 retCount; /* Return count from string I/O */
ViChar IOStringBuffer[MAX_CNT]; /* Buffer for string I/O */
//*********************************************************************
// Connection
//*********************************************************************
/////////////////////////////////////////////////////////////////////////
// Open LAN
/////////////////////////////////////////////////////////////////////////
int ConnectDevice (char IP_Adress[])
{
char IP_Buf[30];// Adress string
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS) {
return -1;
}
strcpy(IP_Buf, "VICP::");
strcat(IP_Buf, IP_Adress);
strcat(IP_Buf, "::INSTR\n");
status = viOpen(defaultRM, IP_Buf, VI_NULL, VI_NULL,&instr); // Open LAN
status = viSetAttribute(instr, VI_ATTR_TMO_VALUE, 5000); // Timeout 5s
// command: 'VICP::<IP_Adress::INSTR>'
return 0;
}
In the same way I want to save my data to the HDD of the scope. First I set up the store mode:
char storeSetup[50]={"STST C2, HDD, FILL, ASCII"};
//command: "STST <channel>, <destination>, <mode>, <type>"
status = viWrite(instr, storeSetup, strlen(storeSetup), &retCount);
if(status < VI_SUCCESS)
return -1;
Then I execute the the store command:
char store[30] = {"STO C2, FILE"};
//command: "STO <trace>, <destination>"
status = viWrite(instr, store, strlen(store), &retCount);if(status < VI_SUCCESS)
return -1;
Up to here, everything works. But my specific problem is that I found no command to specify the target file (like C:\Dateien\Messwert1.txt), where my data should be saved. Everything has to be set at the display of the scope and can't be specified in the software (at least not by me).Now I am looking for the command / code, how to implement the target file setup into my code, so I can ask the user for an input via the CVI frontend and send this string to the scope via "viWrite(...);".
I hope I was able to explain my problem.
Thanks in advance for any help!
04-22-2010 10:45 AM
Hi Michael,
this seems to be more a command set issue. I quickly browsed the manual but did not find any command for this. I would suggest to contact LeCroy for additional information!
You could also go a different way and use the IVI driver for your scope. This would require a rewrite of your software and it would probably go beyond a simple remote control application. But you could look into that for a more flexible solution.
Regards
Peter
04-22-2010 10:54 AM
Hi - Alan from LeCroy here... But no longer with LeCroy Tech Support! The scope automatically determines the filename so that it can increment the numerical portion of the filename. Please call or email your local LeCroy Applications Engineer for tech support. If you are in the USA, call 800-553-2769, or email technical.support@lecroy.com. Otherwise, please consult the LeCroy website for the correct phone number/email address. (http://www.lecroy.com/Support/Contact/)
Thanks, Alan
04-23-2010 02:16 AM
Hi Peter, Alan,
thank you very much for your answers and the effort! I think I will contact to my local (German) LeCroy support in addition. Maybe there is some way to change this automatical file nameing.
A whole change in the program to IVI would throw me days back, as I already wrote nearly the whole driver (except the saving ), but thank you for this idea.
Best Regards,
Michael
01-12-2011 02:24 AM
Hi Michael,
I automated Lecroy scope using LAN(LXI) protocol. The following commands worked for me.
VBS 'app.SaveRecall.Waveform.SaveTo = "File"'
VBS 'app.SaveRecall.Waveform.WaveformDir = "C:\data_folder"'
VBS 'app.SaveRecall.Waveform.TraceTitle = "voltage"'
This saves a file named concatenated string "Channel# & voltage & number" into the selected directory C:\data_folder.
Cheers,
~V~
01-12-2011 02:31 AM
Hi,
wow, thank you very much for this response ! My measuring unit is already running but I will try to implement your code and keep it in mind for further programming.
Best regards,
Michael
05-15-2015 12:34 PM
Hi,
I am new to using the remote commands with Lecroy scope here.
Do i need to have VBS library for using the VBS commands in Labwindows IDE.
Is there any way to link from ANSI C language to IVI drivers using VBS(Visual Basic Script) commands.
I was trying out sending these VBS commands.
CMD$=“VBS ‘app.Acquisition.C1.VerScale=0.05’"
CMD$ “C1:VDIV 50 MV”
But i got the error like "VBS definition not found" in the CVI 2013 compiler.
Is there any other way of Writing/Reading remote commands with scope using AnsiC language.
Please share your suggestions
Thanks,
Kiran
05-15-2015 12:51 PM
Hello Kiran,
The VBS command is an IEEE 488 command. The two commands you show: VBS 'app.Acquisition.C1.VerScale = 0.05' and C1:VDIV 5mV will do the same thing to the scope.
There is an heirarchy of objects for the scope that can be addressed directly when DCOM is setup or if you run scripts right no the scope OS.
To address these via remote control (IEE 488 and 488.2) you use the VBS command to tell the scope to interpret the argument between the single quotes as if it was directly done from a script on the scope.
I am not sure why the CVI complier is looking for VBS components, but the command looks correct.
i.e. if I was to write them from LabVIEW with the VISA write primitive, they would look like:
VBS 'app.Acquisition.C1.VerScale = 0.05'
Or
C1:VDIV 0.05
I do not send the units like this: 5mV in the commands just because I like to be consistent amongst test equipment (scope, dmm's, acquisition boards...) and find that all of them accept the value, but not all of them accept units.
Here is a link to an FAQ on the TeledyneLeCroy website that explains the differences and has links to the manuals etc. FAQ on Remote and Automation commands
The FAQ mentions an app. on the scope called the XStream Browser. Here is a link to a tutorial on using the browser: XStream Browser Tutorial
I hope this helps!
Regards,
Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769