LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New Daq with Daq Assistant in excisting code

Solved!
Go to solution

Hei,

 

I have a NI USB-6225 DaqMx device which I have used a couple of years. When I started with LabVIEW I found the Daq Assistant the easiest way to measure voltage etc. with my Daq. Now my company has bought another NI USB-6225 DaqMx device and I have a big problem: The Daq Assistant in my old Vi's does not work with the new Daq. I understand why there is this problem, but I don't know how to solve it. I found this code on the forum that finds out which Daq is connected:

Get Daq name.PNG 

 

The problem is that Daq Assistant does not have an input for this, and it gives me an error if I try to run the code with a different device than the original I used when I created the code.

Daq Assistant.PNG

 

Is there a way to solve this, so I don't have to convert all the Daq Assistants into regular code?

 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 1 of 9
(3,785 Views)

Hi Even,

 

1) Create a new DAQ assistent instead of reusing the old ones. This should work (as long as your DAQmx version is supporting your device).

 

2) You're a active participant in this forum with quite some knowledge on LabVIEW so far. You still do all your DAQmx duties using the DAQ assistent? Good advice: Get rid of that...

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,781 Views)

Hei GerdW,

 

1) Even if I create a new Daq Assistant, it will only accept the device which was connected when I created the Daq Assistant. If I switch devices I get an error saying the Daq Assistant couldn't find the device I used when I created it.

 

2) Thanks for the compliment:) Well I haven't used the Daq Assistant for over a year now and I feel comfortable with creating the Daq code without the assistant. It just annoys me that I have to rewrite the old programs. Actually I find it quite weird that the Daq Assistant does not have the option for a Device Name input. 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 3 of 9
(3,774 Views)

Hi Even,

 

to switch devices after the DAQ assistent was created you should use the same alias for the devices. As long as both old and new device provide the same specifications (regarding your DAQ assistent configuration) that should work...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,769 Views)

That could work:) Do I change it in MAX? I have tried to rename them, but MAX tells me that they can't have the same name:

MAX.PNG 

 

I tried to change them both to Dev1 and Dev2 with no success.

 

Can this be done with the .ini file or something to override MAX? 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 5 of 9
(3,763 Views)

Hi Even,

 

delete the missing old device. Then you can rename the new one to use the old device alias...

You cannot have two devices with the same alias!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,760 Views)

I can do that, but I would like to use both devices. Not at the same time of course.

 

To clerify a bit more:

 

My company produce PCB cards for different customers. I use LabVIEW and the DAQmx to test the PCB cards before we send them to the customer. LabVIEW have become more and more useful for testing purposes, so we decided to buy another one. The DAQmx devices are used different places and is moved quite often due to small batches of PCB cards. I would like to use a random DAQmx at a random test without any problems, since they are the same model. But now some of my old programs don't except the new device (Dev2) because the DAQ Assistant in my old programs are created when I only had one DAQmx Device (Dev1). I would like that the DAQ Assistant could accept both devices and not only Dev1.

 

In my newer programs I don't use the DAQ Assistant and therefor I don't have this problem. I can always rewrite the old programs, but I would like not to. 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 7 of 9
(3,751 Views)
Solution
Accepted by topic author EvenDeejay

Hi Even,

 

two options:

1) as the old software is bound to "Dev1" you have to rename your new device to that alias and skip/rename the old (and missing) device.

2) Rewrite your old software to become not dependent on the alias name of the DAQ card...

 

It's your choice!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(3,747 Views)

Hehe, well then I know what to do this week: Rewrite code!

 

Thanks for the help, GerdW 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 9 of 9
(3,741 Views)