LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a pulse in a specified sampletime

Solved!
Go to solution

Hi.

 

We are making a LabVIEW program to communicate with PumpWorks through DDE, and have established communication.

The problem we can't find a solution to is this:

We want to start the pump (TRUE) and stop (FALSE) it in LabVIEW. PumpWorks can only recive the message one time, or else we get errors. How can we send a '1' - only one time when we press a button i LabVIEW, and send '0' one time when we press the button again.

 

We were thinking of a solution where we calculate the sampletime, and thereby only sends the message once - but we can't find a way to program it.

 

Does anyone have an idea on how to fix this? We need a pulse in just one sample when pressed start/stop. The rest of the time we shouldn't send anything.

 

Thanks for your help!

___________________________________
Is my avatar the dog from the fraggle rock?
0 Kudos
Message 1 of 7
(3,163 Views)

Look into using a event structure, on boolean value change, on the true case send the dde on and on false send the dde true

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(3,148 Views)

We were thinking the same thing, but the problem is to only send a '1' og '0' in one sample step.

The rest of the time we have to send a empty string (or nothing at all) - since '1' is start and '0' is stop. If we continue to send a '1' or '0' we get problems with the other program.

 

 

___________________________________
Is my avatar the dog from the fraggle rock?
0 Kudos
Message 3 of 7
(3,139 Views)
Solution
Accepted by topic author automasjon3ea

The event structure will execute only once per click on the button.  Put your send in this case. It will NOT continiously send a start or stop only when the user toggels a button.  I am assuming you have put your send in a loop and then inside a case structure therefore sending on each itteration.

It will send only once and not again until the front pannel button is togled again.  an even more elegant method is to put your io an a second loop and queue your commands from the event structure.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 4 of 7
(3,136 Views)

Thank you for your help! It worked 🙂

 

The VI is uploaded under here.

___________________________________
Is my avatar the dog from the fraggle rock?
0 Kudos
Message 5 of 7
(3,111 Views)

Glad it works.  By the way with the event structure, you do not need any wait in that loop.  The event structure uses no polling so no process time is consumed while waiting.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 7
(3,092 Views)

Okey, thank you again 🙂

The finished VI with the "pulse" is uploaded under here.

___________________________________
Is my avatar the dog from the fraggle rock?
0 Kudos
Message 7 of 7
(3,040 Views)