LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a command automatically sending

Hi everyone

    anyone can teach me how to make a command send aotomatically, for instance a dispense command base on a subvi, when click the dispense the command will dispense a designated time and wait some time, continue to dispense, anyone can teach me how to slove this problem?

0 Kudos
Message 1 of 26
(3,989 Views)

Hi lilight,

what have you done so far? Did you try it with a queue and a timeout or an event structure with a time out? For both solutions you should use a loop with a shift register to store the timeout value. What is it what you try to send. Is it something with hardware connected?

 

Mike

0 Kudos
Message 2 of 26
(3,972 Views)

yes the labview was connect with a dispense unit base on RS232 standard

0 Kudos
Message 3 of 26
(3,967 Views)

this is my control interface

the third case structure is the dispense command

0 Kudos
Message 4 of 26
(3,966 Views)

 just want once i click the dispense button, the dispense action can dispense and wait some seconds continue dispense without press the button

0 Kudos
Message 5 of 26
(3,952 Views)

this is the three subVI program

Download All
0 Kudos
Message 6 of 26
(3,932 Views)

double post but meaningfull

0 Kudos
Message 7 of 26
(3,926 Views)

The simplest solution is to simply change the mechanical action of the dispense button to "Switch When Released".

 

VI Comments:

  • You had been previously told in your earlier thread to simplify your code by encapsulating the communications code into one VI, and to simplify your array building. You seem to have ignored those suggestions.
  • You should not be initializing and closing the serial port EACH AND EVERY TIME YOU ITERATE THROUGH THE LOOP. Initialize once, do your communication, close at the end.
  • You have multiple "delay for read" controls, which are all confusing. Are these supposed to be fed to the subVIs? Are these supposed to act as timers? If they're timers, why are they called "delay for read"?
  • Why are you empty labels for the push buttons and then placing a label decoration to act as the button label? This makes no sense. A button has a label for a reason. Use it. If you don't want to have a long label then use a short label and use a caption to provide a long description. 

Attached is one way you can recode the VI. This assumes that the "delay for read" are intended for the subVIs.

0 Kudos
Message 8 of 26
(3,911 Views)

Hi smercurio

     My control interface VI can work appropriate with the instrument, you said i can simply change the dispense button to swith when released, but my aim is to when  do the dispense, wait a set time and then begin again until i've done the set number of dispenses.

0 Kudos
Message 9 of 26
(3,858 Views)

Then simply use a shift register for the loop to count the number of times you've dispensed. You can easily control your case structure from a Boolean combination of whether the button is on and the count is less than your max number of dispensations. Simple Boolean logic.

0 Kudos
Message 10 of 26
(3,844 Views)