Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication

I have been trying to modify your 'Basic Serial Write and Read.vi' to write out various commands when I click on the appropriate button. I am using the commands to focus a lens which permits me to use large increments forward and backward and fine increments forward and backward. I would like to use 4 buttons for this. I have managed to add some case structures to your example and the appropriate buttons. My problem is that I have to click on another numeric window with numbers 1-4 to choose which button I plan to click on. Is there a way to click on one of the buttons, and have that action send the appropriate number to the case structure?

I would appreciate any help. Thanks.

Brent

bbean@optimetrics.org

0 Kudos
Message 1 of 2
(2,888 Views)
The easiest way is to use the event structure with a value change event for each Boolean. Have the mechanical action set to one of the latch options. To use a case statement, on the diagram use the build array function on the 4 Booleans and a Search 1D Array to find which element is true.
0 Kudos
Message 2 of 2
(2,884 Views)