11-09-2020 11:06 AM
Hi,
I am trying to control a multimeter using the serial interface. I have it currently setup up using a visa write and read commands in a timeloop structure that is executed every second to log the data. Now I want to add a power button that sends a write command to the instrument to turn it on or off. But I am only able to do it once.
For example, if I run the VI and the power button is off, it will send a command to the instrument to turn it off. But when I press it again nothing happens. And the same thing happens if the power button set to on and I run the VI, it will send a command to the instrument to turn it on, but doesn't send an off command when the power button is pressed again.
Do I need to put this in a loop? But I am afraid that it is going to spam the instrument with constat power on or power off commands.
My goal is to run the VI then press the power button on the VI to start the instrument and data logging and then press power again to turn off the instrument. I might add a few more buttons in the future to adjust the scale and everything.
I am very new to this so any suggestions are appreciated.
Thank you
11-09-2020 11:09 AM
Hi mkadiyala,
@mkadiyala wrote:I am very new to this so any suggestions are appreciated.
Please attach your VI when there are problems with it!
11-09-2020 12:14 PM
@mkadiyala wrote:
Hi,
I am trying to control a multimeter using the serial interface. I have it currently setup up using a visa write and read commands in a timeloop structure that is executed every second to log the data. Now I want to add a power button that sends a write command to the instrument to turn it on or off. But I am only able to do it once.
For example, if I run the VI and the power button is off, it will send a command to the instrument to turn it off. But when I press it again nothing happens. And the same thing happens if the power button set to on and I run the VI, it will send a command to the instrument to turn it on, but doesn't send an off command when the power button is pressed again.Do I need to put this in a loop? But I am afraid that it is going to spam the instrument with constat power on or power off commands.
My goal is to run the VI then press the power button on the VI to start the instrument and data logging and then press power again to turn off the instrument. I might add a few more buttons in the future to adjust the scale and everything.
I am very new to this so any suggestions are appreciated.
Thank you
Since you didn't attach your vi the best I can tell you is that it's doing exactly what you programmed it to do. Yes, if you want a value to change during operation then it must be in the loop, but you should only send the updated value if it has changed. Have you done any of the LabVIEW tutorials?