LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the maximum size allowed for a channel name in DAQMx?

What is the maximum size allowed for a channel name in DAQMx? Various function calls descrivbe the parameter as "const char channel[]" but I haven't found a limit that precludes buffer overflows and I'm in process of modifying a product database.
0 Kudos
Message 1 of 8
(4,174 Views)
Duncan,

The maximum number of characters is 256 (const char channel[256]).

Ames
Applications Engineering
National Instruments
0 Kudos
Message 2 of 8
(4,173 Views)
perhaps I'm confused in that MAX will let me create both channel names and device names with the following sting:

a234567890b234567890c234567890d234567890e234567890f234567890g234567890h234567890i234567890j234567890k234567890l234567890m234567890n234567890o234567890p234567890q234567890r234567890s234567890t234567890u234567890v234567890w234567890x234567890y234567890z23456789

Unless I've miscounted, this is 259 characters.
0 Kudos
Message 3 of 8
(4,173 Views)
As a further test, I changed a device name in max to the string below and ran the "Continuously Acquire Acceleration Samples - Internal Clock - Analog start which works fine with a default Physical channel name or a somewhat longer name like changing DEv to Device. If I use this 259 character device name, to which the channel menu also appends /aio, there is a run-time error which is not surprising if these name lengths are really supposed to be limited to 256 characters.
0 Kudos
Message 4 of 8
(4,173 Views)
Additionally, the 259 character device name seem to have also corrupted the data stored by MAX to the degree that I could not edit the name back to something shorter like the default. I solved this by uninstalling the board, rebooting, and then deleting the board in MAX and then rebooting and re-installing the board, after which MAX reverted to the default device name.

Considering switches and any other devices, what is the maximum number of characters that might be appended to a device name? It seems to me that the maximum device name needs to be limited to 256 less this length.

Less you think I'm being overly fussy, I have customers that will deliberately try to break whatever they can break for acceptance purposes and others who may have t
oo much time on their hands.
0 Kudos
Message 5 of 8
(4,173 Views)
Received from NI support:
"I have looked into this and it seems that you have discovered a bug. I am not sure what that the maximum number of characters that might be appended to a device name is, so I would limit your customer's device names to 64 characters. This will ensure that no errors occur and it should be plenty of space for a good device name.
0 Kudos
Message 6 of 8
(4,173 Views)

So, what is the maximum device name length?

and what is the maximum channel lenght, including the maximum device length?

-cpede

0 Kudos
Message 7 of 8
(4,085 Views)
Hello Cpede,
 
I tried the device name of 259 characters and it didn't give me an error. However when I clicked on something else, the last 20 characters were shown as"???". I would stick with the recommended 64 characters. Devices with really long names are hard to remember and most can be shortened to be more effective. Have a great day!
 
Sincerely,
Marni S.
0 Kudos
Message 8 of 8
(4,060 Views)