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.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Configure Mapping with txt file in LabVIEW

Solved!
Go to solution

Hi Everybody,

 

I would like to connect my I/O with labVIEW and my .txt file (like in VeriStand) but I don't find any block or VI to do that.

 

Is there a trick or something like that ? My txt file is about 300 lines ...

 

Thanks !

 

Nico

0 Kudos
Message 1 of 12
(5,062 Views)

If you are trying to add channel mappings to your system definition programmaitcally from a text file, you can do so using the VeriStand System Definition API.  You'll need to write some code to parse your text file and to use the API to add the channel mappings to your system definiton.

0 Kudos
Message 2 of 12
(5,052 Views)

Hi Nathan

 

Thanks for your answer. I never did some code with Labview. Is there an exemple or an existing code about the system mapping that I could use or work on ?

 

Thanks !

0 Kudos
Message 3 of 12
(5,033 Views)

You must have all the channels created in the SDF in order to have the mapping, otherwise it won't work.

Guilherme Correa
Message 4 of 12
(4,984 Views)

Hi again Guilherme !

 

Yes I work a bit on this subject since my last message. I am creating a VI for mapping my channel directly from the txt file (it is the main point for a project here ...)


The extract from the txt work well but I can't do the map ...

 

If you have some time, you can look my code on the zip file

 

 

 

PS : You are my hero today 🙂

0 Kudos
Message 5 of 12
(4,981 Views)

Connect the error out from the AddChannelList node to the error in of the Save node.

 

This will ensure that it will save your file after the channels were added.

Guilherme Correa
0 Kudos
Message 6 of 12
(4,979 Views)

Yes you are right, but even if I connect the error in and out together, LabVIEW doesn't give me an error even if the map don't work ...

 

As you can see, I put an indicator LED for been sure that the map process has been done, and the LED never turn to green ... and I have no idea why because my channel source/destination are good

 

 

mapp.png

0 Kudos
Message 7 of 12
(4,977 Views)

Can you share the SDF and TXT files?

Guilherme Correa
0 Kudos
Message 8 of 12
(4,974 Views)

Sure ! And thanks for your help !

 

 

 

0 Kudos
Message 9 of 12
(4,972 Views)
Solution
Accepted by topic author Nicopsa

This VI is correct.

 

Your problem is related to the names of the boards and models.

 

Once you correct this (in the SDF or TXT), it works fine.

 

Check the file attached. The LED only goes green when every channel is added to the SDF, if you have a single channel with the wrong name, it fails to map all other channels.

Guilherme Correa
Message 10 of 12
(4,963 Views)