LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best Practice for writing device independent DAQ code

I am looking for the best way to handle a situation...

 

I have LabVIEW code talking to a DAQ card that has been configured through MAX. Now I need to change the DAQ card for a different model. I could be using any one of three different models with the same code. What is the best way to setup the LabVIEW code and/or the MAX configuration to handle this situation.

 

I know this is all a bit vague, but it's hypothetical for now so I don't have model numbers, etc.

 

Thanks

0 Kudos
Message 1 of 5
(3,142 Views)

Hi TobyD,

you can use the DAQmx properties to list all available DAQ cards in your system and to find out which channels are available on them. With this info you can configure your channels.

 

Can you give more details. I think you need in any case a description of what channels you really need.

 

Hope it helps.

Mike

Message 2 of 5
(3,112 Views)

TobyD wrote:

I am looking for the best way to handle a situation...

 

I have LabVIEW code talking to a DAQ card that has been configured through MAX. Now I need to change the DAQ card for a different model. I could be using any one of three different models with the same code. What is the best way to setup the LabVIEW code and/or the MAX configuration to handle this situation.

 

I know this is all a bit vague, but it's hypothetical for now so I don't have model numbers, etc.

 

Thanks


 

CRELF mentioned on LAVA recently using the project to manage his hardware config.

 

I generally avoid using MAX to configure my hardware since maintaining the MAX config along side my app gets complicated. So i do all of my configuration explicitly in LV via code.

 

I am going be starting a new porject shortly where I will have to support multiples types of interfaces from serial through DAQ. My intention is to implement the hardware using LVOOP with child classes for each variation of hardware. Depending on the hardware config selected by the end user, I'll just let LVOOP handle all of the dirty work of using the right code for the config.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(3,102 Views)

TobyD,

 

After a couple of painfull experiences, I decided to avoid configuring any channels or tasks in MAX.  Seems that engineers are always changing their minds about how they want their products tested.  Smiley Mad  Recently did a tester that used .csv file to control how the tasks were configured, what I/O they used and any limits that needed to be applied to results of a task.  I had already created a cheat sheet in Excel that described the configuration for each task I was going to need and it seemed logical to use that to control the tasks in the vi.

Message 4 of 5
(3,094 Views)
Thanks for the suggestions. It sounds like avoiding MAX would save me time in the long run. I like the idea of using LVOOP, but I have to be honest, I'm a bit intimidated by it. I just purchased "The Object Oriented Thought Process" - I heard it was a good book - so perhaps that will help me understand OOP a bit better.
0 Kudos
Message 5 of 5
(3,058 Views)