Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

check GetTerminalNameWithDevPrefix

Hello Ian,

Thank you for the response. The while loop is necesarry because the number of times it iterates is for the number of devices "
while( i<=numDevices )". If you remove the while loop and have multiple devices, your code will work only once for one device. The corrected version of this will probably shipped with the next upgrade of the driver. Once again, thank you for the response.

Thank you,

Raajit L

Raajit L
National Instruments
0 Kudos
Message 11 of 15
(1,479 Views)
Hello Raajit,
 
You are only repeating information that I have already posted are this is becoming irritating.  Can you simply post the 'correct' version of that will appear in the next update and I will take things from there.
 
Ian
0 Kudos
Message 12 of 15
(1,477 Views)
Ian.

The correct output of the function should be "/DevX/<terminal name>" for a PCI or PXI board and "/<terminal name>" for a cDAQ chassis or SCXI system, which means that your code in reply 6 is correct.  As long as the output of your function matches the information in the first sentence you should be fine. So yes, your code is correct.

Raajit
Raajit L
National Instruments
0 Kudos
Message 13 of 15
(1,434 Views)
Jumping in here with a correction and clarification:

The GetTerminalNameWithDevPrefix function is a port of "Get Terminal Name with Device Prefix.vi" from LabVIEW\examples\DAQmx\_Utility\_Utility.llb, which looks like the attached image. The purpose of the while loop is to find the first device in the task that is neither a C Series module nor an SCXI module, and then output "/<device name>/<terminal name>" for that device (not "/<terminal name>").

An if-statement would cause it to always use the name of the first device in the task, which might be a C Series module or an SCXI module (neither of which would have the desired terminal, such as "ai/StartTrigger"). However, since the names of the devices in the task are sorted alphabetically, that would only happen if you are using CompactDAQ or SCXI and you are not using the default device names (since "cDAQ1" comes before "cDAQ1Mod1" and "Dev1" or "PXI1Slot4" comes before "SC1MD1").

In summary, the answer to your original question ("Should the last 3 lines be enclosed in brackets (i.e. {})?") is yes. The indentation reflects the intended behavior, but the lack of curly braces causes the code to work incorrectly. The while loop is necessary to skip past multiple C Series or SCXI modules.

Thank you for bringing this issue to our attention, and my apologies for the confusion.

Brad
---
Brad Keryan
NI R&D
Message 14 of 15
(1,420 Views)

Hello Brad,

Thanks for providing correct information. 

Best regards,


Ian

0 Kudos
Message 15 of 15
(1,411 Views)