From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ivi Driver - LeCroy oscilloscope - Get "Physical name" from "Virtual name Mapping"

Solved!
Go to solution

I am working with the lcscope IVI driver to set the oscilloscope. Within the IVI High level commands I have the possibility to address the channel with the virtual name.

e.g.:

Result = lcscope_SetAttributeViReal64 (lcScopeHandle, "CHANNEL1", IVISCOPE_ATTR_INPUT_IMPEDANCE, imp);

 

But I need also the LL commands for setting the scope which sends the string directly to the VISA interface.

e.g:

Result = lcscope_WriteString (lcScopeHandle,"vbs 'app.Acquisition.Channels(\"C1\").VerScaleVariable=true'");

 

Now I have the problem that I need the physical name behind the virtual name. Instead of CHANNEL1 ==> C1. 

Is there any possibility to read out the mapping.

For instance:

char *GetPhysicalChannelName(„CHANNEL1“) with return string “C1”?

 

0 Kudos
Message 1 of 6
(5,233 Views)

Hello Keltis,

 

I will have to do some testing when I get a chance.

IVI is a standard that ALL IVI drivers for scopes must adhere to.

This is the basic functionality you are seeing in the NI driver and will be in ours as well.

After meeting the spec. we can then add functionality specific to our scopes. (Hence the write and read methods in our driver).

The virtual names are added manually in NI-MAX as far as I can tell.

Again, I will have to do some testing with the names etc. but here is an image from NI-MAX before I setup any virtual names.

There are the "Physical" names for the channels etc. in the driver and then I can edit the table for the Virtual ones in the Driver Session when I create and configure it:

Physical name table from drvier:

 Capture2.PNG

Virtual Name Table from Driver Session created by user: (Notice the Add button)

 Capture.PNG

I added C1 and C2 and gave them custom virtual names to show that this is something you configure before using the driver.

I will test to see if I can read these values programmatically when I get some time.

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

 

 

0 Kudos
Message 2 of 6
(5,212 Views)

Hello Keltis,

 

I will have to do some testing when I get a chance.

IVI is a standard that ALL IVI drivers for scopes must adhere to.

This is the basic functionality you are seeing in the NI driver and will be in ours as well.

After meeting the spec. we can then add functionality specific to our scopes. (Hence the write and read methods in our driver).

The virtual names are added manually in NI-MAX as far as I can tell.

Again, I will have to do some testing with the names etc. but here is an image from NI-MAX before I setup any virtual names.

There are the "Physical" names for the channels etc. in the driver and then I can edit the table for the Virtual ones in the Driver Session when I create and configure it:

Physical name table from drvier:

 Capture2.PNG

Virtual Name Table from Driver Session created by user: (Notice the Add button)

 Capture.PNG

I added C1 and C2 and gave them custom virtual names to show that this is something you configure before using the driver.

I will test to see if I can read these values programmatically when I get some time.

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

 

 

0 Kudos
Message 3 of 6
(5,212 Views)

Hello Leonard33,

I use the table as you suggested. But I want to use the channel mapping also for Low Level commands and so I would need access to the physical channel name table of MAX to can do that.
As I have understood you will test it and will come back.
Thank you for help.

Best regards

0 Kudos
Message 4 of 6
(5,154 Views)

Hello Keltis,

 

Sorry for the delay, been very busy around here.

 

I was able to query the C1, C2... from the scope using the "Get Channel Name" function.

 

The catch was that the indexing starts at "1" and not "0" like all of us programmers expect it to.

 

I also noticed on my scope remote log that the initialize function asked the scope to identify all of the channels by sending:  VBS? 'return = app.ExecsNameCx'

 

Then reading the response back.  The response from the scope was:  C1,C2,C3,*****

 

So you can use the "Get Channel Name" function, or you can use the write and read functions to ask for the list with the VBS? query.

 

Regards,

Leonard Brown
Applications Engineer
Teledyne LeCroy
1-800-553-2769

 

0 Kudos
Message 5 of 6
(5,124 Views)
Solution
Accepted by topic author Keltis

Hello Leonard33,

 

I investigated for this problem and found that I can use the IVIConfigServer API to read out  the mapping for virtual/physical name.

With this I realized the function to get the physical name (char *GetPhysicalChannelName(„MyChannel1“)).

 

I added the relevant code snippet as solution for my problem

....

    char physicalName[256];

    IviConfigStoreHandle csHandle = 0, iviScopeHandle = 0;
    IviVirtualNameCollectionHandle virtualNameCollection = 0;
    IviVirtualNameHandle virtualNameHandle = 0;
    
    Ivi_GetConfigStoreHandle (&csHandle);
    
    IviConfig_GetDriverSession(csHandle, IviScopeName, &iviScopeHandle) ;
    IviConfig_GetSessionVirtualNameCollection(iviScopeHandle, &virtualNameCollection );
    IviConfig_GetVirtualNameCount(virtualNameCollection, &count );
    IviConfig_GetVirtualNameItemByName(virtualNameCollection, in_virtualName, &virtualNameHandle );

    IviConfig_GetVirtualNamePropertyViString(virtualNameHandle, IVICONFIG_VAL_VIRTUAL_NAME_MAPTO, 256, physicalName);

....
   

Regards

0 Kudos
Message 6 of 6
(4,729 Views)