From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to digital port from a table or file with USB6009

I have a lifetest fixture that needs to control three pumps and read pressure. I have connected the pumps through a circuit to the output of a USB-6009 DAQ. I am able to turn on the pumps using "Write to Digital Port.vi", but I would like the program to change the "data" that is written to the DAQ every two minutes. This way the DAQ will cycle the control signals to the pumps every 2 minutes. The data would need to cycle (1,2,4 then back to 1). Does anyone have an ideas on how I can go about this task. I could build a timer circuit, but I am using the DAQ to collect analog voltages and figured that It would be easy to have the DAQ also control the pumps. I would like to program to be automated, and run in a loop until the program is stopped. I am new to using Labview, so please be kind.

I am using: Labview 7.1
NI-DAQ mx Base 1.4
USB-6009 Multifunction DAQ
0 Kudos
Message 1 of 4
(2,785 Views)
Hello,

I made a program for you that I believe is what you need. I assumed that (1,2 and 4) is the data in decimal that you want to write continously to your digital port. I also placed a wait function that writes the new data every 120000ms (2 mins.)Take a look at it and let me know if this is what you wanted.

Regards,

LA
0 Kudos
Message 2 of 4
(2,765 Views)
LA75,

Thank you very much for the reply. Your program is exactly what I wanted to do. Could you explain how the loop works? I was thinking about using an array yesterday, but could not figure out how to count through the array and then loop back up to the top. If you have time to write me a brief explaination, it would be much appreciated. Thanks Again!!
0 Kudos
Message 3 of 4
(2,761 Views)
Hello,

I'm glad the program I sent you was of help. The way the program works is that you have a For Loop (that is set to run three times) inside a While loop (that will run continuously until a user stops the program.) So basically the For Loop will run if the While Loop is running. I also initialized a value in the For Loop with a numeric constant of zero, so every time the For Loop executes three times and starts off running again, a value of zero is written inside the For loop. I wired this numeric constant to the index number of the index array function, so that it can read the first element of the array every time the For Loop re-starts. I also used shift registers to store the data to be written to the index number of the index array function and added a one so that it can increment the index number count.

I know this explanation may seem confusing, but the best way to understand the program is really to run it on highlight execution and follow the flow of the program.

Please let me know if you have any more questions.

Regards,

Luis Navarro
National Instruments
0 Kudos
Message 4 of 4
(2,754 Views)