LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ assistant in State Machine wont cycle digital voltage generation

Hi all,

 

Been working on this for a couple of days and i am kind of pulling my hair out at this stage. I am trying to generate a 24v digital voltage pulse to open and close a 3/2 solenoid valve. My hardware is a NI 9472 module in a single compact daq 9171 chasis and i am using labview 2016.

 

I have no problem using case structure, as expected the boolean sends true/false to a local variant of the data input on the DAQ assistant and i read 24v on my multi meter. This is all good until i try using a state machine to cycle through on and off with a set time delay it just seems to stick on or off depending on if i start with True or False. The annoying thing is the data indicator flashes as it should and when i probe the wire to the daq assistant it shows it changing from True to False.

 

I have tried a flat sequence but has the same results. Hoping its something simple that someone will be able to spot.

 

Thanks in advance!

 

 

 

 

0 Kudos
Message 1 of 5
(1,756 Views)

You have a race condition because of your use of local variables.

 

Your write to a local variable, but read from a control.  Which happens first?  It is a race, and which ever wins will determine what value gets sent to the DAQ Assistant.

 

Get rid of your control and wire from the constants directly to the DAQ Assistant.

0 Kudos
Message 2 of 5
(1,744 Views)

Hi thanks for the response.

 

I did think of this but have obviously done something wrong. When I tried to directly wire constants from within the loop to the DAQ assistant It didn’t let me for some reason.

 

I cant remember the message but will check tomorrow and report back.

0 Kudos
Message 3 of 5
(1,719 Views)

hi,

 

Got it working! Wired directly but what i failed to understand initially was that i needed to use shift register 🙂

 

thanks for yourhelp.

0 Kudos
Message 4 of 5
(1,687 Views)

No, that is not the solution.

 

The shift register you put in there doesn't doesn't do anything because you aren't ever using the value that comes out of the left hand side.

 

Also your outer while loop is pointless.

 

I gave you the answer in my message what you needed to fix, but you hacked together something completely different.  The only thing you did correctly was eliminate the local variables.

 

Here is the correct VI.

0 Kudos
Message 5 of 5
(1,679 Views)