FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

DownloadDomain method in VFD Class (c#.net)

Hi,

 

I am developing an application in c# .net for downloading some data in to the FF device. I am using the  DownloadDomain() method for downloading the data. The .net libraries support the DownloadDomain() method in VFD class and cannot be used in MIB class. As per specifications, MIB also should be a VFD but .net libraries are not recognizing MIB as a seperate VFD, instead it is considering MIB as a separate class. Please help me on this.

 

Regards,

Sundar

0 Kudos
Message 1 of 14
(9,922 Views)

Hi Sundar,

 

Could you please try the following?

 

curVFD = curDevice.GetVfdByOrdinalNumber(0);  // to open the default VFD to get the block information
curVFD = curDevice.GetVfdByTag("MIB");// to open the MIB VFD.

 

Thanks.

Chris

0 Kudos
Message 2 of 14
(9,919 Views)

Hi Chris, The first method GetVfdByOrdinalNumber(0) works with 0 as the ordinal and returns the default VFD but the second method GetVfdByTag("MIB") returns an exception stating the VFD could not be found. Regards, Sundar

0 Kudos
Message 3 of 14
(9,913 Views)

Hi Sundar,

 

Oh yes, I have done some tests with the C#.net example. You are right, we did give a Mib class for this usage. Would you please refer to the source code piece to get what you want?

 

**********-----------------------*******************

// ...

Device curDevice;

curDevice.Open();// open device.

 

curDevice.Mib.Open();// open the Mib

Parameter curParam = curDevice.Mib.ReadParameterByName("T1");// read parameter "T1"

SimpleVarParameter svp = curParam as SimpleVarParameter;// since T1 is a Simple Var Parameter.

// More Parameter Type please refer to readData_Click(object sender, System.EventArgs e) in ReadWrite.cs

 

MessageStatus.Text += (" " + svp.Element.ValueString());// output the value string to MessageStatus

// ...

**********-----------------------*******************

 

Please give a try and let me know if it works.

Thanks.

Chris

0 Kudos
Message 4 of 14
(9,901 Views)

More details, you could also refer to the help file for .Net Library:

C:\Program Files\National Instruments\NI-FBUS\MS .NET\doc\NIFBusCM.HxS

0 Kudos
Message 5 of 14
(9,898 Views)

Hi Chris,

 

Thanks for the reply.

I am able to read the parameters from the MIB class but my requirement is to download data into the device. For this, i need to use the DownloadDomain() method. This method is in the VFD class. I am not able to access this method from MIB class. For my operation, i need to download data in MIB vfd.

 

Is there any way i can call the downloaddomain() method from the MIB.

 

Regards,

Sundar

0 Kudos
Message 6 of 14
(9,891 Views)

Hi Sundar,

 

It might sound weird, but could you please help do a test?

 

1. Get the Domain Index parameters from class Mib

2. Download Domain using VFD(0) reference.

 

And let me know if it works this way.

 

Thanks.

Chris

0 Kudos
Message 7 of 14
(9,873 Views)

Hi Chris,

 

We tried this option but unfortunately could not succeed. we are getting an exception when we tried to download to the index which we received in the MIB class.

 

Regards,

Sundar

0 Kudos
Message 8 of 14
(9,870 Views)

1. Could you please let me know the exception message?

2. Did you do the same DomainDownload() using C language? and successfully?

 

Regards,

Chris

0 Kudos
Message 9 of 14
(9,863 Views)

Hi,

 

1. I am seeing "FBInvalidDescriptorException" when i try to use the downloaddomain.

2. I tried using the DownloadDomain() API in C. Its working good.

 

Regards,

Sundar

0 Kudos
Message 10 of 14
(9,849 Views)