Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx property node that lists PFI channels available?

Is there a DAQmx property node that lists the PFI channels that are available? We have several PCs that have different DAQ boards in them. I'd like to be able to determine if the available DAQ board will work a given test. One test uses a PFI line that isn't available on one of the DAQ boards. If I can query the device to see if that line isn't available then I can tell the user the test can't be run.
 
George
0 Kudos
Message 1 of 6
(3,952 Views)

Hi George,

If I understand correctly, you want to alter your test and number of PFI lines used depending on the DAQ card being used. If you are running a digital task, we have a property node that will list the number of digital lines used in a task. (DAQmx channel Property Node >> Digital Input >> Number of Lines).

 

I would suggest creating an enum (containing the names of the different DAQ cards), and run this into a case statement. Inside the case statement you can create tasks containing all lines for each card. After this, you can use the property node to check how many lines are being used.

A third option is running your code, and parsing the error code when it occurs. You can obtain a Boolean from the error code by running the error cluster into an ‘Unbundle by Name’. You can then take the Boolean, and run this into a case structure to decide if a line is already in use.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 6
(3,935 Views)

I don't want to alter the number of PFI lines I want to find out how many there are so I can then inform the user that the test can't be run with the available DAQ board if it's not suitable. The PFI line in particular I'm looking at is PFI12 (associated with CTR 0 out).  If you look at a VI like DAQmx Connect Terminals, the "source terninal" control is populated with all the lines available on the board. It seems I should be able to get the same info from somewhere. The types of DAQ cards used could be changing so I'd rather not build a fixed list of boards that are OK to use. I thought about using the error, but getting the available lines is much cleaner.

George

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

George,

 

If you would like to check if a certain PFI line is present, you can use the “DAQmx control task.vi” and choose “verify” for the action. Now check the error code to see if an error occurred. If so, than the line is not available. If not, the test can be performed.

Also, you can use a ‘DAQmx Device Property Node’ to view which outputs / lines are on the card. Choose Active Device for the top option, and Counter Output for the second line. (I/O Type >> Counter Output >> Physical Channels). This will populate and return an array of lines available for the card.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 4 of 6
(3,924 Views)
<If you would like to check if a certain PFI line is present, you can use the “DAQmx control task.vi” and choose “verify” for the action. Now check the error code to see if an error occurred. >
 
I need to feed the “DAQmx control task.vi” a task. I'm not sure what task I would give it. The DAQmx Create Channel VI doesn't let me select a PFI line.
 
 
<Also, you can use a ‘DAQmx Device Property Node’ to view which outputs / lines are on the card. Choose Active Device for the top option, and Counter Output for the second line. (I/O Type >> Counter Output >> Physical Channels). This will populate and return an array of lines available for the card.>
 
That tells me the lines like "Dev1/ctr0" and "Dev1/freqout" but it doesn't say anything about the PFI lines.
 
Surely there must be a way to populate an indicator with the available FPI lines like I mentioned in my previous post.
 
George
0 Kudos
Message 5 of 6
(3,915 Views)

George,

Unfortunately, we do not have a property node to do exactly what you would like. I believe this functionality would be a great tool, and encourage you to submit a product suggestion. I believe the case statement is the most reasonable work-around. The cards in each series are very similar, which will help reduce the number of cases you will need.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 6 of 6
(3,909 Views)