LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx question

Hi,
I'm using NI-PCI6520 I/O card on myPC and DQAmx Read.vi in my program to read external input(s) (Digital Bool 1Line 1Point). When I moved my program to another PC which also has same I/O card pre-installed, all my defined channels that goes to "task/channels in" do not exits anymore and I have to redefined again. How can I prevent this ?
Thanks
dphan128  
 
0 Kudos
Message 1 of 7
(3,514 Views)
You probably need to export your MAX configuration to file and then import it on the other PC.
Message 2 of 7
(3,509 Views)

Hi dphan128,

Bill has a good suggestion about possibly exporting your tasks, but I would also suggest simply checking the device name in Measurement and Automation Explorer (MAX). You can rename a card by opening MAX >> Devices and Interfaces >> NI-DAQmx Devices >> right-clicking on the card, and selecting ‘Rename’.

If you would like, you can export the task and the card, and then the naming convention will be included with the exported data. You can import and export tasks and settings by opening MAX >> File >> ‘Import’ or ‘Export’.

If the problem still persists, I would like to ask that you post a screenshot of the error and MAX configuration, along with any other details that you find may be useful.

Regards,

David L.
Systems Engineering
National Instruments
Message 3 of 7
(3,468 Views)

Thank you all for your advices.

If I were to generate code for my tasks/channels this way:

You can generate code for a task or global channel from a DAQmx task name control or DAQmx global channel control, respectively. Complete the following steps to generate code.

  1. Place a DAQmx task name control or DAQmx global channel control on the front panel.
  2. Select the task or channel for which you want to generate code.
  3. Right-click the control and select Generate Code from the shortcut menu. Select one of the following code generation options.
    • Example—Generate all the code necessary to run the task or channel, such as VIs needed to read or write samples, VIs to start and stop the task, loops, and graphs. Select this option if the task or channel is specific to your system, and you do not use the task or channel on other systems.
    • Configuration—Generate the code associated with the configuration. LabVIEW replaces the I/O constant or control with a subVI that contains VIs and Property Nodes used for channel creation and configuration, timing configuration, and triggering configuration used in the task or channel. Select this option if you need a portable configuration that you can move to another system.

Would it solve my problem as well ?

dphan128

 

 

0 Kudos
Message 4 of 7
(3,461 Views)

Doing this would not solve your problem, as it creates constants for the physical channels being assigned to the DAQmx Create Channel. If your card did not have the same name in computer 2, as it did in the development computer, than you would still run into a resource error.

It sounds like you currently either have a task setup in MAX or are using a channel constant to assign what channels will be used in your task. If exporting setting from MAX or manually configuring your card and tasks are not an option and you would like maximum flexibility, I would suggest creating a channel control, therefore giving the user permission to choose the channels. This control is auto-populating, therefore forcing the user to conform to the correct syntax. If you would like the control to keep the same channels each time, you can set this control to have ‘default values’ (Assign the channels you would like >> Right click on control >> Data Operations >> Make current value default. Now save the VI).


Regards,

David L.
Systems Engineering
National Instruments
Message 5 of 7
(3,434 Views)

Dear David L.,

Thanks for your help. So far I have learned of many options for solving my problem. I would need to try out all options before going further.  And then may be contact the local NI rep in my area for assistance if more help is needed.

Once again, thank you. This forum really helped me a lot!

Regards,

dphan128 

0 Kudos
Message 6 of 7
(3,424 Views)
Glad you found the forum helpful. Our goal is to make our customers successful! Have a great week.
David L.
Systems Engineering
National Instruments
0 Kudos
Message 7 of 7
(3,416 Views)