02-03-2011 06:04 AM
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!
Solved! Go to Solution.
02-03-2011 08:06 AM
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
02-03-2011 08:32 AM
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.
02-03-2011 08:37 AM
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.
02-04-2011 03:37 AM
Thank you for your help! It worked 🙂
The VI is uploaded under here.
02-04-2011 07:44 AM
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.
02-07-2011 03:33 AM
Okey, thank you again 🙂
The finished VI with the "pulse" is uploaded under here.