LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controling Valve through a DAQ

Solved!
Go to solution

Hi wise NI LabVIEW people,

 

I am struggling with a valve-switching issue. I can directly control the valve with a switch as shown in the "Valve Control.JPG" but I want the valve to flip every time a new number is displayed at Current Dp(nm). In the "DMA Loop Trial Simple" file, I am sending a number via an array that is visible on Current Dp(nm). 

 

There is a more complicated original file "DMA Full 2017ver.zip" is also shared if you need any more details about the program. For this file, this is a subVi named "Pre.vi" which was responsible for all the functioning of the loop but I am unable to decode that.

For now, I want to send a different number and want the valve to either switch every time a new number passes from the system or I can manage a fixed time when the valve will switch and after the same time, it switches back. So suppose, the condition is true for one minute, the valve will remain open for one minute and then will turn off for one minute. Same goes on for different numbers coming the array.


I hope I could explain the issue. Please feel free to connect for more discussion. 

0 Kudos
Message 1 of 9
(667 Views)

Hi Harsh,

 


@HarshRaj18 wrote:

There is a more complicated original file "DMA Full 2017ver.zip" is also shared


Unfortunately you converted those VIs to LV2023.

You would get a broader audience when you would provide a downconverted version of those VIs! (File->Save for previous)

I prefer LV2019…

 

In your images there are a lot of "misunderstandings":

  • no autoindexing at loop tunnels
  • local variables with unused termiinals
  • opening and closing hardware references in each iteration

@HarshRaj18 wrote:

For now, I want to send a different number and want the valve to either switch every time a new number passes from the system or I can manage a fixed time when the valve will switch and after the same time, it switches back


Which "system passes new numbers"?

Which "fixed time" do you want to manage?

Right now you output a constant value to your hardware, so how do you want to switch back and forth?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(652 Views)

Thanks a lot for your reply. Here I again attach 2017 version files. Hope it helps.

Download All
0 Kudos
Message 3 of 9
(635 Views)

Hi GredW,

 

As you can see, a new number will be generated from the array, and the same number is displayed at "Current Dp(nm)". How can I control the valve boolean case structure so that it changes to true and false for every new number passing through "Current Dp(nm)". I hope it is more clear now. Please let me know if I am not clear. Looking for your kind support.


Kind regards,

Harsh

0 Kudos
Message 4 of 9
(602 Views)

Hi Harsh,

 


@HarshRaj18 wrote:

How can I control the valve boolean case structure so that it changes to true and false for every new number passing through "Current Dp(nm)".


You don't need a case structure…

 

  • There's a loop to autoindex all elements (aka "new numbers") of the array.
  • Inside the loop you switch your boolean output to TRUE, then you wait your delay time, then you switch to boolean output to FALSE.
  • Then you should wait a little more until the next iteration starts with the next "number"…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(582 Views)

Hi GredW,

 

Thank you for mentioning a solution. Could you please confirm which file you are referring to here? It would be so kind of you if you could help me by making these little changes in the Vi and send me the updated version from the end. I would highly appreciate your efforts. Thank you.

0 Kudos
Message 6 of 9
(557 Views)
Solution
Accepted by topic author HarshRaj18

Hi Harsh,

 


@HarshRaj18 wrote:

Thank you for mentioning a solution. Could you please confirm which file you are referring to here?


I'm referring to your "DMA Loop Trial Simple" VI.

 


@HarshRaj18 wrote:

It would be so kind of you if you could help me by making these little changes in the Vi and send me the updated version from the end.


Unfortunately I don't have the ULx functions installed and LabVIEW doesn't like to edit your VI with all those functions missing…

So I replaced all the ULx functions by DAQmx counterparts:

 


@HarshRaj18 wrote:

Hi GredW,


It seems you have problems spelling my nickname correctly…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 9
(550 Views)

Hi GerdW,

 

I am happy to update you that this solution helped and I could change the valve as needed. Thank you for pointing out that I was misspelling your name. I hope it is correct now. 

As I can see the delay time is in milliseconds so I tried to multiply it to convert it into minutes but that doesn't work. Any suggestion for wait time to use in minutes so that the valve switches in minute time not very quickly in seconds?

Thank you again for your kind support and efforts to give the solution. I appreciate your help.

 

Kind regards,

Harsh

0 Kudos
Message 8 of 9
(526 Views)

Hi Harsh,

 


@HarshRaj18 wrote:

Any suggestion for wait time to use in minutes so that the valve switches in minute time not very quickly in seconds?


Simple math: 1min = 60s = 60000ms

So using the Wait function you just need to provide the correct number of milliseconds to wait…

 

Warning: having a VI waiting for minutes will create a VERY bad UX.

(It's better to use a state machine, that waits until a certain timestamp has been reached…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(517 Views)