Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-4551/ 4552 DSA Board example code

Does anyone have any .NET example code for the  4551 / 4552    DSA boards?

Thanks.
Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 1 of 10
(4,046 Views)
Hi Philip,

I just searched around a bit more, and we don't have any .NET examples for these boards here.  All we have is the VB6 example that I sent you earlier.

Sorry,
berto

Mike Roberto
NI Applications Engineering
0 Kudos
Message 2 of 10
(4,033 Views)
Can we communicate with this board in any way with any .NET code?

Or should I give up and go with VB 6?

At this point, I don't need example code from NI.

I just need someone to tell me whether or not it's possible to use .NET to access this board.

Thanks.



Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 3 of 10
(4,031 Views)
Hi Philip,

This is possible to get working in Visual Studio .NET.  The example provided below that you've seen is for Visual Basic 6.0:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4FD6C65B6166433E034080020E74861&p_node=DZ52258&p_source=External

Although this works in Visual Basic 6.0, I do know that Visual Studio .NET does have a converter that will take this project and make it into a .NET project.  Although this is not officially supported, it normally works with minimal code changes, and you should be able to get it working.  If you really must use .NET, check out the conversion, see what lines of code need to be changed, and go from there.

Thanks for your patience,
mike
0 Kudos
Message 4 of 10
(4,023 Views)
Will the DSA driver statements/functions be available in the .NET environment?

For example, the VB 6.0 DSA function, --> NIDSA_read_measurement(......

can this function somehow be accessed in VS2003(MS8.0 Enterprise) ?

Thanks.
Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 5 of 10
(4,021 Views)
After a lot of reading, I can add some focus to my question.

The 4552 DSA board can operate in one of two modes:

1. Instrument Driver Mode. (the function example i gave in previous reply..)
2. NI-DAQ compatible mode. (the code example hyperlink {Berto's} in previous reply..)


Can I make either of these modes work in the .NET environment?


I suspect the NI-DAQ mode may be possible in .NET.


Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 6 of 10
(4,021 Views)
Hi Philip,

The answer is pretty much going to be the same here:  If you can open up the examples (which are in C:\Program Files\National Instruments\NI-DSA\examples\Visual Basic), get them into Visual Studio .NET and convert them, it should work.

Again, it's not officially supported, and we don't have any wrappers written to do this for you, so you'll have to hope for Visual Studio to work its magic and go from there.  It's the same process as with the Traditional VB stuff, except even fewer people are probably doing this.

If it works, then those libraries used in the example should be included in the VS .NET project, and the rest of the functions should work as well.  Getting it converted and included is the trick.

Regards,
mike
0 Kudos
Message 7 of 10
(4,005 Views)

  • Traditional NI-DAQ in VB.NET (for boards not supported by DAQmx)
    • National Instruments does not include native .NET components for Traditional NI-DAQ.

    • Use the Traditional NI-DAQ ActiveX control CWDAQ to create NI-DAQ applications. This is provided as a part of the Traditional NI-DAQ installer and does not require Measurement Studio.
    • To use the CWDAQ ActiveX control from Visual Basic .NET, you can create a new Visual Basic .NET project and add the CWDAQ ActiveX Controls to a .NET project using the following steps:


      1. With the .NET project open, select View >> Toolbox. The toolbox will appear.

      2. Right-click the toolbox and select Add/Remove Items. The Customize Toolbox will appear.

      3. Select the COM Components tab.

      4. On this tab, you can select the specific CWDAQ control you wish to use, and click OK.

      5. The control you selected will now show up in the toolbox, where you can select it and drop it onto the form, the same as if you were in Visual Basic 6.0.




    This covers the NI-DAQ compatible mode of DSA operation.

    Now, what about the instrument driver mode?
    Could I use the instrument driver wizard to generate .NET commands to control the DSA board? or just bench-top instruments?

    The instrument driver would offer better performance and more features when compared to the activeX niDaq ?

    Philip Newman
    General Dynamics
    Electric Boat
    0 Kudos
    Message 8 of 10
    (3,999 Views)
    Philip,

    I just spent a bunch of time with the software team, and they concluded that you cannot use instrument driver mode with this.

    If you want to use .NET, you'll have to stick with DAQ.  If you want to use the onboard processing with NI-DSA, you'll be best off with Visual Basic 6.  The instrument driver wizard won't do any good in this situation.

    Regards,
    mike
    Message 9 of 10
    (3,987 Views)
    thanks dude

    that helps

    cheers
    Philip Newman
    General Dynamics
    Electric Boat
    0 Kudos
    Message 10 of 10
    (3,983 Views)