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.
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.
02-18-2018 06:08 AM
I know I can use this way like (for example)
"/cardName/port2/line3" or
"/cardName/port2/line1:5" or
"/cardName/port2:port3"
But if I want to get the bits 4567 from port 2 and bits 012 from port 3?
Something like "/cardName/port2/line4:7/port3/line4:7"??
02-20-2018 10:38 AM
Hi there,
I think /cardName/port2/line4:7/port3/line0:2 shoud do the trick.
It is also an option to create a task with MAX and then use call it from your code, here is a reference.
02-21-2018 02:46 AM - edited 02-21-2018 02:47 AM
Thaks for your answer I try this like
You know what am I doing wrong?
task = new NationalInstruments.DAQmx.Task(); task.DIChannels.CreateChannel($"/CardName/port6/line0:7/port7/line0:2", "ch1", ChannelLineGrouping.OneChannelForAllLines); readerFirst = new DigitalSingleChannelReader(task.Stream); var xxxx = readerFirst.ReadSingleSampleMultiLine();
NationalInstruments.DAQmx.DaqException: 'Syntax for a range of objects in the input string is invalid. For ranges of objects, specify a number immediately before and after every colon (":") in the input string. Or, if a name is specified after the colon, it must be identical to the name specified immediately before the colon. Colons are not allowed within the names of the individual objects.
02-21-2018 08:01 AM
Hi there,
I think this error proved us wrong, this is an invalid way to declare the range of lines.
Have you tried creating a second channel, removing the "port7" section of this line code and adding it in another line?
02-21-2018 08:05 AM
Yes, that what I did .
02-21-2018 08:43 AM
Glad that worked! Then you could mark this one as resolved now!