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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert elements using DAQCard-6024E to USB-6221using LabVIEW 2009

Solved!
Go to solution

I just received an old project, the VI was mainly designed using DAQCard-6024E. Since we'd upgrade the equipment, and the DAQCard-6024E is no long used. However, they want to keep the similar front panel. I am trying to convert the pull-down menu that I can use with USB-6221 with Windows 7, but I don't know how. Can anyone help?

 

Windows 7, NI USB-6221,  LabVIEW 2009 sp1

0 Kudos
Message 1 of 10
(2,864 Views)

That program was written with the obsolete traditional DAQ driver and the 6221 can only be programmed with DAQmx. You should begin with Getting Started With DAQmx.

 

I don't see any reason for the pull-down to be modified. You can wire a pattern to a DAQmx Write just like it's being done in the old program.

0 Kudos
Message 2 of 10
(2,856 Views)

Hi smoothengine007,

 

You should be able to use this document's Digital Output section to see how to modify your VI:

 

Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW

 

It looks like the rest of your code can stay intact if you just replace your Traditional DAQ VIs with DAQmx VIs. 

 

Regards,

Message Edited by Dustin D on 02-23-2010 11:59 AM
Dustin D

0 Kudos
Message 3 of 10
(2,823 Views)
I did modify the VI. However, this error message (200587) kept coming up (attached with jpg). I don't know what I did wrong. Can anyone help?
Download All
0 Kudos
Message 4 of 10
(2,790 Views)

I'm stuck in the Dark Ages here and still using LV8.6, so I can't open your VI.

 

However, I can offer one suggestion and I hope it helps.  In MAX, under "Devices and Interfaces", you'll see all your devices listed.  (Your board will be under "DAQmx", but you probably already know that.)  Click on the USB-6221.  You will see a button that says "Reset Device".  Click on that.  Then try running your code again.


If you ever tried to run that board using the old traditional DAQ VIs, then it's necessary to reset the board before it'll run with the DAQmx VIs.  I've run into that before.

 

If that doesn't work, I'm happy to take a look at your code if you can repost it in 8.6.

 

d

0 Kudos
Message 5 of 10
(2,776 Views)

Hi DianeS,

 

I did try to "Reset Device". It still give me the same error. I repost the VI in 8.6. Could you take a look? I appreciate your help.

0 Kudos
Message 6 of 10
(2,772 Views)

I'm pretty sure I've fixed it.

 

When I tried to open your VI, LabVIEW asked me to find "Write to Digital Port".  That's a Traditional DAQ VI.  I don't have it.

 

So I ignored it and loaded the rest of the code, then asked LabVIEW to show me where the missing subVI was.  There it was, all by itself, at the top of the final frame of your sequence structure.  It didn't seem to be doing anything.  I think you left it in there by mistake.  I deleted it. 

.heres the problem.PNG

 

You'll probably have to reset your board again, since that was in there.  So do that and try again, and let me know how you do. 

 

Would you be adverse to some suggestions on general programming style?  Right now your VI is very difficult to read and there are some better approaches you could take.

 

d

 

 

0 Kudos
Message 7 of 10
(2,764 Views)

Hi DianeS,

 

Thank you for your help. I will try the VI and let you know.

 

As the previous post, this VI was handed down to me and I didn't write that code. I am new to LabVIEW and just trying to modify this old VI. If you can give me any wuggestions on general programming style, I would like to hear that. I appreciate your time for helping. Thanks.

0 Kudos
Message 8 of 10
(2,760 Views)
Solution
Accepted by topic author smoothengine007

Hi smoothenigne007,

 

After looking at your upgrade.  All of your write VI's should be using the same task.  There is no need to close this task until the end of the program.  Additionally you can remove all of the while loops as they are not allowing the task to close.  I did a highlight execution with your code and you can see that the first task has not cleared by the time the data reaches the second task.  When you try to create the second task the error is generated.  Since you are just doing multiple writes to the same port there is no need to open and close the task every time.  Here is a link that will explain a little more about how the DAQmx driver works.

 

Getting Started With DAQ

 

Regards,

Dustin D

0 Kudos
Message 9 of 10
(2,751 Views)

I don't have time to write a comprehensive reply right now, but here are some quick things:

 

1.  Any time I see sequence structures (and sequence structures within sequence structures), I immediately start thinking, "State Machine!!!"  LabVIEW ships with many excellent examples -- and this forum also contains a lot of terrific information.  So look at the state machine examples in LabVIEW, and do a search here on the forum.  They're very powerful and I think you'll like them a lot.

 

2.  LabVIEW also ships with a lot of really good DAQmx examples...have a look at those, too.

 

3.  The block diagram should be compact enough to fit on a single screen.  A proper architecture will allow this.  That goes back to point #1...  Smiley Happy

 

4.  The use of dataflow will allow code to execute in order.  So a lot of your sequence structures are totally unnecessary, even without using a state machine.  To develop your understanding of what dataflow is and how it works, I'd recommend the free online LabVIEW tutorials.

 

That's all I have time to type right now, but I'm happy to go into specifics when I have a bit more time.

0 Kudos
Message 10 of 10
(2,743 Views)