LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview interfacing with NI cDAQ-9172

I currently have access to a NI cDAQ-9172 with a NI-9205 AI input
board and a NI-9481 relay control board. I basically have the DAQ
Assist tools for the analog inputs and the relay outputs, however, I'm
having trouble interfacing them together, such as if the two analog
outputs are above x Volts, turn on the relay control; otherwise, turn
it off. Do I need to create a task for a specific DAQ Assist tool in
order to control the behaviour of the relay outputs based on the
analog inputs?

0 Kudos
Message 1 of 7
(5,351 Views)
I'm sorry if I had been too vague on the last message. Basically, I'm having difficulties selecting appropriate data types. I want to compare the analog inputs to a specific analog voltage without having that constant using up a physical channel. My intention on the output of the AND gate is to output to a physical relay output (however, I can't change the farthest right i/o icon to an output b/c I don't have the DAQ board plugged to my computer right now).

Also, I would like to know a bit more description on how to program sequential routines or could a few outputs/routines be simultaneous?
0 Kudos
Message 2 of 7
(5,335 Views)
On Sep 11, 5:29 pm, ssylee <staniga...@gmail.com> wrote:
> I currently have access to a NI cDAQ-9172 with a NI-9205 AI input
> board and a NI-9481 relay control board. I basically have the DAQ
> Assist tools for the analog inputs and the relay outputs, however, I'm
> having trouble interfacing them together, such as if the two analog
> outputs are above x Volts, turn on the relay control; otherwise, turn
> it off. Do I need to create a task for a specific DAQ Assist tool in
> order to control the behaviour of the relay outputs based on the
> analog inputs?

The latest update of this problem is in
http://forums.ni.com/ni/board/message?board.id=170&message.id=271073&jump=true#M271073.

0 Kudos
Message 3 of 7
(5,335 Views)
Hello ssylee,

You are trying to read the value of your signal directly from the NI-DAQmx Task. The NI-DAQmx Task is not the value itself, but represents the measurement or generation you want to perform, including timing, triggering, and other properties. You can read more about this in the section called "Tasks in NI-DAQmx" in the NI-DAQmx Help (Start>>All Programs>>National Instruments>>NI-DAQ). The NI-DAQmx Help has a great deal of useful information and is a great resource. In addition, we have a helpful series of articles online which should help you get started in NI-DAQmx here.

Specifically, I would recommend that you examine the tutorial here which explains how you can use the NI-DAQmx Express VIs. To get you started, I have written a brief example program which is shown in the image below and attached to this post.


Message Edited by Matt A on 09-13-2007 07:51 PM


Matt Anderson

Hardware Services Marketing Manager
National Instruments
Download All
0 Kudos
Message 4 of 7
(5,295 Views)
Hi Matt,

Thanks for providing me a start into Labview. After reading some materials that you've suggested in your reply, I have more questions to ask you.

1. Are all the LabVIEW programs developed as a finite state diagram like on a hardware digital logic circuit?
2. I'm aware that there are two ways of working with inputs and outputs, either using DAQ Assistant or using DAQmx tools. For the DAQmx tools, do I have to manually insert numeric indicators/dials, rings, etc. or is there a way of configuring the different options in the DAQmx functions (for example, AI Temp TC) by opening its front panel?

Would be fantastic if those two questions get cleared up.

Thanks,

Stanley
0 Kudos
Message 5 of 7
(5,256 Views)
I have actually more updates on exactly what I would like to do. I would like to have the compact DAQ do two things simultaneously. One would be logging data at a rate controlled by the stage of the filling and emptying cycles (first 4 and last 4 stage levels respectively on the flowchart). The other task would be controlling the relay output according to the state of the inputs and where the current stage on the flowchart. I have only gone through the Labview getting started tutorial pdf. I'm not sure how to use Labview to interface with niDAQ in a sequential process that loops basically until the user tells it to stop (by closing the program or by pressing stop button). Does anyone know where should I start looking?
0 Kudos
Message 6 of 7
(5,205 Views)
Hello Stanley,

Let me try to address your questions in order:

1. LabVIEW gives you the ability to program several design patterns including Finite State Machine, Master/Slave and Producer Consumer. LabVIEW even provides templates for these design patterns, which you can create by going to the File menu and selecting New.... The image below shows where you can select from the different design pattern templates.



For more information about the state machine design pattern specifically, I would recommend that you examine this tutorial.

2. I believe the "DAQmx Tools" you referred to are the DAQmx sub-VIs in the DAQmx sub-palette. You must use the inputs (controls) and outputs (indicators) to configure these VIs, there is no pop-up menu like there is for the DAQ Assistant. However, you are able to generate the sub-VIs from a configured DAQ assistant using the right-click menu, as shown in the diagram below. This would allow you to configure your NI-DAQmx operation with the pop-up window, and then optimize performance using the DAQmx sub-VIs.



3. Based on the description of your application, I would strongly suggest that you consider either the state machine template discussed above or the NI LabVIEW Statechart Module. This module is designed to give you a higher level of abstraction for complex systems. Since you already have a flow chart, it seems that it would be pretty easy to convert that to a statechart to programmatically implement it. You can see a video here on how to implement state machines in the LabVIEW Statechart Module.

If you have questions about how to architect your program specifically, I would recommend that you post to a new forum. You are more likely to get better insight and more relevant information on that topic if you post a new question that reflects the appropriate topic.

Message Edited by Matt A on 09-17-2007 07:37 PM


Matt Anderson

Hardware Services Marketing Manager
National Instruments
Download All
0 Kudos
Message 7 of 7
(5,170 Views)