FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How to talk to a fieldpoint ethernet module from a .NET application

I have a fieldpoint ethernet module. I can configure and talk to it using the MAX. But I don't know how can I interface with it from a VS2005/C# .NET application. I am using FieldPoint5.0 and MAX version 4.0.
I did see some samples in CVI folder, which has extlib file FieldPoint.obj. I am assuming linking this .obj file to a C project would make it talk to the FieldPoint driver.
But is there a similar assembly or dll for .NET ?
 
I really appreciate your help.
 
thx,
-raj
0 Kudos
Message 1 of 10
(5,169 Views)
Hi raj v,

Here is an article on using .NET with Fieldpoint for your reference:

Can I Use Microsoft Visual C++ 6.0 and/or Visual C++ .NET with My FieldPoint Modules?

http://digital.ni.com/public.nsf/websearch/8F5FA4560356E3EC86256B9F005A2CC2?OpenDocument

I hope that this helps. Have a great day!

Best regards,

Steven
0 Kudos
Message 2 of 10
(5,153 Views)

Thank you Steven.

The FP API (CNiFieldPointNetworkModule ) has been absoleted in MStudio 7.1 or later.  See the link

http://digital.ni.com/public.nsf/websearch/EF9D2EC43BC132C986256EEE00771477?OpenDocument

Somewhere it is suggested that use DataSockets instead. But the artiacle also mentioned that you can use only ~26 sockets because of the memory limitation on the FP network module.

I pretty much understand how the CVI API works. But still didn't get how this DataSocket works. Do you have any sample code ?

More over if I have more than 26 IOs, what is the best method to use, CVI ? or Datasocket ?

thx,

raju

 

0 Kudos
Message 3 of 10
(5,151 Views)

Hi steven,

My h/w configuration is :  FP-1601 ethernet module is connected to 9 FP modules (AI-110, AI-210 and DI-401). The 1601 is connected to host PC. May be I didn't mention before, I don't have neither LAbwindows/CVI nor MeasurementStudio. I downloaded the evaluation copies of these. I need to find which tool is suitable to me. So that I can buy one.

I really appreciate your quick help.

 

thx,

raju

0 Kudos
Message 4 of 10
(5,150 Views)
Hi raj v,

Here is some information about Datasocket, this should clarify things:

Which Products Support DataSocket?

http://digital.ni.com/public.nsf/allkb/6E63180C1C348A7D862567240061AFC7

DataSocket Tutorial

http://zone.ni.com/devzone/cda/tut/p/id/3224

Have you considered using LabVIEW for your application? Would this be an option for you? You may discover that it is a much simpler approach.

Have a great day!

Best regards,

Steven
0 Kudos
Message 5 of 10
(5,136 Views)

Thanks again Steven. We have LabView 7.1, and we have prototype LabView applicaations running. But we need greater control to build an automation application.

raju

0 Kudos
Message 6 of 10
(5,134 Views)

Hi Steven,

I was able to talk to FieldPoint modules using the .NET DataSocket using the following url.

"opc://localhost/National Instruments.OPCFieldPoint/FP @ 192_168_1_9\\FP-AI-110 @1\\Channel 1"

I have around 9 FPs (AI/AO, DI/DO) connected to FP1601 ethernet module. So I have around ~70 IO points on all the modules. Can I create 70 DataSockets ? If not how do I read all of these IO points ? Is it possible to connect to one FP module and read all the channels at once ?

Appreciate any help

thx,

raj

0 Kudos
Message 7 of 10
(5,122 Views)
Hi raju, I believe that something similar is discussed in the following discussion forum post. Otis has posted some code that may help you read from several channels at once. http://forums.ni.com/ni/board/message?board.id=110&message.id=2967&requireLogin=False Please let me know if this was what you were looking for. I hope this helps. Best regards, Steven
0 Kudos
Message 8 of 10
(5,088 Views)

Hi Steven,

I believe the VB code still uses 16 DataSockets to get the all the 16 channel values. Somewhere in the message board I read that the "All" channel just returns the value of the first channel, instead of returning an array of values for all the channels. Moreover I am not a VB programmer. Any C# code would be great, if not C++ is ok.

The other question I have is the MAX studio's .iak file. I like to be able to read all the FP module names and channel names from my C# programme, so that there will be only one h/w configuration file. I understand the .iak file format is internal to NI and is not published. My questions are 1) is there any API to browse and get all the channel names and module names ? 2) if 1 is not possible, is there a way I can export the module and channel definitions to an XML file, so that my programme can read the channel definitions.

appreciate your quick response.

thx,

raj

0 Kudos
Message 9 of 10
(5,085 Views)
Hi raj,

I have been looking into this and it looks like there is no API to browse and get all the channel names and module names. Also, I am not aware of any way to export the module and channel definitions to an XML file.

In terms of the first part of the question, I am interested to see where you read that the "all" channel simple returns the value of the first channel. Please let me know if you could find this again as I would like to see the context. Thank you raj.

Best regards,

Steven

Message Edited by Steven C on 03-15-2007 09:48 PM

0 Kudos
Message 10 of 10
(5,054 Views)