LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn a portion of code on and off

Solved!
Go to solution

Hi Folks,

 

I have created a VI that will read data from a detector and collate this information in a multicolumn listbox in a hexadecimal format (see attached VI). Now I would like to only collect this data once a "data collection" button is switch on. I have tried to mess around with event and case structures for this, but can't seem to figure this out. Any suggestions as to how I might accomplish this?

 

I am fairly new to LabVIEW so any suggestions on how to improve my program are also welcomed. Thank you!

0 Kudos
Message 1 of 5
(679 Views)

Hi Zifikis,

 

A simple case structure should be sufficient.

Could you save your code for LV2021 (On your VI, go to File -> Save for Previous Version -> 21.0).

When posting code to the forum, ensure it is not in a version superior to LV2021, as lots of users don't have higher versions installed (for various reasons).

 

Regards,

Raphaël.

Message 2 of 5
(662 Views)

Hi Raphaël,

 

Good to know. I have now attached the 21.0 version. 

 

Regards,

Zifikis

0 Kudos
Message 3 of 5
(642 Views)
Solution
Accepted by topic author Zifikis

Attached is an example where I put the building of the data array in the case structure.

I also disabled the VISA part and added random generation of data to allow anyone to test the VI.

 

I also recommend that you check the available VISA examples:

Go to Help -> Find Examples -> Search "visa serial" -> Open "Continuous Serial Write and Read.vi"

 

Regards,

Raphaël.

Message 4 of 5
(621 Views)

Your suggestion got the VI to work as intended. Thanks for taking a look at this.

0 Kudos
Message 5 of 5
(609 Views)