01-19-2007 08:12 AM
01-22-2007 12:38 PM
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.
01-22-2007 01:12 PM
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
01-22-2007 04:06 PM
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.
01-23-2007 07:27 AM
01-23-2007 09:35 AM
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.