LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9265 to control 4-20 mA Mass flow controlller

Hello all,

 

Right now I am trying to create a control interface for a test stand using LabVIEW, the PID add-on, a cDAQ-9178, and a 9265 current output module. 

 

I have a main VI that has a loop with a few case and sequence structures based on what mode the interface is. My question is, if I use DAQ Assistant to tell the NI9265 to output a current of say 10 mA, will it continue to do so until I reupdate the channel? My issue is that I want to use PID to control my flow controllers, but I need it all wrapped up in loops and statements so I will only be updating the desired current output every second or so, but I want said current output to be continuous. I don't want to send a "pulse" of 10 mA current, I want it to continue to send 10 mA until I give it a new value to emit.

 

Sincerely,

 

Mitchell 

0 Kudos
Message 1 of 6
(3,455 Views)

Hi bieniekm,

 

tell the NI9265 to output a current of say 10 mA, will it continue to do so until I reupdate the channel?

Yes.

 

loop with a few case and sequence structures … I want to use PID to control my flow controllers, but I need it all wrapped up in loops and statements

Sounds like really bad software design…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,436 Views)
When you use a DAQmx Write, the output will remain until you use another DAQmx Write. This is something you can readily test. Are you seeing a different behavior? I would not use the assistant and I would not clear or stop the task until the VI is terminated.
Message 3 of 6
(3,433 Views)

GerdW,

 

I'm fairly new to LabVIEW, so I'm not sure what good software design would be. But breaking down my code, I've got a while loop that keeps my program continously running, with a case structure inside that differs between an "off" and "on" state, with each of those states having a sequence structure. Would this be bad form? Are you open to critiquing code?

 

 

Sincerely,

 

Mitchell

0 Kudos
Message 4 of 6
(3,422 Views)
A sequence structure is never a good design pattern. You should look at using a state machine.
0 Kudos
Message 5 of 6
(3,413 Views)

A few links

 

http://www.ni.com/white-paper/7595/en/

http://www.ni.com/white-paper/3024/en/

 

If you have questions feel free to ask.  Of course making a new thread might be best if the topic changes from a 4-20mA output device to software design.

0 Kudos
Message 6 of 6
(3,400 Views)