From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a sequenced output for NI 9474

I'm fairly green to labview and could use much help as possible. I am trying to make a VI that control a solenoid for a valve endurance test. The test is going to bias a valve back and forth repeatedly. It'll bias the valve in sets of 250 cycles, wait 5 hours between each cycle, and wait 24 hours in between each set. Just to state it another way, let's say there's in total 1000 cycles. Once it starts it'll look like [bias>wait 5 hours>repeat all previous 250 times>wait 24 hours>repeat all previous 4 times]. I have an NI 9474 that should work with the solenoid I'll be using and need it to send out a signal that'll be in time with the set I just stated. I've tried using the DAQ Assistant, but (specifically with the NI 9474) it asks for 1-D digital waveform input data and I've been having a lot of difficultly trying to convert a timed signal to that data type. My main question is how do I send out a signal with the a NI 9474 DAQ card? And if you could help me make the code meet my timing sequence that would help me so much, I'm thinking of using a few while loops but I'm hoping there is a better way that I'm not aware of. I'm using LabVIEW 2012 and thank you for any help in advance.

0 Kudos
Message 1 of 4
(2,164 Views)

Hi Rob,

 

have you thought about using a state machine for those steps (=states) you want to repeat?

The state to wait for 5h or 24h can be the very same with just an additional parameter...

Best regards,
GerdW


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

I haven't, how would that work with the DAQ Assistant? Would it work within a while loop?

0 Kudos
Message 3 of 4
(2,143 Views)

I do most of my DAQmx advice in threads where I advocate for the use of hardware-timed DAQ.

 

Your case is exactly the opposite.  The first most important thing to do is *NOT* use hardware timing for your DAQ task.  Use on-demand mode instead so that you can write 1 value that the DAQ hardware will hold indefinitely until it's time to write a different value.

 

This will fit in very nicely with the state machine approach that was already suggested by GerdW.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(2,125 Views)