VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get system mapping using VeriStand 2010 .NET API

Hi,

 

I need use the System Definition API to get, add, clear and remove system mapping.

 

I had create a SDF with some models and mapped its I/Os.

 

I am able recover the information related to the targets and models but I could not recover the information about the system mapping.

 

I am including the snippet (and the existing mapping produced by System Explorer) to you check what I am doing wrong because SystemMapping.GetChilden is returning a empty array.

 

Cheers,

Cláudio H.

CHCastro
Download All
0 Kudos
Message 1 of 6
(6,860 Views)

Hi Claudio,

 

There is a Corrective Action Request for this issue (ID# 249798). I've attached the workaround VI that will allow you to do this.


Regards,

0 Kudos
Message 2 of 6
(6,799 Views)

Hi Mike,

 

With this VI I am able to discover the sources from a given destination.

 

But how can I get all mapping (source / destination pairs) and the destinations of a given source?

 

Cheers,

Cláudio H.

CHCastro
0 Kudos
Message 3 of 6
(6,739 Views)

Hi Claudio,

 

In use, you should only be checking channels that you care about. For my own interest, could you explain a little why you need to get all mappings (source/destination pairs)? The one use case I can think of would be for some sort of system explorer replacement or some utility where the user my want to visually see the mappings.

 

With regards to getting destinations of a given source, I don't think this will be possible. The source does not store any information about what its mapped to. The destinations keep track of what data source is mapped to it so that it can update its value from the current value table when mappings are processed. If you open the *.nivssdf file in a text editor, you'll see that only the destinations have any information stored about the mapping.

 

I've attached an example of how to get all the mapping pairs. You have to get all the channels in the system, get their paths, and then run the subVI I previously attached on the paths within a For loop. Then build an array of all the sources and destinations when "Channel Mapped" was true.

 

In the subVIs folder, there are two VIs of significance: "Get All Channel Mapping Pairs.vi" which should be called from the context of a custom device (will run very slow in offline mode), and "Get All Channel Mapping Pairs (Offline).vi" which should be called if doing everything in Offline mode (purely .NET API). The example, "Get Mappings Example (Offline).vi" is only written for the offline subVI.

 

Regards,

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

Hi Mike,

 

Let give to you the context of our project.

 

From model ICD (list of inports and outports) and a list of models find matchs of inports and outports by name and provide the mapping between them automatically.

 

The non-mapped inports and outports shall be connected to a LV application using VS API.

 

It shall be necessary to connect inports and outports to reflective memory locations too.

 

As we have multiple models,it can occur that one outport be connected to multiple inports (e.g. atmonphere pressure outport connected to engine, air probe and pack inport models).

 

To modify a previously created mapping I need to know the current mapping. This is a must for documentation of the connections since I always can delete the mapping and rebuild it.

 

I thunk that to get the mapping should not be a challange because there is a .NET call for it and the project explorer has a table with this information (System Explorer > System Mapping).

 

I will take a look in these VI and check if they solve my problem.

 

Thanks,

Cláudio H.

CHCastro
0 Kudos
Message 5 of 6
(6,721 Views)

The same but very fast !

 

Michael

0 Kudos
Message 6 of 6
(5,913 Views)