08-06-2020 08:37 AM - edited 08-06-2020 08:38 AM
I have 8 pumps in total and two controls for each of these pumps. One to control the speed and one to turn it on/off. If turn them off manually before the stop button is pressed, they all work as expected.
However, I wanted to control them programmatically so I used the history data node of all these control elements and wired them to false/0 and put them in a case structure as shown below.
Even though it writes these values to the controls, that signal is not being transmitted to the physical devices. When I restart the main VI, it sends these values to the pumps. Is there any other way to achieve this to make sure all the pumps are off before the main VI ends?
One more problem I have noticed when I start the main VI is that it momentarily turns on (at max rpm) all the pumps for a second or so and then turns them off. All the default values are set to zero and off but I don't know how this is happening.
08-06-2020 09:00 AM
@girish_jadhav wrote:
I have 8 pumps in total and two controls for each of these pumps. One to control the speed and one to turn it on/off. If turn them off manually before the stop button is pressed, they all work as expected.
However, I wanted to control them programmatically so I used the history data node of all these control elements and wired them to false/0 and put them in a case structure as shown below.
Even though it writes these values to the controls, that signal is not being transmitted to the physical devices. When I restart the main VI, it sends these values to the pumps. Is there any other way to achieve this to make sure all the pumps are off before the main VI ends?
One more problem I have noticed when I start the main VI is that it momentarily turns on (at max rpm) all the pumps for a second or so and then turns them off. All the default values are set to zero and off but I don't know how this is happening.
I have no idea how the picture in your post relates to the VI that you posted, so all I can really say is that the code is doing exactly what you told it to do, which isn't always what you wanted it to do.
I can think of any number of things that it could be, but it all depends on how that picture relates to the rest of the code you've shown. Could you zip up the entire project? It doesn't help that I have question marks for all of your subVIs.
08-06-2020 09:01 AM - edited 08-06-2020 09:07 AM
Hi jadhav,
setting the history of some charts will not turn off any pumps.
Using lots of "value" property nodes (which are just the same as local variables will also not turn off any pumps.
Why is the code shown in the image not found in tha attached VI?
Why do all property nodes miss their labels?
Why is there so much replicated code (like the same scaling used everywhere) in your VI? Why do you need sequence structures? Why do you need local variables?
You should NEVER need to convert DBL values to boolean arrays…
On this "duplicated code":

08-06-2020 09:24 AM - edited 08-06-2020 09:29 AM
@GerdW wrote:
Hi jadhav,
setting the history of some charts will not turn off any pumps.
Using lots of "value" property nodes (which are just the same as local variables will also not turn off any pumps.
Why is the code shown in the image not found in tha attached VI?
Why do all property nodes miss their labels?
This is the main while loop which I thought would not be necessary to post, so I added the screenshot of just the relevant part. I don't display the property node labels just for convenience's sake when I have to move them around and later display them.
If not using local variables, then how can I do it?
Why is there so much replicated code (like the same scaling used everywhere) in your VI? Why do you need sequence structures? Why do you need local variables?
You should NEVER need to convert DBL values to boolean arrays…
You are right. I should have created a subVI for scaling.
I am using sequential structure because earlier when I wanted to connect the same VI input reference to the Analog Output/Digital Output blocks, I had trouble controlling the pumps (in the below case it was magnetic valves).
(related thread: https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Cannot-control-magnetic-valves-and-motor-usi...)
I have converted the value to an 8-bit boolean array because that is what the Digital Output block accepts. Is it a wrong way to do it? I have measured the values across DAC blocks on the panel using multimeter and values seem to correspond to the values we send from LabVIEW.